summaryrefslogtreecommitdiff
path: root/jstests/libs/analyze_plan.js
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2021-02-09 19:28:33 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-12 21:32:26 +0000
commit234b3c55f416220d150c710e6caeb68391070cb5 (patch)
treee17fbfecbe7f997044dd2d9fb939753de7b466f0 /jstests/libs/analyze_plan.js
parentc8a02bacb3c3fa1a530669af7373603896f336d0 (diff)
downloadmongo-234b3c55f416220d150c710e6caeb68391070cb5.tar.gz
SERVER-53080 generate optimized covered shard filtering plans in SBE
When the SHARDING_FILTER stage's child is an IXSCAN, we will generate a plan where the slots built from pieces of the IXSCAN's keys are used directly to determine the shard key.
Diffstat (limited to 'jstests/libs/analyze_plan.js')
-rw-r--r--jstests/libs/analyze_plan.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/jstests/libs/analyze_plan.js b/jstests/libs/analyze_plan.js
index 0fff85a7f80..fda996dfe56 100644
--- a/jstests/libs/analyze_plan.js
+++ b/jstests/libs/analyze_plan.js
@@ -59,11 +59,12 @@ function getPlanStages(root, stage) {
if ("shards" in root) {
if (Array.isArray(root.shards)) {
- results = root.shards.reduce(
- (res, shard) => res.concat(getPlanStages(
- shard.hasOwnProperty("winningPlan") ? shard.winningPlan : shard.executionStages,
- stage)),
- results);
+ results =
+ root.shards.reduce((res, shard) => res.concat(getPlanStages(
+ shard.hasOwnProperty("winningPlan") ? getWinningPlan(shard)
+ : shard.executionStages,
+ stage)),
+ results);
} else {
const shards = Object.keys(root.shards);
results = shards.reduce(