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

Optimize ProjectionNode output for inclusion projections

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.6
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Fully Compatible
    • 0

      As part of the work on SERVER-35493, we unified the majority of the logic for InclusionNode and ExclusionNode into a ProjectionNode base class. Because this class must agnostically support any projection type, inclusions now write to the output document using MutableDocument::setField rather than MutableDocument::addField, since exclusions cannot use addField. For large inclusion projections, however, this introduces a per-field performance hit, as setField's lookup-and-replace behaviour is slower than addField's straightforward append.

            Assignee:
            bernard.gorman@mongodb.com Bernard Gorman
            Reporter:
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: