QUERY PLAN
Aggregate (cost=244.34..244.35 rows=1 width=8)
-> Sort (cost=218.18..222.54 rows=1744 width=346)
Sort Key: l.settle_at DESC
-> HashAggregate (cost=106.84..124.28 rows=1744 width=346)
Group Key: l.id
-> Hash Right Join (cost=77.24..102.48 rows=1744 width=12)
Hash Cond: (eh.erp_bank_amount_change_log_id = l.id)
-> Seq Scan on tbl_erp_bank_amount_change_log_handlers eh (cost=0.00..21.65 rows=1365 width=8)
-> Hash (cost=55.44..55.44 rows=1744 width=24)
-> Seq Scan on tbl_erp_bank_amount_change_logs l (cost=0.00..55.44 rows=1744 width=24)