Sort (cost=649.31..649.50 rows=76 width=168) |
Sort Key: "*SELECT* 1".id DESC |
-> Result (cost=71.23..646.94 rows=76 width=168) |
-> Append (cost=71.23..646.18 rows=76 width=110) |
-> Subquery Scan on "*SELECT* 1" (cost=71.23..140.01 rows=17 width=83) |
-> Hash Join (cost=71.23..139.84 rows=17 width=87) |
Hash Cond: (t.id = r.erp_collect_ticket_id) |
-> Seq Scan on tbl_erp_collect_tickets t (cost=0.00..60.76 rows=2015 width=37) |
Filter: (status = ANY ('{2,5,1}'::integer[])) |
-> Hash (cost=71.02..71.02 rows=17 width=18) |
-> Seq Scan on tbl_erp_collect_ticket_settles r (cost=0.00..71.02 rows=17 width=18) |
Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{3853,3642,3449,3356,3297,3240,3214,3116,3099,3074,3073,2979,2845,2972,2835}'::integer[]))) |
-> Subquery Scan on "*SELECT* 2" (cost=0.28..423.06 rows=58 width=118) |
-> Nested Loop (cost=0.28..422.48 rows=58 width=122) |
-> Seq Scan on tbl_erp_cash_cost_ticket_sales_contract_settles r_1 (cost=0.00..32.42 rows=58 width=44) |
Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{3853,3642,3449,3356,3297,3240,3214,3116,3099,3074,3073,2979,2845,2972,2835}'::integer[]))) |
-> Index Scan using tbl_erp_cash_cost_tickets_pkey on tbl_erp_cash_cost_tickets t_1 (cost=0.28..6.72 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..83.11 rows=1 width=109) |
-> Nested Loop (cost=0.28..83.10 rows=1 width=113) |
-> Seq Scan on tbl_erp_payment_ticket_settles r_2 (cost=0.00..74.78 rows=1 width=18) |
Filter: ((sales_contract_id IS NOT NULL) AND (sales_contract_id = ANY ('{3853,3642,3449,3356,3297,3240,3214,3116,3099,3074,3073,2979,2845,2972,2835}'::integer[]))) |
-> Index Scan using tbl_erp_payment_tickets_pkey on tbl_erp_payment_tickets t_2 (cost=0.28..8.30 rows=1 width=37) |
Index Cond: (id = r_2.erp_payment_ticket_id) |
Filter: (status = ANY ('{2,5,1}'::integer[])) |