From 534fb298b55a6afb2cb8c075a97ccaa048b3b588 Mon Sep 17 00:00:00 2001 From: Jeff Allen Date: Wed, 13 Oct 2021 15:13:21 -0400 Subject: [PATCH] (DOCSP-18813): Note that change streams cannot leverage indexes --- ...change-streams-production-recommendations.txt | 16 ++++++++++++++++ source/changeStreams.txt | 6 ++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/source/administration/change-streams-production-recommendations.txt b/source/administration/change-streams-production-recommendations.txt index 161533444e7..f670997f713 100644 --- a/source/administration/change-streams-production-recommendations.txt +++ b/source/administration/change-streams-production-recommendations.txt @@ -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 ` +change streams as these can impact server performance. + +Change Stream Optimization +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. |change-streams| replace:: change streams + +.. include:: /includes/change-streams-optimization.rst + diff --git a/source/changeStreams.txt b/source/changeStreams.txt index a89c048c9cd..ff069505a86 100644 --- a/source/changeStreams.txt +++ b/source/changeStreams.txt @@ -53,8 +53,10 @@ Change streams are available for :doc:`replica sets ` 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: