Skip to content

Commit 201ac18

Browse files
(DOCS-14317): Clarification for index filters
1 parent 450e0f7 commit 201ac18

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
@@ -232,19 +232,20 @@ The ``queryHash`` and ``planCacheKey`` are available in:
232232
Index Filters
233233
-------------
234234

235-
Index filters determine which indexes the optimizer evaluates for a
236-
:term:`query shape`. A query shape consists of a combination of query,
237-
sort, and projection specifications. If an index filter exists for a
238-
given query shape, the optimizer only considers those indexes
239-
specified in the filter.
235+
Index filters are set with the :dbcommand:`planCacheSetFilter` command
236+
and determine which indexes the optimizer evaluates for a :term:`query
237+
shape`. A query shape consists of a combination of query, sort, and
238+
projection specifications. If an index filter exists for a given query
239+
shape, the optimizer only considers those indexes specified in the
240+
filter.
240241

241242
When an index filter exists for the query shape, MongoDB ignores the
242243
:method:`~cursor.hint()`. To see whether MongoDB applied an index
243244
filter for a query shape, check the :data:`~explain.queryPlanner.indexFilterSet`
244245
field of either the :method:`db.collection.explain()` or the
245246
:method:`cursor.explain()` method.
246247

247-
Index filters only affects which indexes the optimizer evaluates; the
248+
Index filters only affect which indexes the optimizer evaluates; the
248249
optimizer may still select the collection scan as the winning plan for
249250
a given query shape.
250251

@@ -261,4 +262,4 @@ See :dbcommand:`planCacheListFilters`,
261262

262263
.. seealso::
263264

264-
:doc:`/applications/indexes`
265+
:doc:`/applications/indexes`

0 commit comments

Comments
 (0)