| HashAggregate (cost=776.45..776.48 rows=1 width=4) |
| Group Key: (date_trunc('day'::text, (generate_series((GREATEST((start_at)::date, '2026-05-01'::date))::timestamp with time zone, (LEAST((end_at)::date, '2026-05-31'::date))::timestamp with time zone, '1 day'::interval))))::date |
| -> Result (cost=0.00..773.95 rows=1000 width=4) |
| -> ProjectSet (cost=0.00..741.45 rows=1000 width=8) |
| -> Seq Scan on tbl_calendars (cost=0.00..736.42 rows=1 width=16) |
| Filter: ((start_at IS NOT NULL) AND (alarm_before IS NOT NULL) AND (start_at <= '2026-05-31 00:00:00+08'::timestamp with time zone) AND (end_at >= '2026-05-01 00:00:00+08'::timestamp with time zone) AND (created_by = 1000) AND ((start_at - alarm_before) > now())) |