-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 6.0.0-rc5, 6.1.0-rc0
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
v6.0
-
-
QO 2022-05-16, QO 2022-05-30, QO 2022-06-13, QO 2022-06-27, QO 2022-07-11
The QueryPlanner has some special logic called "explode for sort" which attempts to convert one index scan into a sorted merge of several index scans in order to avoid a blocking SORT operation. This logic does not interact correctly with auto-parameterization.
When an auto-parameterized predicate is converted to index bounds in the IndexBoundsBuilder, we record this fact inside an IntervalEvaluationTree, or IET. The IET allows us to recompute the index bounds when the indexed plan is bound to new parameter values. The explode for sort path appears to discard the IETs attached to the original IndexScanNode. This results in the downstream logic treating the index scan as though it is not parameterized, embedding the KeyString constants for the high and low keys directly into the plan. When the plan is recovered from the cache for a query with different constants, this can result in incorrect or missing query results.
- related to
-
SERVER-67576 Make parameterized explode for sort plans work with the SBE plan cache
- Closed