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

Avoid creating intermediate object in covered SBE plans

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • v5.0
    • Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28

    Description

      When an SBE plan is covered, it may "rehydrate" the index key into an object, which is then used in the rest of the plan. In some cases, the rest of the plan can use the "index key slots" (slots storing each component of the index key). This would save us the work of creating a temporary object.

       

      A good example of this is how "default" projections are implemented. For example, a covered query like:

      db.c.find({"a.c": 1}, {"a.c": 1, _id: 0}) 

      Using an index {{

      {a.c:1, b: 1}

      }} will create a temporary object for each index key. The default projection could instead use the slot storing the "a.c" component directly.

      Attachments

        Activity

          People

            nikita.lapkov@mongodb.com Nikita Lapkov (Inactive)
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: