The following patch to v2.6 PlanRankingTest::All::setupTests() causes the NonCoveredIxisectFetchesLess test to fail (see example failure).
This test has been disabled in master, but exists in v2.6. I propose removing it entirely, in master and v2.6.
diff --git a/src/mongo/dbtests/plan_ranking.cpp b/src/mongo/dbtests/plan_ranking.cpp index 02efa06..2e49e36 100644 --- a/src/mongo/dbtests/plan_ranking.cpp +++ b/src/mongo/dbtests/plan_ranking.cpp @@ -833,20 +833,20 @@ namespace PlanRankingTests { add<PlanRankingIntersectWithBackup>(); add<PlanRankingPreferCovered>(); add<PlanRankingAvoidIntersectIfNoResults>(); add<PlanRankingPreferCoveredEvenIfNoResults>(); add<PlanRankingPreferImmediateEOF>(); + add<PlanRankingPreferImmediateEOFAgainstHashed>(); add<PlanRankingNoCollscan>(); add<PlanRankingCollscan>(); add<PlanRankingIxisectCovered>(); add<PlanRankingIxisectNonCovered>(); add<PlanRankingNonCoveredIxisectFetchesLess>(); add<PlanRankingIxisectHitsEOFFirst>(); add<PlanRankingChooseBetweenIxisectPlans>(); add<PlanRankingAvoidBlockingSort>(); add<PlanRankingWorkPlansLongEnough>(); add<PlanRankingAccountForKeySkips>(); - add<PlanRankingPreferImmediateEOFAgainstHashed>(); } } planRankingAll; } // namespace PlanRankingTest
I believe that success of the "NonCoveredIxisectFetchesLess" test relies on the DiskLoc order of the documents inserted in the collection (I believe that the first document having the smallest DiskLoc is the necessary condition, but I haven't investigated fully). In the failure scenario, I observe the intersection plan losing to one of the single-index plans because the AND_SORTED stage spent almost all of its work cycles advancing one of its two children. In the success scenario, I observe the intersection plan winning, and the AND_SORTED stage advancing both of its children approximately an equal amount. I infer that the value of the stage's first saved "targetLoc" explains the difference between these two executions.
The failure occurs only when all suites are run; the failure does not occur when just the plan ranking suite is run.
- links to