QUERY PLAN
Aggregate (cost=249.02..249.03 rows=1 width=8)
-> Sort (cost=248.82..248.86 rows=13 width=2975)
Sort Key: c.created_at DESC
-> Group (cost=248.49..248.58 rows=13 width=2975)
Group Key: c.id, client.id
-> Sort (cost=248.49..248.52 rows=13 width=16)
Sort Key: c.id, client.id
-> Nested Loop Left Join (cost=78.76..248.25 rows=13 width=16)
-> Hash Join (cost=78.48..217.92 rows=13 width=16)
Hash Cond: (c.id = cm.contact_id)
-> Seq Scan on tbl_contacts c (cost=0.00..138.24 rows=214 width=16)
Filter: ((client_id IS NOT NULL) AND is_mp_bind)
-> Hash (cost=74.92..74.92 rows=285 width=4)
-> Seq Scan on tbl_contact_mobiles cm (cost=0.00..74.92 rows=285 width=4)
Filter: (mp_open_id IS NOT NULL)
-> Index Only Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..2.33 rows=1 width=4)
Index Cond: (id = c.client_id)