[SERVER-27437] $graphLookup stage should use Documents instead of BSONObj in the visited set and cache Created: 15/Dec/16  Updated: 05/Apr/17  Resolved: 20/Jan/17

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

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2017-01-23, Query 2017-02-13
Participants:

 Description   

When $graphLookup was originally implemented, it used the DBDirectClient to issue queries into the foreign collection, which returned results in BSON. During SERVER-25005, we switched from using the DBDirectClient to using a Pipeline object, which gave back Documents instead of BSONObjs. However, we still store BSONObjs in both the visited set and the cache (evidence that it uses BSON here).

Using BSON is likely slower due to the need to convert between the two formats (Document and BSONObj). We already pay the overhead to convert the results from the foreign collection into Documents (since they are wrapped in a Pipeline), so we shouldn't undo that work and put them back into BSON, only to end up putting them in the 'as' field again as Values (which will first convert the BSONObjs to Documents).



 Comments   
Comment by Githook User [ 20/Jan/17 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-27437 Use Documents instead of BSONObjs within $graphLookup
Branch: master
https://github.com/mongodb/mongo/commit/1aae7f519532707c40c3d19262b589ccd0c7ee08

Comment by Githook User [ 20/Jan/17 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-27437 Add dotted path expansion for Documents.
Branch: master
https://github.com/mongodb/mongo/commit/d60dd07f3f470b702092b6b54e15586a5177d8a1

Comment by Githook User [ 20/Jan/17 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-27437 Modernize field_path_test.cpp
Branch: master
https://github.com/mongodb/mongo/commit/2c6c114e3952e952de1a395f987f1c5b83d209fe

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