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

Ensure mask is propagated until the end of the vectorized pipeline

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • CAR Team 2024-02-19

      If we have three documents in a single bucket,

      {a: 1, b: 1} {a: 2, b: 0} {a: 1, b: 3}

      and a pipeline with a $match for a: 1
      followed by a $addFields: that adds 5 to b
      followed by a $match for b < 7

      The result should contain just the

      {a: 1, b: 1}

      document because the second has been excluded by the first $match, and the third one by the second $match (3+5 is not less than 7)
      Right now I think the first mask is used inside the second $match, but the comparison operator ignores it because it's faster to just process all the data instead of checking the bitmask one by one.

      The SlotBasedStageBuilder::buildVectorizedFilterExpr should take care of creating an AND between the existing bitmask and the result that is going to overwrite the kBlockSelectivityBitmap slot in order to preserve it. Maybe with a coerceToBool on its arguments to ensure that the bitmask is always made by booleans

            Assignee:
            foteini.alvanaki@mongodb.com Foteini Alvanaki
            Reporter:
            alberto.massari@mongodb.com Alberto Massari
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: