QUERY PLAN
Aggregate (cost=67.89..67.90 rows=1 width=32)
-> Sort (cost=67.78..67.80 rows=7 width=1018)
Sort Key: b.is_delete, b.sort
-> GroupAggregate (cost=67.55..67.69 rows=7 width=1018)
Group Key: b.id
-> Sort (cost=67.55..67.56 rows=7 width=17)
Sort Key: b.id
-> Hash Left Join (cost=66.35..67.45 rows=7 width=17)
Hash Cond: (b.id = osb.erp_bank_id)
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.07 rows=7 width=9)
-> Hash (cost=66.26..66.26 rows=7 width=12)
-> Subquery Scan on osb (cost=66.12..66.26 rows=7 width=12)
-> HashAggregate (cost=66.12..66.19 rows=7 width=12)
Group Key: t.erp_bank_id
-> Seq Scan on tbl_erp_bank_amount_change_logs t (cost=0.00..64.16 rows=392 width=4)
Filter: ((out_amount IS NOT NULL) AND (settle_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (settle_at <= '2026-12-31 23:59:59+08'::timestamp with time zone))