QUERY PLAN
Aggregate (cost=303.03..303.04 rows=1 width=32)
-> Group (cost=285.55..302.67 rows=13 width=465)
Group Key: r.id
-> Nested Loop Left Join (cost=285.55..302.64 rows=13 width=6)
-> Merge Left Join (cost=285.26..285.35 rows=13 width=6)
Merge Cond: (r.id = rcvr.approve_id)
-> Sort (cost=284.23..284.26 rows=13 width=6)
Sort Key: r.id
-> Hash Right Join (cost=218.21..283.99 rows=13 width=6)
Hash Cond: (rvr.approve_id = r.id)
-> Seq Scan on tbl_approve_verify_rels rvr (cost=0.00..54.03 rows=3103 width=4)
-> Hash (cost=218.07..218.07 rows=11 width=6)
-> Nested Loop (cost=0.28..218.07 rows=11 width=6)
-> Seq Scan on tbl_approve_carbon_copy_rels rccr (cost=0.00..138.76 rows=11 width=4)
Filter: (user_id = 1000)
-> Index Scan using tbl_approves_pkey on tbl_approves r (cost=0.28..7.21 rows=1 width=14)
Index Cond: (id = rccr.approve_id)
Filter: (status <> 0)
-> Sort (cost=1.03..1.03 rows=2 width=4)
Sort Key: rcvr.approve_id
-> Seq Scan on tbl_approve_cancel_verify_rels rcvr (cost=0.00..1.02 rows=2 width=4)
-> Index Only Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..1.32 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 17))