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:
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.