QUERY PLAN
HashAggregate (cost=345.62..345.65 rows=1 width=4)
Group Key: (date_trunc('day'::text, (generate_series((GREATEST((start_at)::date, '2026-06-01'::date))::timestamp with time zone, (LEAST((end_at)::date, '2026-06-30'::date))::timestamp with time zone, '1 day'::interval))))::date
-> Result (cost=5.01..343.12 rows=1000 width=4)
-> ProjectSet (cost=5.01..310.62 rows=1000 width=8)
-> Bitmap Heap Scan on tbl_work_logs (cost=5.01..305.60 rows=1 width=16)
Recheck Cond: (created_by = 1000)
Filter: ((start_at IS NOT NULL) AND (end_at IS NOT NULL) AND (NOT is_draft) AND (start_at <= '2026-06-30 00:00:00+08'::timestamp with time zone) AND (end_at >= '2026-06-01 00:00:00+08'::timestamp with time zone))
-> Bitmap Index Scan on tbl_work_logs_created_by_idx (cost=0.00..5.01 rows=96 width=0)
Index Cond: (created_by = 1000)