QUERY PLAN
Aggregate (cost=21.04..21.05 rows=1 width=32)
-> Nested Loop (cost=0.00..21.04 rows=1 width=32)
Join Filter: (r.erp_other_collect_ticket_id = t.id)
-> Seq Scan on tbl_erp_other_collect_ticket_approve_borrow_settles r (cost=0.00..19.75 rows=4 width=36)
Filter: (approve_id = 2229)
-> Materialize (cost=0.00..1.17 rows=2 width=4)
-> Seq Scan on tbl_erp_other_collect_tickets t (cost=0.00..1.16 rows=2 width=4)
Filter: (status = ANY ('{2,5}'::integer[]))