QUERY PLAN
Group (cost=396.05..396.05 rows=1 width=467)
Group Key: r.id
-> Sort (cost=396.05..396.05 rows=1 width=467)
Sort Key: r.id
-> Nested Loop (cost=0.29..396.04 rows=1 width=467)
-> Seq Scan on tbl_approves r (cost=0.00..233.59 rows=20 width=467)
Filter: ((status = 2) AND (purchase_contract_id = ANY ('{4501,4499,4498,4487,4473,4471,4470,4468,4465,4464,4463,4461,4460,4459,4458,4456,4452,4451,4449,4448}'::integer[])))
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.11 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 17))
Filter: (taxonomy_id = 2100000000)