QUERY PLAN
Aggregate (cost=8.19..8.20 rows=1 width=8)
-> Sort (cost=8.17..8.18 rows=1 width=715)
Sort Key: tbl_voucher_gen_batches.created_at DESC, tbl_voucher_gen_batches.id DESC
-> Index Scan using idx_tbl_voucher_gen_batches_ledger_id on tbl_voucher_gen_batches (cost=0.14..8.16 rows=1 width=715)
Index Cond: (ledger_id = 1)
Filter: (NOT is_deleted)