QUERY PLAN
GroupAggregate (cost=597.20..597.24 rows=1 width=36)
Group Key: p.client_id, ttr.taxonomy_id, tt.name
-> Sort (cost=597.20..597.20 rows=1 width=40)
Sort Key: p.client_id, ttr.taxonomy_id, tt.name
-> Nested Loop Left Join (cost=50.34..597.19 rows=1 width=40)
-> Nested Loop (cost=50.19..596.92 rows=1 width=28)
-> Bitmap Heap Scan on tbl_projects p (cost=49.90..174.46 rows=39 width=8)
Recheck Cond: (client_id = ANY ('{1121,539,1034,2526,166,3457,1425,3459,3300,3217,3170,2446,2436,2285,2272,2151,2105,2000,56}'::integer[]))
Filter: (project_status = 3)
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..49.89 rows=72 width=0)
Index Cond: (client_id = ANY ('{1121,539,1034,2526,166,3457,1425,3459,3300,3217,3170,2446,2436,2285,2272,2151,2105,2000,56}'::integer[]))
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships ttr (cost=0.29..10.82 rows=1 width=28)
Index Cond: ((object_id = p.id) AND (term_id = 1))
Filter: ((taxonomy_id IS NOT NULL) AND (value IS NOT NULL) AND (object_type = 1))
-> 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)