QUERY PLAN
Aggregate (cost=262.96..262.97 rows=1 width=8)
-> Unique (cost=218.44..255.01 rows=636 width=380)
-> Sort (cost=218.44..220.03 rows=636 width=380)
Sort Key: s.updated_at DESC, s.id, s.name, s.abbr, s.pinyin_shortcut, s.main_products, s.company_nature, s.website, s.established_at, s.capital, s.corp_rep, s.reg_address, s.telephone, s.fax, s.description, s.main_contact, s.created_by, s.created_at, s.working_address, s.capital_currency, s.payment_cycle, s.account_number
-> HashAggregate (cost=182.47..188.83 rows=636 width=380)
Group Key: s.id
-> Hash Right Join (cost=37.31..179.10 rows=1348 width=380)
Hash Cond: (c.supplier_id = s.id)
-> Seq Scan on tbl_contacts c (cost=0.00..138.24 rows=1348 width=4)
Filter: (supplier_id IS NOT NULL)
-> Hash (cost=29.36..29.36 rows=636 width=380)
-> Seq Scan on tbl_suppliers s (cost=0.00..29.36 rows=636 width=380)