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

[CQF] Make isLastRef more precise

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: