QUERY PLAN
Aggregate (cost=75.89..75.91 rows=1 width=32)
-> Hash Left Join (cost=74.63..75.83 rows=7 width=70)
Hash Cond: (b.id = f.erp_bank_id)
-> Hash Right Join (cost=1.22..2.40 rows=7 width=10)
Hash Cond: (t.id = b.id)
-> Seq Scan on tbl_erp_banks t (cost=0.00..1.14 rows=11 width=10)
Filter: (created_at <= '2026-06-30 23:59:59+08'::timestamp with time zone)
-> Hash (cost=1.14..1.14 rows=7 width=4)
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.14 rows=7 width=4)
Filter: (type = 0)
-> Hash (cost=73.31..73.31 rows=7 width=68)
-> Subquery Scan on f (cost=73.14..73.31 rows=7 width=68)
-> HashAggregate (cost=73.14..73.24 rows=7 width=68)
Group Key: t_1.erp_bank_id
-> Seq Scan on tbl_erp_bank_amount_change_logs t_1 (cost=0.00..59.96 rows=1757 width=15)
Filter: (settle_at <= '2026-06-30 23:59:59+08'::timestamp with time zone)