Skip to content

Commit d7adfd7

Browse files
(DOCSP-18813): Note that change streams cannot leverage indexes
1 parent 1b87298 commit d7adfd7

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

source/administration/change-streams-production-recommendations.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,19 @@ From the moment an unsharded collection is sharded until the time the change
8383
stream catches up to the first chunk migration, the ``documentKey`` in the
8484
change stream notification document only includes the ``_id`` of the document,
8585
not the full shard key.
86+
87+
Indexes and Performance
88+
-----------------------
89+
90+
Change streams cannot use indexes. MongoDB does not support creating
91+
indexes on the :term:`oplog` collection. Therefore, avoid opening a high
92+
number of :ref:`specifically-targeted <changeStreams-watch-deployment>`
93+
change streams as these can impact server performance.
94+
95+
Change Stream Optimization
96+
~~~~~~~~~~~~~~~~~~~~~~~~~~
97+
98+
.. |change-streams| replace:: change streams
99+
100+
.. include:: /includes/change-streams-optimization.rst
101+

source/changeStreams.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ Change streams are available for :doc:`replica sets <replication>` and
5353

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

56-
Watch Collection/Database/Deployment
57-
------------------------------------
56+
.. _changeStreams-watch-deployment:
57+
58+
Watch a Collection, Database, or Deployment
59+
-------------------------------------------
5860

5961
You can open change streams against:
6062

0 commit comments

Comments
 (0)