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

Refactor to allow LiteParsed structures to pass parsed state on to DocumentSources

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization

      This is an idea that I've spoken to many engineers with over the years as we all one by one realize that we do double the parsing work we need to for any stages like $facet or $out which need to parse a LiteParsedDocumentSource to describe foreign collections and authorization requirements, but then throw out all that parsed state when the LiteParsedPipeline is no longer used, and re-create the parsed structures again during Pipeline::parse/DocumentSourceBlah::createFromBson.

      This is not a trivial task and is definitely in the category of tech debt. The proposal is to do some sort of refactor where you can allow "upgrading" a LiteParsedPipeline to a Pipeline, so that if the stage uses the IDL to do the parsing during a LiteParse, it can just pass along the IDL parsed type and not need to re-create it from BSON.

      For the record, I have not seen this to be a real performance problem so far - just something that sounds wasteful and is a source of confusion.

            Assignee:
            Unassigned Unassigned
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: