A database's change vector contains entries from each instance of the database
in the database group. However, even when an instance no longer exists (because it was removed or replaced) its entry will remain in the
database change vector. These entries can build up over time, leading to longer change vectors that take up unnecessary space.
UpdateUnusedDatabasesOperation lets you specify the IDs of database instances that no longer exist so that their entries can be
removed from the database change vector.
This operation does not affect any documents' current change vectors, but from now on when documents are modified or created their
change vector will not include the obsolete entries.
public UpdateUnusedDatabasesOperation(string database, HashSet<string> unusedDatabaseIds)
Name of the database
The database IDs to be removed from the change vector
In the 'General Stats' view in the management studio, you can see your database's current change vector (it's
the same as the change vector of the database's most recently updated/created document).
Below we see the change vector of an example database "NorthWind". It includes three entries: one of the
NorthWind instance currently housed on cluster node A (whose ID begins with N79J...), and two of instances that were also previously
housed on node A but which no longer exist.
Database change vector displayed in the General Stats view
This code removes the obsolete entries specified by their database instance IDs: