QUERY PLAN
Sort (cost=18.13..18.14 rows=1 width=397)
Sort Key: t.ticket_date, t.serial_no, i.sort, i.id
-> Hash Right Join (cost=5.34..18.12 rows=1 width=397)
Hash Cond: (a.id = i.auxiliary_item_id)
-> Seq Scan on tbl_ledger_auxiliary_items a (cost=0.00..12.00 rows=200 width=306)
-> Hash (cost=5.33..5.33 rows=1 width=69)
-> Hash Join (cost=3.41..5.33 rows=1 width=69)
Hash Cond: (t.id = i.ledger_ticket_id)
-> Seq Scan on tbl_ledger_tickets t (cost=0.00..1.76 rows=38 width=14)
Filter: ((ticket_date >= '2026-05-01'::date) AND (ticket_date <= '2026-05-31'::date) AND (ledger_id = 1) AND (status = 1))
-> Hash (cost=3.40..3.40 rows=1 width=59)
-> Seq Scan on tbl_ledger_ticket_items i (cost=0.00..3.40 rows=1 width=59)
Filter: (ledger_account_caption_id = 58)