QUERY PLAN
Aggregate (cost=2.43..2.44 rows=1 width=8)
-> HashAggregate (cost=1.57..1.95 rows=38 width=59)
Group Key: t.id
-> Seq Scan on tbl_ledger_tickets t (cost=0.00..1.48 rows=38 width=4)
Filter: (ledger_id = 1)