QUERY PLAN
Group (cost=91.38..91.39 rows=1 width=150)
Group Key: c.id
-> Sort (cost=91.38..91.39 rows=1 width=150)
Sort Key: c.id
-> Nested Loop (cost=0.28..91.37 rows=1 width=150)
-> Seq Scan on tbl_contact_mobiles cm (cost=0.00..83.05 rows=1 width=4)
Filter: ((mobile)::text = '13000000000'::text)
-> Index Scan using tbl_contacts_pkey on tbl_contacts c (cost=0.28..8.31 rows=1 width=150)
Index Cond: (id = cm.contact_id)
Filter: ((client_id IS NULL) AND (client_id IS NOT NULL) AND (id <> 6012) AND (user_status <> 1))