[SERVER-48625] Explain (and logs) should indicate when query planning thresholds are encountered Created: 05/Jun/20  Updated: 29/Oct/23  Resolved: 01/Dec/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Chris Harris Assignee: Ted Tuckman
Resolution: Fixed Votes: 1
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-14045 Investigate changes in SERVER-48625: ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2020-11-30, Query 2020-12-14
Participants:
Case:

 Description   

There are a handful of parameters that influence the plan generation process.  Two examples would be internalQueryEnumerationMaxOrSolutions and internalQueryMaxScansToExplode.  When encountered, these modify the set of plans that are available for selection and can have an important impact on the overall efficiency of the query (eg SERVER-36393).

In some situations, it is relatively easy to determine that such a threshold was encountered during planning with a high degree of confidence.  For example if the query shape is a (singled) contained $or and there are precisely ten plans that contain a "OR" stage then it is very likely that the deployment is using the default value of 10 for the internalQueryEnumerationMaxOrSolutions parameter and that the threshold was encountered during the planning process.  However it very quickly becomes difficult or impossible to definitively determine that these various thresholds were reached in an arbitrary situation.  

We should report when the planner encounters these situations in explain output.  It is also worth considering adding this to the log output as well (verbose or otherwise).



 Comments   
Comment by Githook User [ 01/Dec/20 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-48625 Add query knobs to explain output and logs
Branch: master
https://github.com/mongodb/mongo/commit/a9982732333fdc6fb853aa8d8596a85cd008f125

Generated at Thu Feb 08 05:17:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.