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

Improve performance of SBE recursive index scan plans

    • Fully Compatible
    • QE 2022-09-19, QE 2022-10-03, QE 2022-10-17, QE 2022-10-31
    • 35
    • 5

      We've seen some indications that the fully generic index scan algorithm implemented by the SBE stage builders can be slow. The stage builder produces plans using the CheckBoundsStage which look like this:

      [1] nlj [] [s29, s24, s26]
                      left
                          [1] sspool sp1 [s29, s24, s26]
                      right
                          [1] chkbounds s25 s28 s31
                          [1] nlj [s24, s26] [s30]
                              left
                                  [1] project [s24 = "a_1_b_1", s26 = {"a" : 1, "b" : 1}, s30 = s29]
                                  [1] limit 1
                                  [1] coscan
                              right
                                  [1] ixseek s30 none s25 s28 s23 [] @"0552b0af-0102-434f-805e-32b741d99765" @"a_1_b_1" true
      

      We should look into ways to make this faster. As a starting point, we could try an experiment where we implement a version of the sbe::IndexScanStage that operates directly over the IndexBounds. This stage would need to use the IndexBoundsChecker itself rather than relying on the "chkbounds" stage to do so. Then we can run a performance patch build and see how much this improves the numbers.

            Assignee:
            zixuan.zhuang@mongodb.com Zixuan Zhuang
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: