QUERY PLAN
Result (cost=5.53..5.54 rows=1 width=1)
InitPlan 1 (returns $0)
-> Seq Scan on tbl_punch_leaves (cost=0.00..5.53 rows=1 width=0)
Filter: ((created_by = 1000) AND (status = 1) AND (((leave_start < '2025-06-27'::date) AND (leave_end > '2025-06-27'::date)) OR ((leave_end = '2025-06-27'::date) AND (leave_end_type = 2)) OR ((leave_start = '2025-06-27'::date) AND (leave_start_type = 2)) OR ((leave_start = '2025-06-27'::date) AND (leave_start_type = 1) AND (leave_end <> '2025-06-27'::date))))