QUERY PLAN
Limit (cost=1.69..1.70 rows=1 width=59)
-> Sort (cost=1.69..1.70 rows=1 width=59)
Sort Key: ticket_date, ticket_word, serial_no, id
-> Group (cost=1.68..1.68 rows=1 width=59)
Group Key: id
-> Sort (cost=1.68..1.68 rows=1 width=59)
Sort Key: id
-> Seq Scan on tbl_ledger_tickets t (cost=0.00..1.67 rows=1 width=59)
Filter: ((ticket_date >= '2026-06-01'::date) AND (ticket_date <= '2026-06-30'::date) AND (ledger_id = 1))