QUERY PLAN
GroupAggregate (cost=457.48..458.65 rows=24 width=214)
Group Key: ci.id
-> Sort (cost=457.48..457.61 rows=54 width=160)
Sort Key: ci.id
-> Hash Right Join (cost=145.60..455.93 rows=54 width=160)
Hash Cond: (c.client_industry = ci.id)
-> Hash Join (cost=144.06..454.22 rows=54 width=14)
Hash Cond: (p.client_id = c.id)
-> Seq Scan on tbl_projects p (cost=0.00..310.03 rows=54 width=14)
Filter: ((bargain_date >= '2025-01-01'::date) AND (bargain_date < '2026-01-01 00:00:00'::timestamp without time zone) AND (bargain_date >= '2025-01-01'::date) AND (bargain_date < '2026-01-01 00:00:00'::timestamp without time zone) AND (project_status = 3) AND (created_by = ANY ('{5329,5332,5448,5420,1001,5087,5300,5311,5295,1013,1004,1005,5449}'::integer[])) AND (created_by = ANY ('{5329,5332,5448,5420,1001,5087,5300,5311,5295,1013,1004,1005,5449}'::integer[])))
-> Hash (cost=119.58..119.58 rows=1958 width=8)
-> Seq Scan on tbl_clients c (cost=0.00..119.58 rows=1958 width=8)
-> Hash (cost=1.24..1.24 rows=24 width=150)
-> Seq Scan on tbl_client_industries ci (cost=0.00..1.24 rows=24 width=150)