QUERY PLAN
Aggregate (cost=267.99..268.00 rows=1 width=8)
-> Unique (cost=222.00..259.78 rows=657 width=380)
-> Sort (cost=222.00..223.64 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.68..191.25 rows=657 width=380)
Group Key: s.id
-> Hash Right Join (cost=37.78..181.26 rows=1368 width=380)
Hash Cond: (c.supplier_id = s.id)
-> Seq Scan on tbl_contacts c (cost=0.00..139.88 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)