QUERY PLAN
Sort (cost=9.27..9.28 rows=1 width=140)
Sort Key: verify_at DESC
-> Seq Scan on tbl_punch_leaves (cost=0.00..9.26 rows=1 width=140)
Filter: ((status = ANY ('{2,5}'::integer[])) AND (created_by = 1001) AND (((leave_start < '2026-07-01'::date) AND (leave_end > '2026-07-01'::date)) OR ((leave_start = '2026-07-01'::date) AND (leave_start_type = 1)) OR ((leave_start <> '2026-07-01'::date) AND (leave_end = '2026-07-01'::date)) OR ((leave_start = '2026-07-01'::date) AND (leave_end = '2026-07-01'::date) AND (leave_start_time IS NOT NULL) AND ((leave_start_time)::text < '13:00'::text))))