QUERY PLAN
Aggregate (cost=5.88..5.89 rows=1 width=32)
-> Hash Join (cost=3.01..5.87 rows=4 width=6)
Hash Cond: (op.id = r.erp_other_payment_ticket_id)
-> Seq Scan on tbl_erp_other_payment_tickets op (cost=0.00..2.62 rows=43 width=4)
Filter: (ticket_type = ANY ('{1,2,4}'::integer[]))
-> Hash (cost=2.96..2.96 rows=4 width=10)
-> Hash Join (cost=1.20..2.96 rows=4 width=10)
Hash Cond: (t.id = r.erp_other_income_ticket_id)
-> Seq Scan on tbl_erp_other_income_tickets t (cost=0.00..1.60 rows=25 width=4)
Filter: ((bank_settle_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=1.11..1.11 rows=7 width=14)
-> Seq Scan on tbl_erp_other_income_ticket_purchase_contract_settles r (cost=0.00..1.11 rows=7 width=14)
Filter: (erp_other_payment_ticket_id IS NOT NULL)