Avoid making a copy of JsFunction when generating an SBE plan

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 5.3.0-rc3
    • Affects Version/s: Backlog
    • Component/s: None
    • None
    • Fully Compatible
    • QO 2022-03-07, QO 2022-03-21
    • 15
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently when we construct an WhereMatchExpression we instantiate a JsFunction object, which is a wrapper encapsulating common logic for running JS code in $where expression.

      When we translate this expression into an SBE plan, we make a copy of this JsFunction object, which is an expensive operation, since we re-parse and re-compile the JS function from scratch. Instead, we should reuse the original object stored in WhereMatchExpression since this expression will never need it again once translated into SBE.

              Assignee:
              Anton Korshunov
              Reporter:
              Anton Korshunov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: