Performance degradation when actively using clones


Description

Active usage of the Sitecore Cloning functionality might lead to performance degradation when multiple content authors use the Content Editor at the same time.

The issue can be caused by a high volume of latches in the Notifications table of the SQL Server, and can be identified using the SQL Server Performance Monitor application and reviewing the value of the Latches object. For more information about Latching in SQL server, review the following article:
https://learn.microsoft.com/en-us/sql/relational-databases/diagnose-resolve-latch-contention?view=sql-server-ver16

Solution

Create a non-clustered index in the Notifications table of the master database:

CREATE NONCLUSTERED INDEX [Notifications_Multi_idx] ON [dbo].[Notifications] 
([ItemId], [Processed], [Language], [Version], [InstanceType]) INCLUDE ([Id], [InstanceData], [Created])

Note: In some cases introducing the aforementioned index can impact the performance of item editing operations. If such an impact is noticed, the suggested changes have to be reverted.