QUERY PLAN
Aggregate (cost=535.49..535.50 rows=1 width=32)
-> Hash Join (cost=36.15..533.02 rows=987 width=5)
Hash Cond: (t.id = r.erp_cash_cost_ticket_id)
-> Seq Scan on tbl_erp_cash_cost_tickets t (cost=0.00..444.86 rows=8427 width=4)
Filter: (is_payment_settle AND (status = ANY ('{2,5}'::integer[])))
-> Hash (cost=23.75..23.75 rows=992 width=9)
-> Seq Scan on tbl_erp_cash_cost_ticket_bank_outs r (cost=0.00..23.75 rows=992 width=9)
Filter: (erp_bank_id = 1)