Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-70298

[CQF] Allow sorted merge of RIDs on interval level index union

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • Fully Compatible
    • QO 2022-10-31, QO 2022-11-14, QO 2022-11-28, QO 2022-12-12, QO 2022-12-26, QO 2023-01-09, QO 2023-01-23, QO 2023-03-20, QO 2023-04-03, QO 2023-04-17

      Update IntervalLowerTransport to allow sorted merge of RIDs after an index union, instead of a GroupBy.

      For example:

      Unique []
      |   projections: 
      |       rid_0
      GroupBy []
      |   |   groupings: 
      |   |       RefBlock: 
      |   |           Variable [rid_0]
      |   aggregations: 
      Union []
      |   |   |   BindBlock:
      |   |   |       [rid_0]
      |   |   |           Source []
      |   |   IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {[Const [3], Const [3]]}]
      |   |       BindBlock:
      |   |           [rid_0]
      |   |               Source []
      |   IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {[Const [2], Const [2]]}]
      |       BindBlock:
      |           [rid_0]
      |               Source []
      IndexScan [{'<rid>': rid_0}, scanDefName: c1, indexDefName: index1, interval: {[Const [1], Const [1]]}]
          BindBlock:
              [rid_0]
                  Source []
      

      The RIDs into the groupby are going to be sorted, so sorted merge would be better

      Instead of IndexScans -> Union -> GroupBy, we could have IndexScans -> SortedMerge -> Unique

            Assignee:
            matt.boros@mongodb.com Matt Boros
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: