DocumentSourceSequentialDocumentCache::doOptimizeAt() caches on a per-stage basis of the $lookup pipeline. Restructuring the aggregation pipeline so the $objectToArray values are done as a separate stage from the $match that references the $$sk variable would mean their results can be cached too.
The changes made in this ticket will be obsoleted by SERVER-57667 but will reduce the per-document processing overhead by a constant factor.
- is related to
-
SERVER-57579 DocumentSourceSequentialCache doesn't clone, ruining non-correlated $lookup pipeline caching in sharded deployments
- Closed
-
SERVER-57667 Improve processing speed for resharding's collection cloning pipeline
- Closed
- related to
-
SERVER-57705 DocumentSourceSequentialCache can wind up in a suboptimal location due to optimizations
- Backlog
-
SERVER-57483 Results from $lookup stage are not cached for a resharding operation's sub-pipeline
- Closed