QUERY PLAN
Aggregate (cost=2.35..2.36 rows=1 width=32)
-> Nested Loop (cost=0.00..2.35 rows=1 width=32)
Join Filter: (r.erp_other_collect_ticket_id = t.id)
-> Seq Scan on tbl_erp_other_collect_ticket_bank_outs r (cost=0.00..1.16 rows=1 width=36)
Filter: (erp_bank_id = 2)
-> Seq Scan on tbl_erp_other_collect_tickets t (cost=0.00..1.16 rows=2 width=4)
Filter: (status = ANY ('{2,5}'::integer[]))