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

Avoid making a copy of JsFunction when generating an SBE plan

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.3.0-rc3
    • Backlog
    • None
    • None
    • Fully Compatible
    • QO 2022-03-07, QO 2022-03-21
    • 15

    Description

      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.

      Attachments

        Activity

          People

            anton.korshunov@mongodb.com Anton Korshunov
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: