QUERY PLAN
GroupAggregate (cost=257.29..257.36 rows=2 width=53)
Group Key: pt.product_type_id, pt.name
-> Sort (cost=257.29..257.30 rows=2 width=26)
Sort Key: pt.product_type_id, pt.name
-> Hash Join (cost=178.26..257.28 rows=2 width=26)
Hash Cond: (pt.project_id = tbl_projects.id)
-> Seq Scan on tbl_project_product_types pt (cost=0.00..69.44 rows=3644 width=30)
-> Hash (cost=178.24..178.24 rows=2 width=4)
-> Bitmap Heap Scan on tbl_projects (cost=40.76..178.24 rows=2 width=4)
Recheck Cond: ((created_by = ANY ('{5500,5499,5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])) AND (created_by = 1001))
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..40.76 rows=89 width=0)
Index Cond: ((created_by = ANY ('{5500,5499,5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])) AND (created_by = 1001))