QUERY PLAN
Aggregate (cost=67.26..67.27 rows=1 width=32)
-> Sort (cost=67.09..67.12 rows=11 width=1018)
Sort Key: b.is_delete, b.sort
-> GroupAggregate (cost=66.24..66.90 rows=11 width=1018)
Group Key: b.id
-> Merge Left Join (cost=66.24..66.71 rows=11 width=17)
Merge Cond: (b.id = t.erp_bank_id)
-> Sort (cost=1.30..1.33 rows=11 width=9)
Sort Key: b.id
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.11 rows=11 width=9)
-> GroupAggregate (cost=64.94..65.19 rows=7 width=12)
Group Key: t.erp_bank_id
-> Sort (cost=64.94..65.00 rows=25 width=4)
Sort Key: t.erp_bank_id
-> Seq Scan on tbl_erp_bank_amount_change_logs t (cost=0.00..64.36 rows=25 width=4)
Filter: ((out_amount IS NOT NULL) AND (settle_at >= '2026-05-01 00:00:00+08'::timestamp with time zone) AND (settle_at <= '2026-05-31 23:59:59+08'::timestamp with time zone))