Aggregate (cost=562.17..562.18 rows=1 width=8) |
-> Sort (cost=562.06..562.08 rows=7 width=257) |
Sort Key: "*SELECT* 1".created_at DESC |
-> Result (cost=488.17..561.96 rows=7 width=257) |
-> Append (cost=488.17..561.89 rows=7 width=8) |
-> Subquery Scan on "*SELECT* 1" (cost=488.17..488.24 rows=4 width=8) |
-> Group (cost=488.17..488.20 rows=4 width=257) |
Group Key: r.id, sc.from_project |
-> Sort (cost=488.17..488.18 rows=4 width=16) |
Sort Key: r.id |
-> Hash Join (cost=67.90..488.13 rows=4 width=16) |
Hash Cond: (r.sales_contract_id = sc.id) |
-> Seq Scan on tbl_erp_cash_cost_tickets r (cost=0.00..400.68 rows=7445 width=16) |
Filter: (status = 2) |
-> Hash (cost=67.89..67.89 rows=1 width=8) |
-> Seq Scan on tbl_sales_contracts sc (cost=0.00..67.89 rows=1 width=8) |
Filter: (from_project = 3883) |
-> Subquery Scan on "*SELECT* 2" (cost=1.24..1.25 rows=1 width=8) |
-> Group (cost=1.24..1.24 rows=1 width=257) |
Group Key: r_1.id |
-> Sort (cost=1.24..1.24 rows=1 width=16) |
Sort Key: r_1.id |
-> Seq Scan on tbl_erp_cost_tickets r_1 (cost=0.00..1.23 rows=1 width=16) |
Filter: ((status = 2) AND (project_id = 3883)) |
-> Subquery Scan on "*SELECT* 3" (cost=69.27..69.29 rows=1 width=8) |
-> Group (cost=69.27..69.28 rows=1 width=257) |
Group Key: r_2.id, sc_1.from_project |
-> Sort (cost=69.27..69.28 rows=1 width=16) |
Sort Key: r_2.id |
-> Nested Loop (cost=0.00..69.26 rows=1 width=16) |
Join Filter: (r_2.sales_contract_id = sc_1.id) |
-> Seq Scan on tbl_sales_contracts sc_1 (cost=0.00..67.89 rows=1 width=8) |
Filter: (from_project = 3883) |
-> Seq Scan on tbl_erp_cost_convert_tickets r_2 (cost=0.00..1.19 rows=15 width=16) |
Filter: (status = 2) |
-> Subquery Scan on "*SELECT* 4" (cost=3.09..3.11 rows=1 width=8) |
-> HashAggregate (cost=3.09..3.10 rows=1 width=257) |
Group Key: r_3.id |
-> Hash Right Join (cost=1.19..3.07 rows=6 width=12) |
Hash Cond: (eipss.erp_sales_gift_id = r_3.id) |
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..1.68 rows=68 width=4) |
-> Hash (cost=1.18..1.18 rows=1 width=12) |
-> Seq Scan on tbl_erp_sales_gifts r_3 (cost=0.00..1.18 rows=1 width=12) |
Filter: ((project_id = 3883) AND (status = 2)) |