QUERY PLAN
GroupAggregate (cost=336.30..338.48 rows=67 width=53)
Group Key: pt.product_type_id, pt.name
-> Sort (cost=336.30..336.47 rows=67 width=26)
Sort Key: pt.product_type_id, pt.name
-> Hash Join (cost=255.69..334.27 rows=67 width=26)
Hash Cond: (pt.project_id = tbl_projects.id)
-> Seq Scan on tbl_project_product_types pt (cost=0.00..69.09 rows=3609 width=30)
-> Hash (cost=254.97..254.97 rows=58 width=4)
-> Seq Scan on tbl_projects (cost=0.00..254.97 rows=58 width=4)
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 <= '2026-12-31'::date) AND (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5332,5449,5467,5476}'::integer[])))