QUERY PLAN
Limit (cost=16.38..16.39 rows=1 width=145)
-> Sort (cost=16.38..16.39 rows=1 width=145)
Sort Key: r.created_at DESC
-> Group (cost=16.36..16.37 rows=1 width=145)
Group Key: r.id
-> Sort (cost=16.36..16.37 rows=1 width=145)
Sort Key: r.id
-> Nested Loop Left Join (cost=10.87..16.35 rows=1 width=145)
Join Filter: (crvr.punch_leave_id = r.id)
-> Hash Right Join (cost=10.87..14.97 rows=1 width=145)
Hash Cond: (rvr.punch_leave_id = r.id)
-> Seq Scan on tbl_punch_leave_verify_rels rvr (cost=0.00..3.66 rows=166 width=4)
-> Hash (cost=10.85..10.85 rows=1 width=145)
-> Seq Scan on tbl_punch_leaves r (cost=0.00..10.85 rows=1 width=145)
Filter: ((leave_start <= '2026-06-01'::date) AND (leave_end >= '2026-06-01'::date) AND (created_by = 5064))
-> Seq Scan on tbl_punch_leave_cancel_verify_rels crvr (cost=0.00..1.17 rows=17 width=4)