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

Support $group pushdown to SBE when $match stage with $or exists in a pipeline

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QE 2022-01-10, QE 2022-02-07, QE 2022-01-24

      Repro:

      execute mongod
      $ build/debug/install/bin/mongod --setParameter featureFlagSBEGroupPushdown=true --setParameter internalQueryEnableSlotBasedExecutionEngine=true
      
      in MongoDB shell
      var coll = db.getCollection("test");
      coll.insert({a: 1});
      coll.aggregate([{$match: {$or: [{"a": 1}, {"b": 10}]}}, {$group: {_id: "$a"}}]);
      

      In SERVER-60191, we disabled $group pushdown to SBE when $match stage with $or exists in a pipeline to avoid a tripwire assertion: 5842500. This assertion happened because subplanning does not expect that the base query has pushed down $group stage(s) and it does when $group stage exists in pipeline. But two code paths are orthogonal to each other.

      Need to figure out how to enable $group pushdown to SBE even when subplanning is involved.

            Assignee:
            yoonsoo.kim@mongodb.com Yoon Soo Kim (Inactive)
            Reporter:
            yoonsoo.kim@mongodb.com Yoon Soo Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: