QUERY PLAN
Limit (cost=177.05..177.10 rows=20 width=150)
-> Sort (cost=177.05..179.69 rows=1059 width=150)
Sort Key: c.pinyin1, c.namecut1, c.pinyin2, c.namecut2, c.pinyin3, c.namecut3, c.pinyin4, c.namecut4, c.created_by, c.created_at DESC
-> HashAggregate (cost=138.28..148.87 rows=1059 width=150)
Group Key: c.id
-> Seq Scan on tbl_contacts c (cost=0.00..135.63 rows=1059 width=150)
Filter: ((supplier_id IS NOT NULL) AND ((supplier_id IS NOT NULL) OR (client_id IS NOT NULL)))