QUERY PLAN
Append (cost=0.28..91.05 rows=6 width=151)
-> Nested Loop (cost=0.28..48.28 rows=1 width=127)
-> Seq Scan on tbl_erp_collect_ticket_settles r (cost=0.00..39.96 rows=1 width=14)
Filter: (erp_other_collect_ticket_id = 36)
-> Index Scan using tbl_erp_collect_tickets_pkey on tbl_erp_collect_tickets t (cost=0.28..8.30 rows=1 width=65)
Index Cond: (id = r.erp_collect_ticket_id)
Filter: (status = ANY ('{2,5}'::integer[]))
-> Nested Loop (cost=0.28..9.33 rows=1 width=173)
-> Seq Scan on tbl_erp_cash_cost_ticket_sales_contract_settles r_1 (cost=0.00..1.01 rows=1 width=40)
Filter: (erp_other_collect_ticket_id = 36)
-> Index Scan using tbl_erp_cash_cost_tickets_pkey on tbl_erp_cash_cost_tickets t_1 (cost=0.28..8.30 rows=1 width=81)
Index Cond: (id = r_1.erp_cash_cost_ticket_id)
Filter: (status = ANY ('{2,5}'::integer[]))
-> Nested Loop (cost=0.28..9.38 rows=1 width=162)
-> Seq Scan on tbl_erp_payment_ticket_payments r_2 (cost=0.00..1.06 rows=1 width=40)
Filter: (erp_other_collect_ticket_id = 36)
-> Index Scan using tbl_erp_payment_tickets_pkey on tbl_erp_payment_tickets t_2 (cost=0.28..8.30 rows=1 width=74)
Index Cond: (id = r_2.erp_payment_ticket_id)
Filter: (status = ANY ('{2,5}'::integer[]))
-> Hash Join (cost=1.21..24.01 rows=3 width=148)
Hash Cond: (r_3.erp_wage_ticket_id = t_3.id)
-> Seq Scan on tbl_erp_wage_ticket_amount_payments r_3 (cost=0.00..22.75 rows=5 width=40)
Filter: (erp_other_collect_ticket_id = 36)
-> Hash (cost=1.14..1.14 rows=6 width=56)
-> Seq Scan on tbl_erp_wage_tickets t_3 (cost=0.00..1.14 rows=6 width=56)
Filter: (status = ANY ('{2,5}'::integer[]))