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

[CQF] Update Cascades properties based on ConstEval inlining decisions

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • QO 2023-03-06, QO 2023-03-20

    Description

      During constant evaluation, if we see a variable whos definition is simply another variable, we currently would substitute in the definition. However this causes issues for our projection properties, since the substituted variable may not be allowed in a scope higher up. This is only an issue in the ConstEvalPost phase.

      The lowering phase also handles this case. Instead of inlining before lowering, we can avoid doing the rewrite and recomputing the projections, and allow lowering to do the work for us.

      repro:

      coll.createIndex({a: 1, _id: 1})
      coll.find({_id : 1}, {a : 1}).hint({a : 1, _id : 1})
      

      The error will be "Location4946301 undefined slot accessor:2", caused by a rewrite in ConstEvalPost, which prevents the nested loop join from passing slot2 and slot3 further up in the plan.

      slack conversation for reference

      As part of this ticket, the SBE consteval equivalent should also be investigated.

      Attachments

        Activity

          People

            svilen.mihaylov@mongodb.com Svilen Mihaylov (Inactive)
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: