QUERY PLAN
Aggregate (cost=267.95..267.96 rows=1 width=8)
-> Unique (cost=221.96..259.74 rows=657 width=380)
-> Sort (cost=221.96..223.60 rows=657 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=184.64..191.21 rows=657 width=380)
Group Key: s.id
-> Hash Right Join (cost=37.78..181.22 rows=1368 width=380)
Hash Cond: (c.supplier_id = s.id)
-> Seq Scan on tbl_contacts c (cost=0.00..139.84 rows=1368 width=4)
Filter: (supplier_id IS NOT NULL)
-> Hash (cost=29.57..29.57 rows=657 width=380)
-> Seq Scan on tbl_suppliers s (cost=0.00..29.57 rows=657 width=380)