QUERY PLAN
Group (cost=425.40..425.40 rows=1 width=407)
Group Key: r.id
-> Sort (cost=425.40..425.40 rows=1 width=407)
Sort Key: r.id
-> Nested Loop (cost=0.29..425.39 rows=1 width=407)
-> Seq Scan on tbl_approves r (cost=0.00..183.71 rows=30 width=407)
Filter: ((status = 2) AND (purchase_contract_id = ANY ('{4141,4133,4122,4103,4098,4056,4000,3987,3982,3969,3936,3917,3903,3902,3901,3863,3804,3769,4118,3756}'::integer[])))
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.05 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 17))
Filter: (taxonomy_id = 2100000000)