summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuoxin Xu <ruoxin.xu@mongodb.com>2022-04-12 10:14:54 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-12 19:49:28 +0000
commit1d49f6dda41d97558ef28ba348de08bf30e2f7c1 (patch)
treefd821d8636a832e15e899a825e9a8f959fe97a01
parent9f37f5db79ebb610694c694a6218cf4cc10f7d19 (diff)
downloadmongo-1d49f6dda41d97558ef28ba348de08bf30e2f7c1.tar.gz
SERVER-65129 Remove featureFlagAutoParameterization
-rw-r--r--buildscripts/resmokeconfig/fully_disabled_feature_flags.yml1
-rw-r--r--jstests/core/idhack.js5
-rw-r--r--jstests/core/profile_find.js32
-rw-r--r--jstests/core/profile_query_hash.js9
-rw-r--r--jstests/noPassthrough/log_and_profile_query_hash.js9
-rw-r--r--jstests/noPassthrough/plan_cache_replan_sort.js19
-rw-r--r--jstests/noPassthrough/sbe_plan_cache_autoparameterize_collscan.js9
-rw-r--r--jstests/noPassthroughWithMongod/index_bounds_static_limit.js7
-rw-r--r--jstests/noPassthroughWithMongod/ne_array_indexability.js17
-rw-r--r--src/mongo/db/query/canonical_query.cpp8
-rw-r--r--src/mongo/db/query/canonical_query_encoder.cpp74
-rw-r--r--src/mongo/db/query/canonical_query_encoder_test.cpp3
-rw-r--r--src/mongo/db/query/get_executor.cpp20
-rw-r--r--src/mongo/db/query/query_feature_flags.idl7
14 files changed, 79 insertions, 141 deletions
diff --git a/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml b/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml
index fb6b2875116..c08125ad738 100644
--- a/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml
+++ b/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml
@@ -8,4 +8,3 @@
# Disable featureFlagRequireTenantID until all paths pass tenant id to TenantNamespace
# and TenantDatabase constructors.
- featureFlagRequireTenantID
-- featureFlagAutoParameterization
diff --git a/jstests/core/idhack.js b/jstests/core/idhack.js
index 9baea95a43d..487490c59ab 100644
--- a/jstests/core/idhack.js
+++ b/jstests/core/idhack.js
@@ -62,9 +62,8 @@ winningPlan = getWinningPlan(explain.queryPlanner);
engineSpecificAssertion(!isIdhack(db, winningPlan), isIxscan(db, winningPlan), db, winningPlan);
// Covered query returning _id field only can be handled by ID hack.
-// TODO SERVER-65129
-const isAutoParameterizationEnabled = checkSBEEnabled(db, ["featureFlagAutoParameterization"]);
-const parentStage = isAutoParameterizationEnabled ? "PROJECTION_COVERED" : "FETCH";
+const isSBEPlanCacheEnabled = checkSBEEnabled(db, ["featureFlagSbePlanCache"]);
+const parentStage = isSBEPlanCacheEnabled ? "PROJECTION_COVERED" : "FETCH";
explain = t.find(query, {_id: 1}).explain();
winningPlan = getWinningPlan(explain.queryPlanner);
engineSpecificAssertion(
diff --git a/jstests/core/profile_find.js b/jstests/core/profile_find.js
index b430f74f632..05d9ee3a757 100644
--- a/jstests/core/profile_find.js
+++ b/jstests/core/profile_find.js
@@ -10,7 +10,6 @@
// For 'getLatestProfilerEntry()'.
load("jstests/libs/profiler.js");
-load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
var testDB = db.getSiblingDB("profile_find");
assert.commandWorked(testDB.dropDatabase());
@@ -113,24 +112,19 @@ for (i = 0; i < 20; ++i) {
assert.neq(coll.findOne({a: 5, b: 15}), null);
assert.neq(coll.findOne({a: 5, b: 15}), null);
-// Replanning is not supported yet for the SBE plan cache without auto-parameterization.
-//
-// TODO SERVER-61314: Remove this check together with removal of "featureFlagSbePlanCache".
-if (!checkSBEEnabled(db, ["featureFlagSbePlanCache"])) {
- // Run a query with the same shape, but with different parameters. The plan cached for the
- // query above will perform poorly (since the selectivities are different) and we will be
- // forced to replan.
- assert.neq(coll.findOne({a: 15, b: 10}), null);
- profileObj = getLatestProfilerEntry(testDB, profileEntryFilter);
-
- assert.eq(profileObj.replanned, true, profileObj);
- assert(profileObj.hasOwnProperty('replanReason'), profileObj);
- assert(
- profileObj.replanReason.match(
- /cached plan was less efficient than expected: expected trial execution to take [0-9]+ (works|reads) but it took at least [0-9]+ (works|reads)/),
- profileObj);
- assert.eq(profileObj.appName, "MongoDB Shell", profileObj);
-}
+// Run a query with the same shape, but with different parameters. The plan cached for the
+// query above will perform poorly (since the selectivities are different) and we will be
+// forced to replan.
+assert.neq(coll.findOne({a: 15, b: 10}), null);
+profileObj = getLatestProfilerEntry(testDB, profileEntryFilter);
+
+assert.eq(profileObj.replanned, true, profileObj);
+assert(profileObj.hasOwnProperty('replanReason'), profileObj);
+assert(
+ profileObj.replanReason.match(
+ /cached plan was less efficient than expected: expected trial execution to take [0-9]+ (works|reads) but it took at least [0-9]+ (works|reads)/),
+ profileObj);
+assert.eq(profileObj.appName, "MongoDB Shell", profileObj);
//
// Confirm that query modifiers such as "hint" are in the profiler document.
diff --git a/jstests/core/profile_query_hash.js b/jstests/core/profile_query_hash.js
index a3f6b29fc30..51b00d55996 100644
--- a/jstests/core/profile_query_hash.js
+++ b/jstests/core/profile_query_hash.js
@@ -11,15 +11,6 @@
// For getLatestProfilerEntry
load("jstests/libs/profiler.js");
-load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
-
-if (checkSBEEnabled(db, ["featureFlagSbePlanCache"])) {
- // Instead of encoding the shape of a query, SBE's encoding currently includes the entire query.
- // So the tests in this file only apply when the SBE plan cache is disabled. This will change
- // after implementing auto-parameterization.
- jsTest.log("Skipping test because SBE and SBE plan cache are both enabled.");
- return;
-}
const testDB = db.getSiblingDB("query_hash");
assert.commandWorked(testDB.dropDatabase());
diff --git a/jstests/noPassthrough/log_and_profile_query_hash.js b/jstests/noPassthrough/log_and_profile_query_hash.js
index 8f7b6a91e26..84cd1bc438f 100644
--- a/jstests/noPassthrough/log_and_profile_query_hash.js
+++ b/jstests/noPassthrough/log_and_profile_query_hash.js
@@ -7,7 +7,6 @@
// For getLatestProfilerEntry().
load("jstests/libs/profiler.js");
load("jstests/libs/logv2_helpers.js");
-load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
// Prevent the mongo shell from gossiping its cluster time, since this will increase the amount
// of data logged for each op. For some of the testcases below, including the cluster time would
@@ -134,13 +133,7 @@ const hashValues = testList.map((testCase) => runTestsAndGetHashes(testDB, testC
// Confirm that the same shape of query has the same hashes.
assert.neq(hashValues[0], hashValues[1]);
-
-// TODO SERVER-61314: Remove this check when "featureFlagSbePlanCache" is removed. This part of the
-// test cannot work when the SBE plan cache is enabled until the SBE plan cache supports
-// auto-parameterization.
-if (!checkSBEEnabled(testDB, ["featureFlagSbePlanCache"])) {
- assert.eq(hashValues[1], hashValues[2]);
-}
+assert.eq(hashValues[1], hashValues[2]);
// Test that the expected 'planCacheKey' and 'queryHash' are included in the transitional
// log lines when an inactive cache entry is created.
diff --git a/jstests/noPassthrough/plan_cache_replan_sort.js b/jstests/noPassthrough/plan_cache_replan_sort.js
index 4255987bf8e..86ac3ca8bdc 100644
--- a/jstests/noPassthrough/plan_cache_replan_sort.js
+++ b/jstests/noPassthrough/plan_cache_replan_sort.js
@@ -17,14 +17,6 @@ const db = conn.getDB("test");
const coll = db.plan_cache_replan_sort;
coll.drop();
-// Replanning is not supported yet without auto-parameterization. TODO SERVER-61314: Remove this
-// check together with removal of "featureFlagSbePlanCache".
-if (checkSBEEnabled(db, ["featureFlagSbePlanCache"])) {
- jsTest.log("Skipping test because SBE and SBE plan cache are both enabled.");
- MongoRunner.stopMongod(conn);
- return;
-}
-
// Ensure a plan with a sort stage gets cached.
assert.commandWorked(coll.createIndex({x: 1}));
assert.commandWorked(coll.createIndex({y: 1}));
@@ -50,7 +42,16 @@ assert.eq(1, coll.find({x: 5}).sort({y: 1}).itcount());
const cachedPlans = coll.getPlanCache().list();
assert.eq(1, cachedPlans.length, cachedPlans);
assert.eq(true, cachedPlans[0].isActive, cachedPlans);
-assert.eq("SORT", getCachedPlan(cachedPlans[0].cachedPlan).stage, cachedPlans);
+const cachedPlan = getCachedPlan(cachedPlans[0].cachedPlan);
+const cachedPlanVersion = cachedPlans[0].version;
+if (checkSBEEnabled(db, ["featureFlagSbePlanCache"])) {
+ // If the SBE plan cache is on, then the cached plan has a different format.
+ assert.eq(cachedPlanVersion, "2", cachedPlans);
+ assert(cachedPlan.stages.includes("sort"), cachedPlans);
+} else {
+ assert.eq(cachedPlanVersion, "1", cachedPlans);
+ assert.eq(cachedPlan.stage, "SORT", cachedPlans);
+}
// Assert we "replan", by running the same query with different parameters. This time the filter is
// not selective at all and will result in more documents attempted to be sorted.
diff --git a/jstests/noPassthrough/sbe_plan_cache_autoparameterize_collscan.js b/jstests/noPassthrough/sbe_plan_cache_autoparameterize_collscan.js
index 13074276090..79361c2ae24 100644
--- a/jstests/noPassthrough/sbe_plan_cache_autoparameterize_collscan.js
+++ b/jstests/noPassthrough/sbe_plan_cache_autoparameterize_collscan.js
@@ -1,9 +1,6 @@
/**
* Tests that auto-parameterized collection scan plans are correctly stored and in the SBE plan
* cache, and that they can be correctly recovered from the cache with new parameter values.
- *
- * TODO SERVER-64137: Move this test to jstests/core/ once we no longer need to specially configure
- * 'featureFlagAutoParameterization'.
*/
(function() {
"use strict";
@@ -13,12 +10,16 @@ load("jstests/libs/sbe_util.js");
// TODO SERVER-64315: re-enable this test. This test depends on caching single solution plans,
// which is disabled temporarily due to a bug.
+//
+// As part of re-enabling the test, we should move it to jstests/core/ so that it can benefit from
+// passthrough testing. This test formerly needed to be in noPassthrough because it required a
+// special flag to enable auto-parameterization, but this is no longer the case.
if (true) {
jsTest.log("This test is temporarily disabled");
return;
}
-const conn = MongoRunner.runMongod({setParameter: "featureFlagAutoParameterization=true"});
+const conn = MongoRunner.runMongod();
assert.neq(conn, null, "mongod failed to start up");
const dbName = jsTestName();
diff --git a/jstests/noPassthroughWithMongod/index_bounds_static_limit.js b/jstests/noPassthroughWithMongod/index_bounds_static_limit.js
index 77f56df638f..3918976b51f 100644
--- a/jstests/noPassthroughWithMongod/index_bounds_static_limit.js
+++ b/jstests/noPassthroughWithMongod/index_bounds_static_limit.js
@@ -54,8 +54,7 @@ function assertIndexScanPlan(explain, isGeneric) {
}
try {
- // TODO SERVER-65129: use 'featureFlagSbePlanCache' instead
- const isAutoParameterizationEnabled = checkSBEEnabled(db, ["featureFlagAutoParameterization"]);
+ const isSBEPlanCacheEnabled = checkSBEEnabled(db, ["featureFlagSbePlanCache"]);
// Verify that when the number of statically generated single interval bounds is less than the
// static limit, the optimized plan is used.
@@ -63,7 +62,7 @@ try {
coll.find({a: {$in: [1, 2, 3]}, b: {$in: [10, 11, 12]}, c: {$in: [42]}, d: {$lt: 3}})
.explain("executionStats");
- if (isAutoParameterizationEnabled) {
+ if (isSBEPlanCacheEnabled) {
assertIndexScanPlan(optimized, /*isGeneric*/ false);
} else {
const optimiziedStages = optimized.executionStats.executionStages;
@@ -78,7 +77,7 @@ try {
coll.find({a: {$in: [1, 2, 3]}, b: {$in: [10, 11, 12]}, c: {$in: [42]}, d: {$lt: 3}})
.explain("executionStats");
- if (isAutoParameterizationEnabled) {
+ if (isSBEPlanCacheEnabled) {
assertIndexScanPlan(generic, /*isGeneric*/ true);
} else {
const genericStages = generic.executionStats.executionStages;
diff --git a/jstests/noPassthroughWithMongod/ne_array_indexability.js b/jstests/noPassthroughWithMongod/ne_array_indexability.js
index bf7fc0f019b..b3556152939 100644
--- a/jstests/noPassthroughWithMongod/ne_array_indexability.js
+++ b/jstests/noPassthroughWithMongod/ne_array_indexability.js
@@ -5,7 +5,6 @@
load("jstests/libs/analyze_plan.js"); // For getPlanCacheKeyFromShape.
load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
-const isSbePlanCacheEnabled = checkSBEEnabled(db, ["featureFlagSbePlanCache"]);
const coll = db.ne_array_indexability;
coll.drop();
@@ -27,13 +26,19 @@ function runTest(queryToCache, queryToRunAfterCaching) {
assert.eq(coll.find(queryToRunAfterCaching).itcount(), 1);
const explain = assert.commandWorked(coll.find(queryToRunAfterCaching).explain());
- // TODO SERVER-61314: Remove this check when "featureFlagSbePlanCache" is removed.
- // SBE plan cache key currently encodes the entire filter, so queryHash should be different too.
- if (!isSbePlanCacheEnabled) {
- // The query with the $ne: array should have the same queryHash, but a different
- // planCacheKey.
+
+ // For the classic plan cache, the query with the $ne: array should have the same queryHash, but
+ // a different planCacheKey. The SBE plan cache, on the other hand, does not auto-parameterize
+ // $in or $eq involving a constant of type array, and therefore will consider the two queries to
+ // have different shapes.
+ if (checkSBEEnabled(db, ["featureFlagSbePlanCache"])) {
+ assert.neq(explain.queryPlanner.queryHash, cacheEntries[0].queryHash);
+ } else {
assert.eq(explain.queryPlanner.queryHash, cacheEntries[0].queryHash);
}
+
+ // For both the classic and SBE plan caches, the two queries must have different plan cache
+ // keys.
assert.neq(explain.queryPlanner.planCacheKey, cacheEntries[0].planCacheKey);
}
diff --git a/src/mongo/db/query/canonical_query.cpp b/src/mongo/db/query/canonical_query.cpp
index 4d958aad302..7c4830be8ca 100644
--- a/src/mongo/db/query/canonical_query.cpp
+++ b/src/mongo/db/query/canonical_query.cpp
@@ -200,10 +200,10 @@ Status CanonicalQuery::init(OperationContext* opCtx,
}
auto unavailableMetadata = validStatus.getValue();
_root = MatchExpression::normalize(std::move(root));
- if (feature_flags::gFeatureFlagSbePlanCache.isEnabledAndIgnoreFCV() &&
- feature_flags::gFeatureFlagAutoParameterization.isEnabledAndIgnoreFCV()) {
- // Both the SBE plan cache and auto-parameterization are enabled. Add parameter markers to
- // the appropriate match expression leaf nodes.
+ if (feature_flags::gFeatureFlagSbePlanCache.isEnabledAndIgnoreFCV()) {
+ // When the SBE plan cache is enabled, we auto-parameterize queries in the hopes of caching
+ // a parameterized plan. Here we add parameter markers to the appropriate match expression
+ // leaf nodes.
_inputParamIdToExpressionMap = MatchExpression::parameterize(_root.get());
}
// The tree must always be valid after normalization.
diff --git a/src/mongo/db/query/canonical_query_encoder.cpp b/src/mongo/db/query/canonical_query_encoder.cpp
index 6b212ad2a53..f41f6827694 100644
--- a/src/mongo/db/query/canonical_query_encoder.cpp
+++ b/src/mongo/db/query/canonical_query_encoder.cpp
@@ -724,39 +724,21 @@ public:
void visit(const ModMatchExpression* expr) final {
auto divisorParam = expr->getDivisorInputParamId();
auto remainderParam = expr->getRemainderInputParamId();
- if (divisorParam) {
- tassert(6142105,
- "$mod expression had divisor param but not remainder param",
- remainderParam);
- encodeParamMarker(*divisorParam);
- encodeParamMarker(*remainderParam);
- } else {
- // TODO SERVER-64137: remove this branch and assert the existence of both params once
- // auto-parameterization flag is removed.
- tassert(6142106,
- "$mod expression had remainder param but not divisor param",
- !remainderParam);
- encodeRhs(expr);
- }
+ tassert(6512901, "$mod expression should have divisor param", divisorParam);
+ tassert(6512902, "$mod expression should have remainder param", remainderParam);
+
+ encodeParamMarker(*divisorParam);
+ encodeParamMarker(*remainderParam);
}
void visit(const RegexMatchExpression* expr) final {
auto sourceRegexParam = expr->getSourceRegexInputParamId();
auto compiledRegexParam = expr->getCompiledRegexInputParamId();
- if (sourceRegexParam) {
- tassert(6142107,
- "regex expression had source param but not compiled param",
- compiledRegexParam);
- encodeParamMarker(*sourceRegexParam);
- encodeParamMarker(*compiledRegexParam);
- } else {
- // TODO SERVER-64137: remove this branch and assert the existence of both params once
- // auto-parameterization flag is removed.
- tassert(6142108,
- "regex expression had compiled param but not source param",
- !compiledRegexParam);
- encodeRhs(expr);
- }
+ tassert(6512903, "regex expression should have source param", sourceRegexParam);
+ tassert(6512904, "regex expression should have compiled param", compiledRegexParam);
+
+ encodeParamMarker(*sourceRegexParam);
+ encodeParamMarker(*compiledRegexParam);
}
void visit(const SizeMatchExpression* expr) final {
@@ -916,20 +898,11 @@ private:
void encodeBitTestExpression(const BitTestMatchExpression* expr) {
auto bitPositionsParam = expr->getBitPositionsParamId();
auto bitMaskParam = expr->getBitMaskParamId();
- if (bitPositionsParam) {
- tassert(6142100,
- "bit-test expression had bit positions param but not bitmask param",
- bitMaskParam);
- encodeParamMarker(*bitPositionsParam);
- encodeParamMarker(*bitMaskParam);
- } else {
- // TODO SERVER-64137: remove this branch and assert the existence of both params once
- // auto-parameterization flag is removed.
- tassert(6142101,
- "bit-test expression had bitmask param but not bit positions param",
- !bitMaskParam);
- encodeRhs(expr);
- }
+ tassert(6512905, "bit-test expression should have bit positions param", bitPositionsParam);
+ tassert(6512906, "$mod expression should have bitmask param", bitMaskParam);
+
+ encodeParamMarker(*bitPositionsParam);
+ encodeParamMarker(*bitMaskParam);
}
/**
@@ -1037,11 +1010,14 @@ void encodeKeyForAutoParameterizedMatchSBE(MatchExpression* matchExpr, BufBuilde
} // namespace
std::string encodeSBE(const CanonicalQuery& cq) {
+ tassert(6512900,
+ "using the SBE plan cache key encoding requires the SBE plan cache to be enabled",
+ feature_flags::gFeatureFlagSbePlanCache.isEnabledAndIgnoreFCV());
tassert(6142104,
"attempting to encode SBE plan cache key for SBE-incompatible query",
cq.isSbeCompatible());
- auto serializedFilter = cq.root()->serialize(true);
+ const auto& filter = cq.getQueryObj();
const auto& proj = cq.getFindCommandRequest().getProjection();
const auto& sort = cq.getFindCommandRequest().getSort();
@@ -1053,17 +1029,11 @@ std::string encodeSBE(const CanonicalQuery& cq) {
// A constant for reserving buffer size. It should be large enough to reserve the space required
// to encode various properties from the FindCommandRequest and query knobs.
const int kBufferSizeConstant = 200;
- size_t bufSize = serializedFilter.objsize() + proj.objsize() + strBuilderEncoded.size() +
- kBufferSizeConstant;
+ size_t bufSize =
+ filter.objsize() + proj.objsize() + strBuilderEncoded.size() + kBufferSizeConstant;
BufBuilder bufBuilder(bufSize);
- if (feature_flags::gFeatureFlagAutoParameterization.isEnabledAndIgnoreFCV()) {
- encodeKeyForAutoParameterizedMatchSBE(cq.root(), &bufBuilder);
- } else {
- // When auto-parameterization is off, just add the entire filter BSON to the cache key,
- // including any constants.
- bufBuilder.appendBuf(serializedFilter.objdata(), serializedFilter.objsize());
- }
+ encodeKeyForAutoParameterizedMatchSBE(cq.root(), &bufBuilder);
bufBuilder.appendBuf(proj.objdata(), proj.objsize());
bufBuilder.appendStr(strBuilderEncoded, false /* includeEndingNull */);
diff --git a/src/mongo/db/query/canonical_query_encoder_test.cpp b/src/mongo/db/query/canonical_query_encoder_test.cpp
index b23347329b6..928fdbda8ee 100644
--- a/src/mongo/db/query/canonical_query_encoder_test.cpp
+++ b/src/mongo/db/query/canonical_query_encoder_test.cpp
@@ -364,9 +364,6 @@ TEST(CanonicalQueryEncoderTest, ComputeKeySBE) {
// TODO SERVER-61314: Remove when featureFlagSbePlanCache is removed.
RAIIServerParameterControllerForTest controllerSBEPlanCache("featureFlagSbePlanCache", true);
- // TODO SERVER-64137: Remove when featureFlagAutoParameterization is removed.
- RAIIServerParameterControllerForTest controllerAutoParam("featureFlagAutoParameterization",
- true);
testComputeSBEKey("{}", "{}", "{}", "YW4ABQAAAAAAAAAAAAAAAG5ubm4FAAAAAAUAAAAABQAAAAA=");
testComputeSBEKey(
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index 55c9d78deed..4d4ed564928 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -282,13 +282,6 @@ void fillOutIndexEntries(OperationContext* opCtx,
const CanonicalQuery* canonicalQuery,
const CollectionPtr& collection,
std::vector<IndexEntry>& entries) {
- // TODO SERVER-65129: Eliminate this check once we support auto-parameterized index scan plans.
- if (feature_flags::gFeatureFlagAutoParameterization.isEnabledAndIgnoreFCV()) {
- // Indexed plans are not yet supported when auto-parameterization is enabled, so make it
- // look to the planner like there are no indexes.
- return;
- }
-
auto ii = collection->getIndexCatalog()->getIndexIterator(opCtx, false);
while (ii->more()) {
const IndexCatalogEntry* ice = ii->next();
@@ -1003,12 +996,15 @@ protected:
}
std::unique_ptr<SlotBasedPrepareExecutionResult> buildIdHackPlan() {
- // Auto-parameterization currently only works for collection scan plans, but idhack plans
- // use the _id index. Therefore, we inhibit idhack when auto-parametrization is enabled.
+ // When the SBE plan cache is enabled we rely on it for fast find-by-_id queries rather than
+ // having a special implementation of the idhack. Therefore, this function returns nullptr
+ // early when the SBE plan cache is on.
//
- // TODO SERVER-64237: Eliminate this check once we support auto-parameterized ID hack
- // plans.
- if (feature_flags::gFeatureFlagAutoParameterization.isEnabledAndIgnoreFCV()) {
+ // This is still fast for idhack eligible queries. The first invocation of such a query will
+ // go through the normal planning and plan compilation process, resulting in an
+ // auto-parameterized SBE plan cache entry. Subsequent idhack queries can simply re-use this
+ // cache entry, and the hot path for recovering cached plans is already carefully optimized.
+ if (feature_flags::gFeatureFlagSbePlanCache.isEnabledAndIgnoreFCV()) {
return nullptr;
}
diff --git a/src/mongo/db/query/query_feature_flags.idl b/src/mongo/db/query/query_feature_flags.idl
index b3cc7520594..47b7bd78be0 100644
--- a/src/mongo/db/query/query_feature_flags.idl
+++ b/src/mongo/db/query/query_feature_flags.idl
@@ -83,13 +83,6 @@ feature_flags:
cpp_varname: gFeatureFlagSbePlanCache
default: false
- featureFlagAutoParameterization:
- description: "Feature flag for enabling auto-parameterization of match expressions. This
- feature is used to store auto-parameterized plans in the SBE plan cache, so this flag is only
- meaningful to turn on in combination with 'featureFlagSbePlanCache'."
- cpp_varname: gFeatureFlagAutoParameterization
- default: false
-
featureFlagSortArray:
description: "Feature flag for allowing use of the $sortArray aggregation expression"
cpp_varname: gFeatureFlagSortArray