Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-3635

Order group by clause based on cardinality and cost

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • Impala 2.2
    • None
    • Frontend

    Description

      Similar to IMPALA-2805 Group by clause should be ordered by cardinality and cost.

      From TPC-DS Q78

      Bad current order

      group by d_year, ws_item_sk, ws_bill_customer_sk
      

      Ideal current order

      group by ws_bill_customer_sk, ws_item_sk, d_year
      

      Subset of TPC-DS Q78

      select d_year AS ws_sold_year, ws_item_sk,
          ws_bill_customer_sk ws_customer_sk,
          sum(ws_quantity) ws_qty,
          sum(ws_wholesale_cost) ws_wc,
          sum(ws_sales_price) ws_sp
         from web_sales
         left join web_returns on wr_order_number=ws_order_number and ws_item_sk=wr_item_sk
         join date_dim on ws_sold_date_sk = d_date_sk
         where wr_order_number is null
         group by d_year, ws_item_sk, ws_bill_customer_sk
      

      Attachments

        Issue Links

          Activity

            People

              twmarshall Thomas Tauber-Marshall
              mmokhtar Mostafa Mokhtar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: