[SERVER-38077] Optimize ProjectionNode output for inclusion projections Created: 11/Nov/18  Updated: 29/Oct/23  Resolved: 14/Nov/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.1.6

Type: Improvement Priority: Major - P3
Reporter: Bernard Gorman Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 14/Nov/18 ]

Author:

{'name': 'Bernard Gorman', 'email': 'bernard.gorman@gmail.com', 'username': 'gormanb'}

Message: SERVER-38077 Optimize ProjectionNode output for inclusion projections
Branch: master
https://github.com/mongodb/mongo/commit/fc22660898e77f3dae9d00e0e02498078b7a2399

Generated at Thu Feb 08 04:47:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.