QUERY PLAN
Limit (cost=384.21..384.21 rows=1 width=388)
-> Sort (cost=384.21..384.21 rows=1 width=388)
Sort Key: r.status, r.created_at DESC
-> Group (cost=384.19..384.20 rows=1 width=388)
Group Key: r.id
-> Sort (cost=384.19..384.19 rows=1 width=388)
Sort Key: r.id
-> Nested Loop Left Join (cost=257.34..384.18 rows=1 width=388)
-> Hash Right Join (cost=257.05..375.86 rows=1 width=388)
Hash Cond: (rccr.approve_id = r.id)
Filter: ((r.created_by = 5446) OR (rccr.user_id = 5446) OR (rvr.user_id = 5446))
-> Seq Scan on tbl_approve_carbon_copy_rels rccr (cost=0.00..95.53 rows=6153 width=8)
-> Hash (cost=257.00..257.00 rows=4 width=392)
-> Hash Right Join (cost=212.07..257.00 rows=4 width=392)
Hash Cond: (rvr.approve_id = r.id)
-> Seq Scan on tbl_approve_verify_rels rvr (cost=0.00..39.11 rows=2211 width=8)
-> Hash (cost=212.02..212.02 rows=4 width=388)
-> Seq Scan on tbl_approves r (cost=0.00..212.02 rows=4 width=388)
Filter: ((status <> 0) AND (client_id = 3081))
-> Index Only Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.31 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 17))