QUERY PLAN
Aggregate (cost=72.44..72.46 rows=1 width=32)
-> Nested Loop Left Join (cost=69.68..72.41 rows=4 width=70)
Join Filter: (t.id = b.id)
-> Hash Left Join (cost=69.68..70.83 rows=4 width=68)
Hash Cond: (b.id = f.erp_bank_id)
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.14 rows=4 width=4)
Filter: (type = 1)
-> Hash (cost=69.59..69.59 rows=7 width=68)
-> Subquery Scan on f (cost=69.42..69.59 rows=7 width=68)
-> HashAggregate (cost=69.42..69.53 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=1261 width=15)
Filter: (settle_at <= '2025-12-31 23:59:59+08'::timestamp with time zone)
-> Materialize (cost=0.00..1.17 rows=7 width=10)
-> Seq Scan on tbl_erp_banks t (cost=0.00..1.14 rows=7 width=10)
Filter: (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone)