TPC-DS Q12

SF100 · F64 · Estimated plan · Read from bottom to top. Select a step for details.

Plan

Source XML

Loading plan…

Query SQL

Download SQL
SELECT
TOP 100
  i_item_id,
  i_item_desc,
  i_category,
  i_class,
  i_current_price,
  SUM(ws_ext_sales_price) AS itemrevenue,
  SUM(ws_ext_sales_price) * 100 / SUM(SUM(ws_ext_sales_price)) OVER (PARTITION BY i_class) AS revenueratio
FROM web_sales, item, date_dim
WHERE
  ws_item_sk = i_item_sk
  AND i_category IN ('Music', 'Women', 'Jewelry')
  AND ws_sold_date_sk = d_date_sk
  AND d_date BETWEEN CAST('1999-02-03' AS DATE) AND (
    DATEADD(DAY, 30, CAST('1999-02-03' AS DATE))
  )
GROUP BY
  i_item_id,
  i_item_desc,
  i_category,
  i_class,
  i_current_price
ORDER BY
  i_category,
  i_class,
  i_item_id,
  i_item_desc,
  revenueratio;
Step details

Loading plan…

Green: scan · yellow: join · purple: row movement. Rows and costs are optimiser estimates; costs use model units.