QUERY PLAN
Aggregate (cost=2.18..2.19 rows=1 width=32)
-> Nested Loop (cost=0.00..2.17 rows=1 width=32)
Join Filter: (r.erp_social_insurance_id = t.id)
-> Seq Scan on tbl_erp_social_insurances t (cost=0.00..1.07 rows=1 width=4)
Filter: (status = 2)
-> Seq Scan on tbl_erp_social_insurance_bank_outs r (cost=0.00..1.07 rows=2 width=36)
Filter: (settle_at <= '2025-12-31 23:59:59+08'::timestamp with time zone)