| Aggregate (cost=736.21..736.22 rows=1 width=8) |
| -> Sort (cost=704.39..709.69 rows=2121 width=1057) |
| Sort Key: p.in_out_at DESC NULLS LAST, p.updated_at DESC |
| -> HashAggregate (cost=565.99..587.20 rows=2121 width=1057) |
| Group Key: p.id |
| -> Hash Join (cost=457.46..560.69 rows=2121 width=20) |
| Hash Cond: (p.id = p_4.id) |
| -> Hash Left Join (cost=22.46..120.12 rows=2121 width=20) |
| Hash Cond: (p.id = tmp5.product_id) |
| -> Hash Left Join (cost=5.77..94.47 rows=2121 width=20) |
| Hash Cond: (p.id = tmp4.product_id) |
| -> Hash Left Join (cost=3.22..83.87 rows=2121 width=20) |
| Hash Cond: (p.id = tmp3.product_id) |
| -> Seq Scan on tbl_products p (cost=0.00..72.21 rows=2121 width=20) |
| -> Hash (cost=2.61..2.61 rows=49 width=4) |
| -> Subquery Scan on tmp3 (cost=1.62..2.61 rows=49 width=4) |
| -> HashAggregate (cost=1.62..2.12 rows=49 width=104) |
| Group Key: p_1.product_id |
| -> Seq Scan on tbl_erp_inventory_start_products p_1 (cost=0.00..1.50 rows=50 width=4) |
| -> Hash (cost=2.44..2.44 rows=9 width=4) |
| -> Subquery Scan on tmp4 (cost=2.26..2.44 rows=9 width=4) |
| -> HashAggregate (cost=2.26..2.35 rows=9 width=72) |
| Group Key: p_2.product_id |
| -> Hash Join (cost=1.06..2.24 rows=9 width=4) |
| Hash Cond: (p_2.erp_inventory_lost_id = e.id) |
| -> Seq Scan on tbl_erp_inventory_lost_products p_2 (cost=0.00..1.13 rows=13 width=8) |
| -> Hash (cost=1.04..1.04 rows=2 width=4) |
| -> Seq Scan on tbl_erp_inventory_losts e (cost=0.00..1.04 rows=2 width=4) |
| Filter: (status = ANY ('{2,5}'::integer[])) |
| -> Hash (cost=15.44..15.44 rows=100 width=4) |
| -> Subquery Scan on tmp5 (cost=13.44..15.44 rows=100 width=4) |
| -> HashAggregate (cost=13.44..14.44 rows=100 width=72) |
| Group Key: p_3.product_id |
| -> Hash Join (cost=1.16..13.19 rows=100 width=4) |
| Hash Cond: (p_3.erp_inventory_overflow_id = e_1.id) |
| -> Seq Scan on tbl_erp_inventory_overflow_products p_3 (cost=0.00..11.60 rows=160 width=8) |
| -> Hash (cost=1.10..1.10 rows=5 width=4) |
| -> Seq Scan on tbl_erp_inventory_overflows e_1 (cost=0.00..1.10 rows=5 width=4) |
| Filter: (status = ANY ('{2,5}'::integer[])) |
| -> Hash (cost=408.48..408.48 rows=2121 width=4) |
| -> HashAggregate (cost=366.06..387.27 rows=2121 width=4) |
| Group Key: p_4.id |
| -> Hash Right Join (cost=332.03..360.76 rows=2121 width=4) |
| Hash Cond: (esosps.erp_inventory_product_id = eip.id) |
| -> Seq Scan on tbl_erp_sales_outbound_spent_products esosps (cost=0.00..8.11 rows=411 width=8) |
| -> Hash (cost=305.51..305.51 rows=2121 width=8) |
| -> Hash Left Join (cost=256.35..305.51 rows=2121 width=8) |
| Hash Cond: (epips.project_id = sc.from_project) |
| -> Hash Right Join (cost=116.54..136.88 rows=2121 width=12) |
| Hash Cond: (eip.product_id = p_4.id) |
| -> Hash Left Join (cost=17.82..36.85 rows=497 width=12) |
| Hash Cond: (eip.erp_purchase_inbound_id = epis.id) |
| -> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..12.97 rows=497 width=32) |
| -> Hash (cost=15.17..15.17 rows=212 width=8) |
| -> Hash Right Join (cost=10.77..15.17 rows=212 width=8) |
| Hash Cond: (epips.erp_purchase_inbound_id = epis.id) |
| -> Seq Scan on tbl_erp_purchase_inbound_projects epips (cost=0.00..3.89 rows=189 width=8) |
| -> Hash (cost=8.12..8.12 rows=212 width=4) |
| -> Seq Scan on tbl_erp_purchase_inbounds epis (cost=0.00..8.12 rows=212 width=4) |
| -> Hash (cost=72.21..72.21 rows=2121 width=20) |
| -> Seq Scan on tbl_products p_4 (cost=0.00..72.21 rows=2121 width=20) |
| -> Hash (cost=118.25..118.25 rows=1725 width=4) |
| -> Seq Scan on tbl_sales_contracts sc (cost=0.00..118.25 rows=1725 width=4) |