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

SqlNode.equalsDeep has O(n ^ 2) performance

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      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.

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/670fa73e .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.7.0 (2016-03-22).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.7.0 (2016-03-22).

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development