-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Currently, we only pass the set of INLJ-eligible ready indexes to fromCachedJoinPlan and use that set of indexes to reconstruct single table predicate access paths. This is currently okay because the set of INLJ-eligible indexes (determined by indexIsValidForINLJ) is a strict superset of the set of CBR supported indexes (determined by isIndexScanSupported) and thus, we will always be able to find the index and reconstruct a plan.
However, if the 2 checks above diverge (e.g. CBR starts permitting sparse or partial filter indexes) then the STP access path may use this index but we will not find it during plan reconstruction since we are only looking at INLJ-eligible indexes. This would result in us hitting this tassert.
After SERVER-133479, we will have another join plan cache dependency during the usedFingerprint computation.
The solution to this would to first read the set of all ready indexes from the catalog for all the namespaces and then filter by INLJ-eligible indexes. That way we can pass the full set of ready indexes to the plan cache functions and the INLJ-eligible indexes to the plan enumerator.
Another idea could be to allow passing a set of IndexEntrys to QueryPlannerParams rather than letting it handle reading from the catalog by itself in the constructor. This would allow us to have a consistent set of supported indexes between JOO and the plan enumerator. This would require the join optimizer to reason about what constitutes a valid index for INLJ as well as for STPs
- is related to
-
SERVER-133479 Record which indexes a cached join plan reads from
-
- Closed
-