QUERY PLAN
HashAggregate (cost=368.22..368.25 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=5.07..365.72 rows=1000 width=4)
-> ProjectSet (cost=5.07..333.22 rows=1000 width=8)
-> Bitmap Heap Scan on tbl_work_logs (cost=5.07..328.20 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-05-31 00:00:00+08'::timestamp with time zone) AND (end_at >= '2026-05-01 00:00:00+08'::timestamp with time zone))
-> Bitmap Index Scan on tbl_work_logs_created_by_idx (cost=0.00..5.07 rows=104 width=0)
Index Cond: (created_by = 1000)