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

Include into the rowStoreExpr only the output fields

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • QE 2022-09-19, QE 2022-10-03

    Description

      Currently, the rowStoreExpr in SlotBasedStageBuilder::buildColumnScan includes all fields, even those that are pushed down as per-path filters and don't participate in the output.

      This might affect correctness in some corner cases:
      [
      {$match: {x: {$lt: 42}}}, // will be lowered as a per-path filter
      {$project: {_id: 1}}, // "x" should not be included into the output, but currently rowStoreExpr will keep it
      {$group: {_id: "$x", s: {$sum: 1}},
      ]
      The result of the group would depend on whether "x" is included into the output or not. Currently we inject mkbson stage on top of column_scan that would remove "x" but as we are cleaning up the CSI plans and removing the unnecessary stages, the extra field from the rowStoreExpr might leak through. 

      Also, the simpler the expr the better it is for perf.

      Attachments

        Activity

          People

            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: