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

SQL parser has quadratic running time when SQL string is very large

    XMLWordPrintableJSON

Details

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

    Description

      SQL parser has quadratic running time when SQL string is very large.

      This is due to SimpleCharStream.ExpandBuff(boolean) increasing the buffer in increments of 2,048 (2k) chars. If the SQL string is, say, 1,024k characters, then it will re-alloc at size 2k, 4k, 6k, ..., 1023k, and each time copy the whole string.

      This issue was discovered by gian.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: