QUERY PLAN
GroupAggregate (cost=54.70..54.85 rows=9 width=48)
Group Key: tt.id
-> Sort (cost=54.70..54.72 rows=9 width=23)
Sort Key: tt.id
-> Hash Right Join (cost=50.27..54.55 rows=9 width=23)
Hash Cond: (tt.id = ttr.taxonomy_id)
-> Seq Scan on tbl_term_taxonomies tt (cost=0.00..3.61 rows=161 width=15)
-> Hash (cost=50.16..50.16 rows=9 width=12)
-> Nested Loop Left Join (cost=33.39..50.16 rows=9 width=12)
-> Hash Join (cost=33.24..44.94 rows=9 width=12)
Hash Cond: (d.id = vd.document_id)
-> Seq Scan on tbl_documents d (cost=0.00..11.20 rows=120 width=16)
-> Hash (cost=33.12..33.12 rows=9 width=4)
-> Seq Scan on tbl_visible_documents vd (cost=0.00..33.12 rows=9 width=4)
Filter: (accessible_user = 5495)
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships ttr (cost=0.15..0.57 rows=1 width=8)
Index Cond: ((object_id = d.id) AND (term_id = 7))