Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
4.2.0-rc1
-
None
-
Fully Compatible
-
ALL
-
v4.2, v4.0, v3.6
-
Query 2019-07-15, Query 2019-07-29, Query 2019-08-12, Query 2019-08-26
-
0
Description
The following diff includes a jstest that will shift between 2 sets of candidate plans depending on the run. We would expect the set of plans generated to remain constant across test executions.
diff --git a/jstests/core/repro.js b/jstests/core/repro.js
|
new file mode 100644
|
index 0000000000..511d1819ef
|
--- /dev/null
|
+++ b/jstests/core/repro.js
|
@@ -0,0 +1,27 @@
|
+
|
+db.coll.drop();
|
+db.coll.insert({});
|
+db.coll.createIndexes([
|
+ {"obj.obj.obj.obj.str": 1, "obj.obj.obj.str": 1},
|
+ {"obj.obj.obj.str": -1, "date": -1},
|
+ {"obj.date": 1},
|
+ {"obj.obj.obj.str": 1, "obj.obj.obj.obj.date": -1},
|
+ {"obj.date": -1, "obj.obj.obj.str": 1},
|
+ {"obj.date": 1, "obj.obj.num": 1},
|
+ {"obj.obj.obj.str": 1, "obj.obj.obj.date": -1},
|
+ {"obj.obj.obj.obj.str": 1, "obj.date": 1}
|
+]);
|
+var result =
|
+ db.coll
|
+ .aggregate([
|
+ {
|
+ $match: {
|
+ $and: [
|
+ {$or: [{'obj.obj.obj.str': {$not: {$in: []}}}, {'obj.date': {$nin: []}}]},
|
+ {'obj.obj.obj.obj.str': {$not: {$lte: ''}}}
|
+ ]
|
+ }
|
+ },
|
+ {$project: {"obj.obj.obj.obj.str": 1, "_id": 0}}
|
+ ])
|
+ .toArray();
|
diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp
|
index 9735dbade0..4145df3056 100644
|
--- a/src/mongo/db/query/query_planner.cpp
|
+++ b/src/mongo/db/query/query_planner.cpp
|
@@ -828,7 +828,7 @@ StatusWith<std::vector<std::unique_ptr<QuerySolution>>> QueryPlanner::plan(
|
// Don't leave tags on query tree.
|
query.root()->resetTag();
|
|
- LOG(5) << "Planner: outputted " << out.size() << " indexed solutions.";
|
+ LOG(0) << "Planner: outputted " << out.size() << " indexed solutions.";
|
|
// Produce legible error message for failed OR planning with a TEXT child.
|
// TODO: support collection scan for non-TEXT children of OR.
|
Attachments
Issue Links
- is related to
-
SERVER-38249 stdx::unordered_map should be implemented as absl::node_hash_map
-
- Closed
-