QUERY PLAN
Limit (cost=179.41..179.51 rows=40 width=145)
-> Sort (cost=179.41..183.77 rows=1744 width=145)
Sort Key: l.settle_at DESC
-> HashAggregate (cost=106.84..124.28 rows=1744 width=145)
Group Key: l.id
-> Hash Right Join (cost=77.24..102.48 rows=1744 width=145)
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=145)
-> Seq Scan on tbl_erp_bank_amount_change_logs l (cost=0.00..55.44 rows=1744 width=145)