QUERY PLAN
GroupAggregate (cost=1700.11..1700.47 rows=9 width=36)
Group Key: p.client_id, ttr.taxonomy_id, tt.name
-> Sort (cost=1700.11..1700.14 rows=9 width=40)
Sort Key: p.client_id, ttr.taxonomy_id, tt.name
-> Nested Loop Left Join (cost=226.82..1699.97 rows=9 width=40)
-> Hash Join (cost=226.67..1697.58 rows=9 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=222.64..222.64 rows=322 width=8)
-> Bitmap Heap Scan on tbl_projects p (cost=54.18..222.64 rows=322 width=8)
Recheck Cond: (client_id = ANY ('{2601,12,1492,57,15,287,989,14,90,426,876,93,2125,39,2094,3334,1663,497,518,2136}'::integer[]))
Filter: (project_status = 3)
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..54.10 rows=599 width=0)
Index Cond: (client_id = ANY ('{2601,12,1492,57,15,287,989,14,90,426,876,93,2125,39,2094,3334,1663,497,518,2136}'::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)