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

getMonotonocity is slow on wide tables

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

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

    Description

      RelOptTableImpl's getMonotonocity does an indexOf on rowType.getFieldNames(), which is O(N) in the number of fields. IdentifierNamespace calls getMonotonicity once for every field in the table namespace, so it becomes O(N^2) in the number of fields. We observed 2-4 second query planning times with a table that had 18,000 columns, reduced to about 150ms after patching getMonotonicity to be O(1) in the number of fields.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            gian Gian Merlino
            gian Gian Merlino
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment