diff options
author | Kevin Cherkauer <kevin.cherkauer@mongodb.com> | 2023-05-04 22:52:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-04 23:32:30 +0000 |
commit | 46540ddcce8b7ab81e5a7f009999aec85114fcab (patch) | |
tree | 0219ed0a1c0e76ac6485485f9ef3265c09f88487 | |
parent | bf9e8a4844e720b90cc6a939b23e08f7aeb0df20 (diff) | |
download | mongo-46540ddcce8b7ab81e5a7f009999aec85114fcab.tar.gz |
SERVER-76862 update sample_nested_agg_queries_common.js for SBE CC scans
-rw-r--r-- | jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js b/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js index 38a39b3ed2e..e08fe45f5ff 100644 --- a/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js +++ b/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js @@ -29,15 +29,22 @@ const outerAggTestCases = [ ]; }, requireShardToRouteFunc: (db, collName, isShardedColl) => { - // When SBE is enabled, if the collection is not sharded and not clustered, the shard - // will not create a separate pipeline to execute the inner side of a $lookup stage so - // there is no nested aggregate query to route. const listCollectionRes = assert.commandWorked(db.runCommand({listCollections: 1, filter: {name: collName}})); const isClusteredColl = listCollectionRes.cursor.firstBatch[0].options.hasOwnProperty("clusteredIndex"); - const isEligibleForSBELookupPushdown = - checkSBEEnabled(db) && !isShardedColl && !isClusteredColl; + + // When SBE is enabled, if the collection is not sharded and either not clustered or + // the featureFlagSbeFull is true, the shard will not create a separate pipeline to + // execute the inner side of a $lookup stage so there is no nested aggregate query to + // route. These are the cases when SBE is actually used; SBE does $lookup pushdown + // whereas Classic does not. + // TODO SERVER-75715: Remove "featureFlagSbeFull" comment reference and check, as this + // ticket will move SBE clustered collection support out from behind this flag. The full + // check should then become just "!isShardedColl && checkSBEEnabled(db)". + const isEligibleForSBELookupPushdown = !isShardedColl && + ((!isClusteredColl && checkSBEEnabled(db)) || + checkSBEEnabled(db, ["featureFlagSbeFull"])); return !isEligibleForSBELookupPushdown; } }, |