QUERY PLAN
GroupAggregate (cost=443.76..444.51 rows=25 width=76)
Group Key: ci.id
-> Sort (cost=443.76..443.83 rows=25 width=22)
Sort Key: ci.id
-> Hash Right Join (cost=112.49..443.18 rows=25 width=22)
Hash Cond: (c.client_industry = ci.id)
-> Nested Loop (cost=110.92..441.55 rows=22 width=14)
-> Bitmap Heap Scan on tbl_projects p (cost=110.65..323.06 rows=22 width=14)
Recheck Cond: ((created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5332,5449,5467,5476,5499,5500}'::integer[])) AND (created_by = ANY ('{5500,5499,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..110.64 rows=1155 width=0)
Index Cond: ((created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5332,5449,5467,5476,5499,5500}'::integer[])) AND (created_by = ANY ('{5500,5499,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.39 rows=1 width=8)
Index Cond: (id = p.client_id)
-> Hash (cost=1.25..1.25 rows=25 width=12)
-> Seq Scan on tbl_client_industries ci (cost=0.00..1.25 rows=25 width=12)