summaryrefslogtreecommitdiff
path: root/jstests/core/timeseries/timeseries_index_use.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/timeseries/timeseries_index_use.js')
-rw-r--r--jstests/core/timeseries/timeseries_index_use.js25
1 files changed, 5 insertions, 20 deletions
diff --git a/jstests/core/timeseries/timeseries_index_use.js b/jstests/core/timeseries/timeseries_index_use.js
index 6ce128ecbbd..8770047f4d2 100644
--- a/jstests/core/timeseries/timeseries_index_use.js
+++ b/jstests/core/timeseries/timeseries_index_use.js
@@ -50,9 +50,8 @@ const generateTest = (useHint) => {
/**
* Creates the index specified by the spec and options, then explains the query to ensure
- * that the created index is used or was considered by multi-planner.
- * Runs the query and verifies that the expected number of documents are matched.
- * Finally, deletes the created index.
+ * that the created index is used. Runs the query and verifies that the expected number of
+ * documents are matched. Finally, deletes the created index.
*/
const testQueryUsesIndex = function(
filter, numMatches, indexSpec, indexOpts = {}, queryOpts = {}) {
@@ -68,23 +67,9 @@ const generateTest = (useHint) => {
assert.eq(numMatches, query.itcount());
const explain = query.explain();
- if (useHint) {
- const ixscan = getAggPlanStage(explain, "IXSCAN");
- assert.neq(null, ixscan, tojson(explain));
- assert.eq("testIndexName", ixscan.indexName, tojson(ixscan));
- } else {
- let ixscan = getAggPlanStage(explain, "IXSCAN");
- // If ixscan is not present, check rejected plans
- if (ixscan === null) {
- const rejectedPlans =
- getRejectedPlans(getAggPlanStage(explain, "$cursor")["$cursor"]);
- assert.eq(1, rejectedPlans.length);
- const ixscans = getPlanStages(getRejectedPlan(rejectedPlans[0]), "IXSCAN");
- assert.eq(1, ixscans.length);
- ixscan = ixscans[0];
- }
- assert.eq("testIndexName", ixscan.indexName, tojson(ixscan));
- }
+ const ixscan = getAggPlanStage(explain, "IXSCAN");
+ assert.neq(null, ixscan, tojson(explain));
+ assert.eq("testIndexName", ixscan.indexName, tojson(ixscan));
assert.commandWorked(coll.dropIndex("testIndexName"));
};