Skip to content

(DOCSP-18813): Note that change streams cannot leverage indexes #6033

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
Oct 25, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,19 @@ From the moment an unsharded collection is sharded until the time the change
stream catches up to the first chunk migration, the ``documentKey`` in the
change stream notification document only includes the ``_id`` of the document,
not the full shard key.

Indexes and Performance
-----------------------

Change streams cannot use indexes. MongoDB does not support creating
indexes on the :term:`oplog` collection. Therefore, avoid opening a high
number of :ref:`specifically-targeted <changeStreams-watch-deployment>`
change streams as these can impact server performance.

Change Stream Optimization
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. |change-streams| replace:: change streams

.. include:: /includes/change-streams-optimization.rst

6 changes: 4 additions & 2 deletions source/changeStreams.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ Change streams are available for :doc:`replica sets <replication>` and

.. include:: /includes/extracts/changestream-rc-majority-4.2.rst

Watch Collection/Database/Deployment
------------------------------------
.. _changeStreams-watch-deployment:

Watch a Collection, Database, or Deployment
-------------------------------------------

You can open change streams against:

Expand Down