QUERY PLAN
HashAggregate (cost=8.87..9.21 rows=23 width=68)
Group Key: i.ledger_account_caption_id
-> Hash Join (cost=2.79..7.73 rows=152 width=12)
Hash Cond: (i.ledger_ticket_id = t.id)
-> Seq Scan on tbl_ledger_ticket_items i (cost=0.00..4.52 rows=152 width=16)
-> Hash (cost=1.98..1.98 rows=65 width=4)
-> Seq Scan on tbl_ledger_tickets t (cost=0.00..1.98 rows=65 width=4)
Filter: ((ledger_id = 1) AND (status = 1))