Skip to content

(DOCS-14317): Clarification for index filters #5286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions source/core/query-plans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,20 @@ 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
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.

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

.. seealso::

:doc:`/applications/indexes`
:doc:`/applications/indexes`