Sort (cost=815.76..816.02 rows=102 width=170) |
Sort Key: "*SELECT* 1".id DESC |
-> Result (cost=82.90..812.36 rows=102 width=170) |
-> Append (cost=82.90..811.34 rows=102 width=112) |
-> Subquery Scan on "*SELECT* 1" (cost=82.90..150.34 rows=23 width=94) |
-> Hash Join (cost=82.90..150.11 rows=23 width=98) |
Hash Cond: (t.id = r.erp_collect_ticket_id) |
-> Seq Scan on tbl_erp_collect_tickets t (cost=0.00..59.35 rows=1989 width=48) |
Filter: (status = ANY ('{2,5,1}'::integer[])) |
-> Hash (cost=82.62..82.62 rows=23 width=18) |
-> Seq Scan on tbl_erp_collect_ticket_settles r (cost=0.00..82.62 rows=23 width=18) |
Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{4090,4088,4087,4086,4083,4082,4073,4071,4068,4065,4064,4055,4054,4050,4049,4061,4048,4047,4046,4044}'::integer[]))) |
-> Subquery Scan on "*SELECT* 2" (cost=0.28..566.36 rows=78 width=118) |
-> Nested Loop (cost=0.28..565.58 rows=78 width=122) |
-> Seq Scan on tbl_erp_cash_cost_ticket_sales_contract_settles r_1 (cost=0.00..37.30 rows=78 width=44) |
Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{4090,4088,4087,4086,4083,4082,4073,4071,4068,4065,4064,4055,4054,4050,4049,4061,4048,4047,4046,4044}'::integer[]))) |
-> Index Scan using tbl_erp_cash_cost_tickets_pkey on tbl_erp_cash_cost_tickets t_1 (cost=0.28..6.77 rows=1 width=46) |
Index Cond: (id = r_1.erp_cash_cost_ticket_id) |
Filter: (status = ANY ('{2,5,1}'::integer[])) |
-> Subquery Scan on "*SELECT* 3" (cost=0.28..94.64 rows=1 width=89) |
-> Nested Loop (cost=0.28..94.63 rows=1 width=93) |
-> Seq Scan on tbl_erp_payment_ticket_settles r_2 (cost=0.00..86.31 rows=1 width=18) |
Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{4090,4088,4087,4086,4083,4082,4073,4071,4068,4065,4064,4055,4054,4050,4049,4061,4048,4047,4046,4044}'::integer[]))) |
-> Index Scan using tbl_erp_payment_tickets_pkey on tbl_erp_payment_tickets t_2 (cost=0.28..8.30 rows=1 width=17) |
Index Cond: (id = r_2.erp_payment_ticket_id) |
Filter: (status = ANY ('{2,5,1}'::integer[])) |