QUERY PLAN
Aggregate (cost=47.92..47.93 rows=1 width=32)
-> Nested Loop (cost=3.99..47.92 rows=1 width=6)
-> Hash Join (cost=3.71..42.26 rows=1 width=10)
Hash Cond: (r.erp_other_payment_ticket_id = op.id)
-> Seq Scan on tbl_erp_payment_ticket_settles r (cost=0.00..38.50 rows=19 width=14)
Filter: (erp_other_payment_ticket_id IS NOT NULL)
-> Hash (cost=3.67..3.67 rows=3 width=4)
-> Seq Scan on tbl_erp_other_payment_tickets op (cost=0.00..3.67 rows=3 width=4)
Filter: (ticket_type = 3)
-> Index Scan using tbl_erp_payment_tickets_pkey on tbl_erp_payment_tickets t (cost=0.28..5.57 rows=1 width=4)
Index Cond: (id = r.erp_payment_ticket_id)
Filter: ((bank_settle_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))