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

Consider changing all variadic expressions to short-circuit in SBE

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Query Execution
    • Labels:
      None

      Description

      As part of SERVER-59785, we have decided to err on the side of consistency and make $concatArrays not short-circuit in SBE, to match the behavior of the rest of the variadic expressions. However, for expressions that take an arbitrary number of arguments, there is a practical performance benefit to short-circuiting early when it is known that the result should be e.g. null.

      This ticket is to consider implementing a uniform policy in SBE, wherein fixed, low-arity expressions always evaluate all arguments, but variadic expressions will attempt to short-circuit when possible for the sake of efficiency.

      The list of variadic expressions currently implemented in SBE are

      • $concat
      • $add
      • $multiply

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-execution Backlog - Query Execution
              Reporter:
              kyle.suarez Kyle Suarez
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: