[SERVER-20139] Enable CachedPlanStage replanning by default in 3.0 Created: 26/Aug/15  Updated: 20/Sep/17  Resolved: 26/Aug/15

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to DOCS-6401 Updates to query plan revision as of ... Closed
is related to SERVER-15225 CachedPlanStage should execute for tr... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: QuInt 8 08/28/15
Participants:
Case:

 Description   
Issue Status as of Aug 26, 2015

ISSUE SUMMARY
The query optimizer caches plans for each query shape and reuses these plans for a time. In situations where the performance of the cached plan is poor for a particular instance of the query shape, the optimizer may select a plan with poor performance and fail to evict the cache entry. This behavior may impact deployments where two queries with the same shape have different performance characteristics (generally due to a difference in selectivity).

SERVER-15225 makes the query planner evaluate the cost of the cached query plan, and if the cost of this plan is too high, the query planner switches to a more efficient plan. This more efficient plan is then cached for future use.

This ticket enables the optimization from SERVER-15225 by default.

To disable this behavior users can set internalQueryCacheReplanningEnabled parameter to false using the setParameter command on a running system, or at start time using the setParameter commandline option or setParameter in the configuration file.

For example, to disable using setParameter:

db.runCommand({setParameter: 1, internalQueryCacheReplanningEnabled: false})

This improvement can be re-enabled as follows:

db.runCommand({setParameter: 1, internalQueryCacheReplanningEnabled: true})

See SERVER-15225 for additional details.

Original description

SERVER-15225 introduced aggressive plan cache eviction and replanning which can solve a large class of query plan selection problems. This change was backported to the 3.0 branch, first available in 3.0.4, but is disabled by default. We should flip the default so that the plan cache eviction and replanning is available by default.



 Comments   
Comment by Daniel Pasette (Inactive) [ 15/Oct/15 ]

It won't be possible to backport this fix to the 2.6 branch.

Comment by Githook User [ 26/Aug/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-20139 enable CachedPlanStage replanning by default
Branch: v3.0
https://github.com/mongodb/mongo/commit/0e4431a22883616e3296f444f71e83b13c194596

Generated at Thu Feb 08 03:53:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.