[SERVER-15600] Support for explaining query solution in the presence of hypothetical indexes Created: 10/Oct/14 Updated: 23/Oct/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Participants: | |||||||||
| Description |
|
It would be useful to be able to ask the query planner to explain a query solution given some additional hypothetical index specification(s). This would allow a user to experiment with how a query would be planned with other indexes without needing to create those indexes. Something like, in the shell:: find(...).explain().hypothesizing([indexSpec0, indexSpec1, ..., indexSpecn]) |
| Comments |
| Comment by Matt Boros [ 23/Oct/23 ] |
|
For skunkworks I created a rough POC of this: https://github.com/10gen/mongo/compare/master...hypothetical_indexes The jstest I included shows:
|
| Comment by Andy Pavlo [ 10/Oct/14 ] |
|
Per my discussion with Andrew yesterday, this would be similar to the "what-if" API used in RDBMSs: |
| Comment by Scott Hernandez (Inactive) [ 10/Oct/14 ] |
|
You would also need to be able to specify if the potential index would be multi-key or not; Once/if we have stats that too would affect index ranking/selection. |