QUERY PLAN
Aggregate (cost=63.36..63.37 rows=1 width=32)
-> Sort (cost=63.19..63.22 rows=11 width=1018)
Sort Key: b.is_delete, b.sort
-> GroupAggregate (cost=62.54..63.00 rows=11 width=1018)
Group Key: b.id
-> Merge Left Join (cost=62.54..62.64 rows=11 width=79)
Merge Cond: (b.id = t_1.erp_bank_id)
-> Sort (cost=2.57..2.59 rows=11 width=15)
Sort Key: b.id
-> Hash Left Join (cost=1.22..2.38 rows=11 width=15)
Hash Cond: (b.id = t.id)
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.11 rows=11 width=9)
-> Hash (cost=1.14..1.14 rows=7 width=10)
-> Seq Scan on tbl_erp_banks t (cost=0.00..1.14 rows=7 width=10)
Filter: (created_at <= '2026-05-31 23:59:59+08'::timestamp with time zone)
-> GroupAggregate (cost=59.97..60.00 rows=1 width=68)
Group Key: t_1.erp_bank_id
-> Sort (cost=59.97..59.98 rows=1 width=15)
Sort Key: t_1.erp_bank_id
-> Seq Scan on tbl_erp_bank_amount_change_logs t_1 (cost=0.00..59.96 rows=1 width=15)
Filter: (settle_at <= '2024-04-01 00:00:00+08'::timestamp with time zone)