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

SqlNode.equalsDeep has O(n ^ 2) performance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None
    • None

    Description

      SqlNode.equalsDeep has O(n ^ 2) performance. It shows up while running SqlValidatorTest.testLarge on "select from emp where <large expression> > 5".

      This is because we call litmus.fail(e + " != " + e2) and construct a large string, even though the particular implementation of Litmus is not interested in the string.

      Solution is to change Litmus.fail(String message) to Litmus.fail(String message, Object... args), so that fail can lazily construct messages. The same as SLF4J Logger does.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: