QUERY PLAN
GroupAggregate (cost=5.14..5.18 rows=1 width=78)
Group Key: t.id
-> Sort (cost=5.14..5.15 rows=3 width=22)
Sort Key: t.id DESC
-> Hash Right Join (cost=1.68..5.11 rows=3 width=22)
Hash Cond: (i.ledger_ticket_id = t.id)
-> Seq Scan on tbl_ledger_ticket_items i (cost=0.00..3.12 rows=112 width=12)
-> Hash (cost=1.67..1.67 rows=1 width=14)
-> Seq Scan on tbl_ledger_tickets t (cost=0.00..1.67 rows=1 width=14)
Filter: ((ledger_id = 1) AND (type = 2) AND (settle_month = '2026-05-01'::date))