QUERY PLAN
Group (cost=514.79..514.80 rows=1 width=471)
Group Key: r.id
-> Sort (cost=514.79..514.80 rows=1 width=471)
Sort Key: r.id
-> Nested Loop (cost=0.29..514.78 rows=1 width=471)
-> Seq Scan on tbl_approves r (cost=0.00..231.18 rows=36 width=471)
Filter: ((status = 2) AND (purchase_contract_id = ANY ('{4463,4447,4376,4374,4350,4293,4295,4250,4240,4145,4136,4122,4103,4098,4017,4056,4000,3969,3936,3917}'::integer[])))
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..7.87 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 17))
Filter: (taxonomy_id = 2100000000)