-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
QO 2023-07-24, QO 2023-08-07, QO 2023-08-21, QO 2023-09-04
The maximum number of aggregation stages allowed is 1000 for non-debug builds. For the following pipeline (and other long pipelines) the classic engine has no issues, while Bonsai fails with a stack overflow in the first call to the reference tracker.
db.c.drop(); const stage = {$addFields: {a: {$add: ["$a", "$b"]}}}; // Make a pipeline with 990 stages (all the same stage) const pipeline = [...Array(990).keys()].map(_ => stage); db.c.aggregate(pipeline).toArray(); // Stack overflow
We should investigate why the stack frames are so large. Are we allocating unnecessarily at all?
The overall goal is to determine if the transport infrastructure needs to fundamentally change to be able to handle deep trees, or is there a less extreme change we can make?
- is depended on by
-
SERVER-78354 [CQF] Implement transport infrastructure using iteration rather than recursion
- Closed
- related to
-
SERVER-62509 Write tests to stress ABT and Bonsai
- Closed
-
SERVER-80483 [CQF] Split last-ref analysis into a separate pass
- Closed