-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
As noted by christopher.harris@mongodb.com (see comments for full slack thread context):
The top-level maxTimeMS is respected:
db.runCommand({
explain: { ... },
maxTimeMS: 1000
})
Nested maxTimeMS in explain is not work:
db.runCommand({
explain: {
... ,
maxTimeMS: 1000
}
})
Two possible solutions:
1. Augment explain to accept it as an argument
2. Validate the command on server-side and reject it if there are extra options to explain
Repro:
print("Top level maxTimeMS"); db.runCommand({ explain: { find: "orders", filter: { $where: "sleep(1000) || true" } }, maxTimeMS: 10 }); // Should error with "MongoServerError: operation exceeded time limit" print("Explain nested maxTimeMS"); db.runCommand({ explain: { find: "orders", filter: { $where: "sleep(1000) || true" }, maxTimeMS: 10}, }); // Runs to completion
- is duplicated by
-
SERVER-121271 explain('executionStats') does not observe maxTimeMS if set as an aggregate option
-
- Closed
-
- is related to
-
SERVER-94592 Check inner arguments for explain
-
- Closed
-
- related to
-
SERVER-121271 explain('executionStats') does not observe maxTimeMS if set as an aggregate option
-
- Closed
-