| GroupAggregate (cost=272.70..274.26 rows=48 width=72) |
| Group Key: (to_char((COALESCE(p.bargain_date, c.signed_at))::timestamp with time zone, 'YYYY-MM'::text)), (date_part('month'::text, (COALESCE(p.bargain_date, c.signed_at))::timestamp without time zone)) |
| -> Sort (cost=272.70..272.82 rows=48 width=46) |
| Sort Key: (to_char((COALESCE(p.bargain_date, c.signed_at))::timestamp with time zone, 'YYYY-MM'::text)), (date_part('month'::text, (COALESCE(p.bargain_date, c.signed_at))::timestamp without time zone)) |
| -> Hash Right Join (cost=73.73..271.36 rows=48 width=46) |
| Hash Cond: (p.id = c.from_project) |
| Filter: ((COALESCE(p.bargain_date, c.signed_at) >= '2026-01-01'::date) AND (COALESCE(p.bargain_date, c.signed_at) <= '2026-12-31'::date)) |
| -> Seq Scan on tbl_projects p (cost=0.00..178.82 rows=3182 width=8) |
| -> Hash (cost=68.32..68.32 rows=433 width=14) |
| -> Seq Scan on tbl_sales_contracts c (cost=0.00..68.32 rows=433 width=14) |
| Filter: ((NOT COALESCE(is_draft, false)) AND COALESCE(need_analysis, true)) |