db.collection.getPlanCache()
On this page本页内容
Definition定义
db.collection.getPlanCache()
- Important
mongosh Method
This page documents a
mongosh
method. This is not the documentation for a language-specific driver, such as Node.js.For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.
Returns an interface to access the query plan cache for a collection. The interface provides methods to view and clear the query plan cache.返回一个接口,用于访问集合的查询计划缓存。该接口提供了查看和清除查询计划缓存的方法。Returns:返回值:Interface to access the query plan cache.用于访问查询计划缓存的接口。The query optimizer only caches the plans for those query shapes that can have more than one viable plan.查询优化器只缓存那些可以有多个可行计划的查询形状的计划。
Methods方法
The following methods are available through the interface:通过界面可以使用以下方法:
PlanCache.help() | db.collection.getPlanCache().help() .db.collection.getPlanCache().help() 。 |
PlanCache.clearPlansByQuery() | db.collection.getPlanCache().clearPlansByQuery() db.collection.getPlanCache().clearPlansByQuery() |
PlanCache.clear() | db.collection.getPlanCache().clear() .db.collection.getPlanCache().clear() 。 |
PlanCache.list() | db.collection.getPlanCache().list() . db.collection.getPlanCache().list() 。 |