QUERY PLAN
Sort (cost=16.90..16.90 rows=1 width=217)
Sort Key: pt.id
-> Hash Right Join (cost=12.66..16.89 rows=1 width=217)
Hash Cond: (tt.id = pt.taxonomy_id)
-> Seq Scan on tbl_term_taxonomies tt (cost=0.00..3.61 rows=161 width=21)
-> Hash (cost=12.65..12.65 rows=1 width=124)
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships pt (cost=0.15..12.65 rows=1 width=124)
Index Cond: ((object_id = ANY ('{4,3,2,1}'::integer[])) AND (term_id = 18))
Filter: (object_type = 8)