QUERY PLAN
Group (cost=627.34..627.34 rows=1 width=389)
Group Key: r.id
-> Sort (cost=627.34..627.34 rows=1 width=389)
Sort Key: r.id
-> Nested Loop (cost=0.29..627.33 rows=1 width=389)
-> Seq Scan on tbl_approves r (cost=0.00..544.10 rows=10 width=389)
Filter: ((status = 2) AND (purchase_contract_id = ANY ('{4074,4073,4072,4070,4069,4067,4066,4063,4062,4060}'::integer[])))
-> Index 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))
Filter: (taxonomy_id = 2100000000)