[SERVER-24396] Progressive elimination of candidate plans during plan ranking trial period Created: 03/Jun/16  Updated: 10/Nov/23

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: storch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-24312 Mongo Query Taking Lot of Time Select... Closed
related to SERVER-31078 Query planning is very slow during mu... Backlog
Assigned Teams:
Query Optimization
Participants:

 Description   

The MongoDB query optimizer uses an empirical plan ranking strategy in which candidate plans are executed in order to determine which is likely to be most efficient. The trial period ends when either

  1. a plan executes the entire query,
  2. a plan generates an entire batch of results, or
  3. some large maximum amount of work has been done.

In the third case, it is possible that the trial period will be expensive, since there could be n candidate plans each performing a significant amount of IO or database operations.

If the candidates execute for a long time—say, 10,000 units of work—without hitting end condition #1 or end condition #2, we should pause and eliminate any candidate plan that has already proven to be suboptimal. This same progressive refinement strategy could be done every w units of work in order to minimize the cost of the plan selection trial period.


Generated at Thu Feb 08 04:06:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.