On this page本页内容
db.collection.
getPlanCache
()¶mongo
Shell Method
This page documents the 本页记录了mongo
shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. mongo
shell方法,未提及MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。
Returns an interface to access the query plan cache for a collection. 返回访问集合的查询计划缓存的接口。The interface provides methods to view and clear the query plan cache.该接口提供了查看和清除查询计划缓存的方法。
The query optimizer only caches the plans for those query shapes that can have more than one viable plan.查询优化器只缓存那些可以有多个可行计划的查询形状的计划。
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() |
|