QUERY PLAN
Aggregate (cost=2545.61..2545.62 rows=1 width=8)
-> HashAggregate (cost=2537.33..2541.01 rows=368 width=4)
Group Key: tbl_work_logs.client_id
-> Append (cost=0.00..2536.41 rows=368 width=4)
-> Seq Scan on tbl_work_logs (cost=0.00..1891.97 rows=367 width=4)
Filter: ((NOT is_draft) AND (client_id IS NOT NULL) AND (start_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (start_at <= '2026-12-31 00:00:00+08'::timestamp with time zone))
-> Seq Scan on tbl_schedules (cost=0.00..640.76 rows=1 width=4)
Filter: ((NOT is_closed) AND (client_id IS NOT NULL) AND (start_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (start_at <= '2026-12-31 00:00:00+08'::timestamp with time zone))