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

[CQF] Make isLastRef more precise

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization

      The default merge() behavior in reference_tracker.cpp misses some opportunities to mark a Variable as safe to move() from.

      When we get CollectedInfo from two subexpressions, we need to know the evaluation order to decide which side is evaluated last. The default merge() can't decide this, because for example BinaryOp and FunctionCall could be different. So we clear the last-reference flags from both sides: https://github.com/10gen/mongo/blob/master/src/mongo/db/query/optimizer/reference_tracker.cpp#L135

      To decide the evaluation order of an ABT expression, you have to know:

      1. How it's lowered to an SBE EExpression
      2. The evaluation order for that EExpression

      I'm not sure if the evaluation order of an EExpression is well defined. I think this is supposed to be an implementation detail of the VM: SERVER-68222.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: