QUERY PLAN
Sort (cost=37.56..37.56 rows=1 width=267)
Sort Key: pt.id
-> Hash Right Join (cost=31.06..37.55 rows=1 width=267)
Hash Cond: (tt.id = pt.taxonomy_id)
-> Seq Scan on tbl_term_taxonomies tt (cost=0.00..5.53 rows=253 width=97)
-> Hash (cost=31.05..31.05 rows=1 width=111)
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships pt (cost=0.29..31.05 rows=1 width=111)
Index Cond: ((object_id = ANY ('{3850,3849,3848,3847}'::integer[])) AND (term_id = 18))
Filter: (object_type = 8)