QUERY PLAN
Aggregate (cost=73.91..73.92 rows=1 width=32)
-> Sort (cost=73.74..73.77 rows=11 width=1018)
Sort Key: b.is_delete, b.sort
-> GroupAggregate (cost=73.33..73.55 rows=11 width=1018)
Group Key: b.id
-> Sort (cost=73.33..73.36 rows=11 width=17)
Sort Key: b.id
-> Hash Left Join (cost=71.99..73.14 rows=11 width=17)
Hash Cond: (b.id = osb.erp_bank_id)
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.11 rows=11 width=9)
-> Hash (cost=71.90..71.90 rows=7 width=12)
-> Subquery Scan on osb (cost=71.77..71.90 rows=7 width=12)
-> HashAggregate (cost=71.77..71.83 rows=7 width=12)
Group Key: t.erp_bank_id
-> Seq Scan on tbl_erp_bank_amount_change_logs t (cost=0.00..64.36 rows=1482 width=4)
Filter: ((out_amount IS NOT NULL) AND (settle_at >= '2024-04-01 00:00:00+08'::timestamp with time zone) AND (settle_at <= '2026-05-31 23:59:59+08'::timestamp with time zone))