QUERY PLAN
Aggregate (cost=3.83..3.84 rows=1 width=32)
-> Hash Join (cost=1.02..3.83 rows=1 width=5)
Hash Cond: (t.id = r.erp_other_collect_ticket_id)
-> Seq Scan on tbl_erp_other_collect_tickets t (cost=0.00..2.71 rows=24 width=4)
Filter: ((created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=1.01..1.01 rows=1 width=9)
-> Seq Scan on tbl_erp_other_collect_ticket_payments r (cost=0.00..1.01 rows=1 width=9)
Filter: (erp_advance_payment_ticket_id IS NOT NULL)