QUERY PLAN
Aggregate (cost=4.85..4.86 rows=1 width=32)
-> Hash Join (cost=3.09..4.76 rows=36 width=5)
Hash Cond: (r.erp_other_collect_ticket_id = t.id)
-> Seq Scan on tbl_erp_other_collect_ticket_bank_outs r (cost=0.00..1.55 rows=42 width=9)
Filter: (erp_bank_id = 1)
-> Hash (cost=2.59..2.59 rows=40 width=4)
-> Seq Scan on tbl_erp_other_collect_tickets t (cost=0.00..2.59 rows=40 width=4)
Filter: ((bank_settle_at IS NOT NULL) AND (status = ANY ('{2,5}'::integer[])))