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

Change metadata dispatch to avoid registration of all RelNode subtypes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.28.0
    • core

    Description

      Using JdbcTest.testJoinFiveWay, I ran the query six times then I took the last 3 results as reported by intellij.  I then repeated this 3 times.

      After bench marking Janino, my prototype and using legacy java reflections, I found:

        Janino Prototype java reflection
      Average 326.4444444 315.5555556 1525.888889
      Standard Deviation 27.12983188 14.75729575 75.8476177

      The prototype was a static code with out caching or cycle detection.  I latter added cycle detection and caching, but the results were with in one standard deviation.  So I didn't not follow up further.

      I was doing the dispatch with instance of instead of scanning an array of known classes.

      if(node instanceof ...){
        return handler.call((...) node);
      } else if(node instanceof ...) {
        return handler.call((...) node);
      }....
      

      If janino compiler dispatch was changed to use instanceof, it would remove the requirement know all relnode subtypes. 

      Attachments

        Issue Links

          Activity

            People

              jamesstarr James Starr
              jamesstarr James Starr
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h