QUERY PLAN
GroupAggregate (cost=417.09..417.84 rows=25 width=214)
Group Key: ci.id
-> Sort (cost=417.09..417.15 rows=25 width=160)
Sort Key: ci.id
-> Hash Right Join (cost=101.68..416.51 rows=25 width=160)
Hash Cond: (c.client_industry = ci.id)
-> Nested Loop (cost=100.12..414.89 rows=19 width=14)
-> Bitmap Heap Scan on tbl_projects p (cost=99.84..305.27 rows=19 width=14)
Recheck Cond: ((created_by = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])) AND (created_by = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])))
Filter: ((bargain_date >= '2026-01-01'::date) AND (bargain_date < '2027-01-01 00:00:00'::timestamp without time zone) AND (bargain_date >= '2026-01-01'::date) AND (bargain_date < '2027-01-01 00:00:00'::timestamp without time zone) AND (project_status = 3))
-> Bitmap Index Scan on tbl_projects_created_by_idx (cost=0.00..99.84 rows=1132 width=0)
Index Cond: ((created_by = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])) AND (created_by = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])))
-> Index Scan using tbl_clients_pkey on tbl_clients c (cost=0.28..5.77 rows=1 width=8)
Index Cond: (id = p.client_id)
-> Hash (cost=1.25..1.25 rows=25 width=150)
-> Seq Scan on tbl_client_industries ci (cost=0.00..1.25 rows=25 width=150)