[SERVER-8599] Prevent bad query plans from being cached by adding additional safeguards Created: 16/Feb/13 Updated: 24/Jan/15 Resolved: 30/Dec/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Daniel Pasette (Inactive) | Assignee: | David Storch |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | query_triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The query optimizer has always had a feature where if we use a cached plan for a query and we reach an nscanned that is 10x the nscanned that was recorded when the query plan was saved in the cache, then we attempt using other query plans as well. But this check is only triggered if a high nscanned is observed before 101 matches are found. After 101 matches are found, we're stuck using the cached plan only. We should add additional checks (eg, deviation from avg run time or total nscanned) to guard against keeping bad plans. |
| Comments |
| Comment by Daniel Pasette (Inactive) [ 14/Dec/14 ] |
|
Seems like this was already added in 2.6.0, but I don't think it was logged in an easy to find ticket. Looks like it was committed against this instead: |