QUERY PLAN
HashAggregate (cost=429.84..432.91 rows=307 width=48)
Group Key: tt.id
-> Hash Left Join (cost=48.41..427.59 rows=450 width=24)
Hash Cond: (ttr.taxonomy_id = tt.id)
-> Merge Right Join (cost=37.50..415.49 rows=450 width=12)
Merge Cond: (ttr.object_id = d.id)
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships ttr (cost=0.29..2222.93 rows=456 width=8)
Index Cond: (term_id = 7)
-> Sort (cost=32.33..33.46 rows=450 width=16)
Sort Key: d.id
-> Seq Scan on tbl_documents d (cost=0.00..12.50 rows=450 width=16)
-> Hash (cost=7.07..7.07 rows=307 width=16)
-> Seq Scan on tbl_term_taxonomies tt (cost=0.00..7.07 rows=307 width=16)