When running the `timeseries_match_pushdown.js` with the `implicit_query_settings_fallback` suite, I have noticed that the invalid set Query Settings don't go through the fallback for CLUSTERED_IXSCAN plans, which lead to different plans for invalid QS and no QS.
This is the explain for invalid Query Settings:
"queryPlanner": { "namespace": "test.system.buckets.timeseries_match_pushdown", "parsedQuery": { "$and": [ {"_id": {"$gt": ObjectId("61cf8b73ffffffffffffffff")}}, {"meta": {"$_internalExprEq": 1}}, { "control.max.time": {"$_internalExprGt": ISODate("2022-01-01T00:00:03Z")} }, { "control.min.time": {"$_internalExprGt": ISODate("2021-12-31T23:00:03Z")} } ] }, "querySettings": { "indexHints": [{ "ns": {"db": "test", "coll": "timeseries_match_pushdown"}, "allowedIndexes": ["doesnotexist"] }] }, "indexFilterSet": false, "planCacheShapeHash": "AC9C2DEB", "planCacheKey": "7A51D62F", "optimizationTimeMillis": 1, "maxIndexedOrSolutionsReached": false, "maxIndexedAndSolutionsReached": false, "maxScansToExplodeReached": false, "prunedSimilarIndexes": false, "winningPlan": { "isCached": false, "stage": "CLUSTERED_IXSCAN", "filter": { "$and": [ {"meta": {"$_internalExprEq": 1}}, { "control.max.time": { "$_internalExprGt": ISODate("2022-01-01T00:00:03Z") } }, { "control.min.time": { "$_internalExprGt": ISODate("2021-12-31T23:00:03Z") } } ] }, "direction": "forward", "minRecord": ObjectId("61cf8b73ffffffffffffffff"), "maxRecord": ObjectId("ffffffffffffffffffffffff") }, "rejectedPlans": [] },
This is the explain for no Query Settings:
"queryPlanner": {
"namespace": "test.system.buckets.timeseries_match_pushdown",
"parsedQuery": {
"$and": [
{"_id": {"$gt": ObjectId("61cf8b73ffffffffffffffff")}},
{"meta": {"$_internalExprEq": 1}},
{
"control.max.time":
{"$_internalExprGt": ISODate("2022-01-01T00:00:03Z")}
},
{
"control.min.time":
{"$_internalExprGt": ISODate("2021-12-31T23:00:03Z")}
}
]
},
"indexFilterSet": false,
"planCacheShapeHash": "AC9C2DEB",
"planCacheKey": "C985DCD2",
"optimizationTimeMillis": 2,
"maxIndexedOrSolutionsReached": false,
"maxIndexedAndSolutionsReached": false,
"maxScansToExplodeReached": false,
"prunedSimilarIndexes": false,
"winningPlan": {
"isCached": false,
"stage": "FETCH",
"filter": {"_id": {"$gt": ObjectId("61cf8b73ffffffffffffffff")}},
"inputStage": {
"stage": "IXSCAN",
"keyPattern":
{"meta": 1, "control.min.time": 1, "control.max.time": 1},
"indexName": "meta_1_time_1",
"isMultiKey": false,
"multiKeyPaths": {
"meta": [],
"control.min.time": [],
"control.max.time": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"meta": ["[1.0, 1.0]"],
"control.min.time": ["(new Date(1640991603000), MaxKey]"],
"control.max.time": ["(new Date(1640995203000), MaxKey]"]
}
}
},
"rejectedPlans":
[
{
"isCached": false,
"stage": "CLUSTERED_IXSCAN",
"filter":
{
"$and": [
{"meta": {"$_internalExprEq": 1}},
{
"control.max.time": {
"$_internalExprGt": ISODate(
"2022-01-01T00:00:03Z")
}
},
{
"control.min.time": {
"$_internalExprGt": ISODate(
"2021-12-31T23:00:03Z")
}
}
]
},
"direction": "forward",
"minRecord": ObjectId("61cf8b73ffffffffffffffff"),
"maxRecord": ObjectId("ffffffffffffffffffffffff")
}
]
},
- depends on
-
SERVER-96635 Improve Query Settings Fallback tests
-
- Closed
-