Aggregate (cost=225.23..225.24 rows=1 width=8) |
-> Sort (cost=225.21..225.21 rows=1 width=2975) |
Sort Key: (CASE c.user_status WHEN 3 THEN 1 WHEN 1 THEN 0 ELSE c.user_status END) DESC, c.updated_at DESC |
-> GroupAggregate (cost=225.18..225.20 rows=1 width=2975) |
Group Key: c.id |
-> Sort (cost=225.18..225.18 rows=1 width=16) |
Sort Key: c.id |
-> Nested Loop (cost=144.15..225.17 rows=1 width=16) |
-> Hash Right Join (cost=143.88..216.86 rows=1 width=20) |
Hash Cond: (cm.contact_id = c.id) |
-> Seq Scan on tbl_contact_mobiles cm (cost=0.00..72.24 rows=284 width=4) |
Filter: (mp_open_id IS NOT NULL) |
-> Hash (cost=143.86..143.86 rows=1 width=20) |
-> Seq Scan on tbl_contacts c (cost=0.00..143.86 rows=1 width=20) |
Filter: (client_id = 2815) |
-> Index Only Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..8.29 rows=1 width=4) |
Index Cond: (id = 2815) |