Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3015

Add rule to remove constants in group keys

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 1.20.0
    • Component/s: None
    • Labels:
      None

      Description

      Constants in group keys can be removed to reduce shuffle. For instance, 

       

      select key, value, count(*) from (select 1 as key, value from src) dual group by key, value;
      

      can be reduced to

      select value, count(*) from (select 1 as key, value from src) dual group by value;

      It could save much resource in distribute system if all group keys are constants since the distribution becomes SINGLETON instead of HASH.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Chunwei Lei Chunwei Lei
                Reporter:
                Chunwei Lei Chunwei Lei
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: