QUERY PLAN
Result (cost=14.40..14.41 rows=1 width=1)
InitPlan 1 (returns $0)
-> Bitmap Heap Scan on tbl_ledger_settles (cost=4.21..14.40 rows=1 width=0)
Recheck Cond: (ledger_id = 1)
Filter: (is_settle AND (((start_date <= '2026-05-31'::date) AND (end_date >= '2026-05-31'::date)) OR ((date = '2026-05-01'::date) AND ((start_date IS NULL) OR (end_date IS NULL)))))
-> Bitmap Index Scan on idx_tbl_ledger_settles_ledger_id (cost=0.00..4.21 rows=7 width=0)
Index Cond: (ledger_id = 1)