From a4a8eb8b2d2241845b92acb059abf0889fdddeda Mon Sep 17 00:00:00 2001 From: Jeff Allen Date: Mon, 5 Apr 2021 12:48:17 -0400 Subject: [PATCH] (DOCS-14317): Clarification for index filters --- source/core/query-plans.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/core/query-plans.txt b/source/core/query-plans.txt index ca26a8cc0a2..ed4da6d8355 100644 --- a/source/core/query-plans.txt +++ b/source/core/query-plans.txt @@ -232,11 +232,12 @@ The ``queryHash`` and ``planCacheKey`` are available in: Index Filters ------------- -Index filters determine which indexes the optimizer evaluates for a -:term:`query shape`. A query shape consists of a combination of query, -sort, and projection specifications. If an index filter exists for a -given query shape, the optimizer only considers those indexes -specified in the filter. +Index filters are set with the :dbcommand:`planCacheSetFilter` command +and determine which indexes the optimizer evaluates for a :term:`query +shape`. A query shape consists of a combination of query, sort, and +projection specifications. If an index filter exists for a given query +shape, the optimizer only considers those indexes specified in the +filter. When an index filter exists for the query shape, MongoDB ignores the :method:`~cursor.hint()`. To see whether MongoDB applied an index @@ -244,7 +245,7 @@ filter for a query shape, check the :data:`~explain.queryPlanner.indexFilterSet` field of either the :method:`db.collection.explain()` or the :method:`cursor.explain()` method. -Index filters only affects which indexes the optimizer evaluates; the +Index filters only affect which indexes the optimizer evaluates; the optimizer may still select the collection scan as the winning plan for a given query shape. @@ -261,4 +262,4 @@ See :dbcommand:`planCacheListFilters`, .. seealso:: - :doc:`/applications/indexes` \ No newline at end of file + :doc:`/applications/indexes`