[SERVER-40205] Allow $graphLookup to use projections to reduce memory consumption Created: 19/Mar/19 Updated: 06/Dec/22 Resolved: 19/Mar/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.6.11 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Glenn Allen | Assignee: | Backlog - Triage Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Server Triage
|
||||||||
| Participants: | |||||||||
| Description |
|
Performing a deep $graphLookup of a large graph can result in significant memory consumption due to the retrieval of unnecessary fields. For example, we have a collection of documents that have:
If I want to retrieve all the IDs of a specific graph, the content property is irrelevant. If the content property is significantly large it can cause "$graphLookup reached maximum memory consumption" errors. By using a projection to ignore this field within a $graphLookup, memory consumption could be significantly reduced.
Instead, I think we'll have to create a simplified view of the collection and use that to perform the graph lookup, unless there are better suggestions? |
| Comments |
| Comment by Glenn Allen [ 19/Mar/19 ] |
|
Oh cool, thanks Danny, sorry I missed that one in my search. And sure, I'll head over to those groups, thanks! |
| Comment by Danny Hatcher (Inactive) [ 19/Mar/19 ] |
|
Hello Glenn, I believe that SERVER-38560 should cover your use-case so I will close this ticket as a duplicate of that one. In regards to potential ways to work around the issue, I encourage you to ask our community by posting on the mongodb-user group or on Stack Overflow with the mongodb tag. Thank you, Danny |