-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
When we add a limit to a deletion, it is not passed to underlying find.
It may lead to wasted work spent multi-planning, because it won't terminate after finding the required number of documents.
Repro:
db.test.drop(); for (let i = 0; i < 10; ++i) { db.test.insertOne({a: i, b: i}); } db.test.createIndex({a: 1}); db.test.createIndex({b: 1});print(db.runCommand({explain: { delete: "test", deletes: [ {q: { a: {$gte: 2}, b: {$gte: 2}}, limit: 1} ]}}));
Note that we fetch 8 documents instead of just one.
- is related to
-
SERVER-88934 Automatically increase test coverage of multi-planning and replanning
- Closed