QUERY PLAN
Limit (cost=248.82..248.86 rows=13 width=158)
-> Sort (cost=248.82..248.86 rows=13 width=158)
Sort Key: c.created_at DESC
-> Group (cost=248.49..248.58 rows=13 width=158)
Group Key: c.id, client.id
-> Sort (cost=248.49..248.52 rows=13 width=158)
Sort Key: c.id, client.id
-> Nested Loop Left Join (cost=78.76..248.25 rows=13 width=158)
-> Hash Join (cost=78.48..217.92 rows=13 width=150)
Hash Cond: (c.id = cm.contact_id)
-> Seq Scan on tbl_contacts c (cost=0.00..138.24 rows=214 width=150)
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 Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..2.33 rows=1 width=8)
Index Cond: (id = c.client_id)