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

Add rule to remove constants in group keys

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 1.20.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: