QUERY PLAN
Sort (cost=5.54..5.54 rows=1 width=132)
Sort Key: verify_at DESC
-> Seq Scan on tbl_punch_leaves (cost=0.00..5.53 rows=1 width=132)
Filter: ((status = ANY ('{2,5}'::integer[])) AND (created_by = 1000) AND (((leave_start < '2025-06-25'::date) AND (leave_end > '2025-06-25'::date)) OR ((leave_end = '2025-06-25'::date) AND (leave_end_type = 2)) OR ((leave_start = '2025-06-25'::date) AND (leave_start_type = 2)) OR ((leave_start = '2025-06-25'::date) AND (leave_start_type = 1) AND (leave_end <> '2025-06-25'::date))))