QUERY PLAN
GroupAggregate (cost=1704.00..1704.40 rows=10 width=36)
Group Key: p.client_id, ttr.taxonomy_id, tt.name
-> Sort (cost=1704.00..1704.03 rows=10 width=40)
Sort Key: p.client_id, ttr.taxonomy_id, tt.name
-> Nested Loop Left Join (cost=230.42..1703.84 rows=10 width=40)
-> Hash Join (cost=230.27..1701.17 rows=10 width=28)
Hash Cond: (ttr.object_id = p.id)
-> Seq Scan on tbl_term_taxonomy_relationships ttr (cost=0.00..1470.28 rows=237 width=28)
Filter: ((taxonomy_id IS NOT NULL) AND (value IS NOT NULL) AND (term_id = 1) AND (object_type = 1))
-> Hash (cost=225.63..225.63 rows=371 width=8)
-> Bitmap Heap Scan on tbl_projects p (cost=54.79..225.63 rows=371 width=8)
Recheck Cond: (client_id = ANY ('{5,149,982,89,2601,20,918,12,2181,1492,57,15,287,3296,989,2091,14,90,426,2737}'::integer[]))
Filter: (project_status = 3)
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..54.70 rows=689 width=0)
Index Cond: (client_id = ANY ('{5,149,982,89,2601,20,918,12,2181,1492,57,15,287,3296,989,2091,14,90,426,2737}'::integer[]))
-> Index Scan using tbl_term_taxonomies_pkey on tbl_term_taxonomies tt (cost=0.15..0.27 rows=1 width=16)
Index Cond: (ttr.taxonomy_id = id)