| Sort (cost=273.13..273.19 rows=25 width=76) |
| Sort Key: "*SELECT* 1".id DESC |
| -> Result (cost=86.98..272.55 rows=25 width=76) |
| -> Append (cost=86.98..272.30 rows=25 width=44) |
| -> Subquery Scan on "*SELECT* 1" (cost=86.98..157.36 rows=23 width=42) |
| -> Hash Join (cost=86.98..157.13 rows=23 width=98) |
| Hash Cond: (t.id = r.erp_collect_ticket_id) |
| -> Seq Scan on tbl_erp_collect_tickets t (cost=0.00..61.74 rows=2136 width=4) |
| Filter: (status = ANY ('{2,5}'::integer[])) |
| -> Hash (cost=86.70..86.70 rows=23 width=18) |
| -> Seq Scan on tbl_erp_collect_ticket_settles r (cost=0.00..86.70 rows=23 width=18) |
| Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{4024,4046,4147,4044,4035,4129,4168,4198,4197,4226,3941,3931,3924,3952,3958,4020,4027,4008,4061,3953}'::integer[]))) |
| -> Subquery Scan on "*SELECT* 2" (cost=0.28..9.36 rows=1 width=68) |
| -> Nested Loop (cost=0.28..9.35 rows=1 width=124) |
| -> Seq Scan on tbl_erp_cash_cost_ticket_sales_contract_settles r_1 (cost=0.00..1.03 rows=1 width=44) |
| Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{4024,4046,4147,4044,4035,4129,4168,4198,4197,4226,3941,3931,3924,3952,3958,4020,4027,4008,4061,3953}'::integer[]))) |
| -> 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=4) |
| Index Cond: (id = r_1.erp_cash_cost_ticket_id) |
| Filter: (is_payment_settle AND (status = ANY ('{2,5}'::integer[]))) |
| -> Subquery Scan on "*SELECT* 3" (cost=0.28..105.58 rows=1 width=68) |
| -> Nested Loop (cost=0.28..105.57 rows=1 width=124) |
| -> Seq Scan on tbl_erp_payment_ticket_settles r_2 (cost=0.00..97.25 rows=1 width=18) |
| Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{4024,4046,4147,4044,4035,4129,4168,4198,4197,4226,3941,3931,3924,3952,3958,4020,4027,4008,4061,3953}'::integer[]))) |
| -> Index Scan using tbl_erp_payment_tickets_pkey on tbl_erp_payment_tickets t_2 (cost=0.28..8.30 rows=1 width=4) |
| Index Cond: (id = r_2.erp_payment_ticket_id) |
| Filter: (is_payment_settle AND (status = ANY ('{2,5}'::integer[]))) |