-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Critical - P2
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Today, the join optimizer uses multiple ExpressionContexts. AggJoinModel::constructJoinModel clones the incoming ExpressionContext.Â
SamplingEstimatorImpl::makeEmptyCanonicalQuery creates a fresh ExpressionContext.
Each ExpressionContext maintains its own _nonArrayPathsForNss, a map from NamespaceString to sets of paths that are assumed to not be arrays.
This set of assumptions is passed into queries for runtime checking.
Because join optimization and sampling CE each create their own ExpressionContexts, the canPathBeArrayForNss lookups do not append to the nonArrayPathsForNss in the ExpressionContext that is later passed into query execution runtime.
Concurrent inserts of array values can result in tasserts in NDV, and (I think) wrong results in joins.
The task of this ticket is to create a structured mechanism to pass the arrayness assumptions made during QO into QE.
Some possibilities include
- Explicitly passing NonArrayPathsForNss between ExpressionContexts during QO.
- Passing the original ExpressionContext into all QO layers and ensure all canPathBeArrayForNss calls are made on the original ExpressionContext.
A prototype is available at https://github.com/10gen/mongo/pull/54385/changes.
- is depended on by
-
SERVER-120578 tassert when yielding during sampling
-
- Closed
-
-
SERVER-129111 tassert when yielding during sampling
-
- Closed
-
- is related to
-
SERVER-127725 Check arrayness assumptions in sampling ce restore
-
- Closed
-
- related to
-
SERVER-130377 Investigate PathArraynessChecker not firing for in-memory storage engine mongod
-
- Backlog
-
-
SERVER-130151 [Join Optimization] Plans recovered from the cache should indicate which paths are multikey
-
- Open
-
-
SERVER-130651 join_path_arrayness_invalidation.js spuriously fails in execution_control_with_prioritization suite
-
- Needs Scheduling
-