QUERY PLAN
Aggregate (cost=24.10..24.11 rows=1 width=32)
-> Hash Join (cost=1.33..24.09 rows=4 width=32)
Hash Cond: (r.erp_wage_ticket_id = t.id)
-> Seq Scan on tbl_erp_wage_ticket_amount_payments r (cost=0.00..22.75 rows=5 width=36)
Filter: (erp_other_collect_ticket_id = 58)
-> Hash (cost=1.18..1.18 rows=12 width=4)
-> Seq Scan on tbl_erp_wage_tickets t (cost=0.00..1.18 rows=12 width=4)
Filter: (status = ANY ('{2,5}'::integer[]))