Skip to content

Commit b0bf3bd

Browse files
(DOCS-14317): Clarification for index filters
1 parent 536bef2 commit b0bf3bd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

source/core/query-plans.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,19 +240,20 @@ The ``queryHash`` and ``planCacheKey`` are available in:
240240
Index Filters
241241
-------------
242242

243-
Index filters determine which indexes the optimizer evaluates for a
244-
:term:`query shape`. A query shape consists of a combination of query,
245-
sort, and projection specifications. If an index filter exists for a
246-
given query shape, the optimizer only considers those indexes
247-
specified in the filter.
243+
Index filters are set with the :dbcommand:`planCacheSetFilter` command
244+
and determine which indexes the optimizer evaluates for a :term:`query
245+
shape`. A query shape consists of a combination of query, sort, and
246+
projection specifications. If an index filter exists for a given query
247+
shape, the optimizer only considers those indexes specified in the
248+
filter.
248249

249250
When an index filter exists for the query shape, MongoDB ignores the
250251
:method:`~cursor.hint()`. To see whether MongoDB applied an index
251252
filter for a query shape, check the :data:`~explain.queryPlanner.indexFilterSet`
252253
field of either the :method:`db.collection.explain()` or the
253254
:method:`cursor.explain()` method.
254255

255-
Index filters only affects which indexes the optimizer evaluates; the
256+
Index filters only affect which indexes the optimizer evaluates; the
256257
optimizer may still select the collection scan as the winning plan for
257258
a given query shape.
258259

@@ -269,4 +270,4 @@ See :dbcommand:`planCacheListFilters`,
269270

270271
.. seealso::
271272

272-
:doc:`/applications/indexes`
273+
:doc:`/applications/indexes`

0 commit comments

Comments
 (0)