QUERY PLAN
Aggregate (cost=257.76..257.77 rows=1 width=8)
-> Unique (cost=214.43..250.03 rows=619 width=382)
-> Sort (cost=214.43..215.98 rows=619 width=382)
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=179.54..185.73 rows=619 width=382)
Group Key: s.id
-> Hash Right Join (cost=35.93..176.20 rows=1337 width=382)
Hash Cond: (c.supplier_id = s.id)
-> Seq Scan on tbl_contacts c (cost=0.00..136.75 rows=1337 width=4)
Filter: (supplier_id IS NOT NULL)
-> Hash (cost=28.19..28.19 rows=619 width=382)
-> Seq Scan on tbl_suppliers s (cost=0.00..28.19 rows=619 width=382)