QUERY PLAN
Aggregate (cost=75.69..75.70 rows=1 width=32)
-> Nested Loop Left Join (cost=73.14..75.66 rows=3 width=72)
Join Filter: (t.id = b.id)
-> Hash Left Join (cost=73.14..74.24 rows=3 width=68)
Hash Cond: (b.id = f.erp_bank_id)
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.09 rows=3 width=4)
Filter: (type = 0)
-> Hash (cost=73.05..73.05 rows=7 width=68)
-> Subquery Scan on f (cost=72.88..73.05 rows=7 width=68)
-> HashAggregate (cost=72.88..72.98 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.80 rows=1744 width=15)
Filter: (settle_at <= '2026-06-30 23:59:59+08'::timestamp with time zone)
-> Materialize (cost=0.00..1.12 rows=7 width=12)
-> Seq Scan on tbl_erp_banks t (cost=0.00..1.09 rows=7 width=12)
Filter: (created_at <= '2026-06-30 23:59:59+08'::timestamp with time zone)