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

Apply SortJoinCopyRule optimization on a physical level instead of logical

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Currenlty there is a rule (SortJoinCopyRule) that copies a sort (without the limit and offset) under a join in order for example to use more easily operators with sorted inputs, or to have the sort integrated in an index scan.  An exemple of the application of SortJoinCopyRule:

      // Plan before applying SortJoinCopyRule
      
      Sort(author.name)
        Join(author.id = book.authid)
          Scan(author)
          Scan(book)
      
      // Plan after applying SortJoinCopyRule (& SortRemoveRule)
      
        Join(author.id = book.authid)
          IndexScan(author, author.name)
          Scan(book)

      This optimization is applied to the logical operators.

      It was mentionned in CALCITE-2624 that another approach (on a physical level) may be more suitable. It would be better for the optimization to be applied by physical property enforcement.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              khawlamhb Khawla Mouhoubi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: