Service manager Database Meltdown

Игорь Гритченко 1 Reputation point
2020-11-09T09:00:52.817+00:00

Good day!
At different times of the day, we have massive queries in the database such

INSERT INTO #CurrentTxnRelatedEntityChangeLog
    (
        [EntityChangeLogId],
        [EntityId],
        [EntityTypeId],
        [RelatedEntityId],
        [EntityTransactionLogId],
        [LastModified]
    ) 
 SELECT
        ( SELECT MAX(EntityChangeLogId) 
          FROM dbo.[EntityChangeLog] 
          WHERE [EntityId] = TME.[BaseManagedEntityId]
          AND [EntityTypeId] = TME.[ManagedTypeId]
          AND [EntityTransactionLogId] <= @TransactionId
          AND [RelatedEntityId] IS NULL
          AND [ChangeType] <= 2
        ),
        ECL.[EntityId],
        TME.[ManagedTypeId],
        NULL,
        ECL.[EntityTransactionLogId],
        @LastModified 
FROM dbo.[TypedManagedEntity] TME
    JOIN #CurrentTxnEntityChangeLog ECL
        ON ECL.[EntityId] = TME.[BaseManagedEntityId]
    WHERE TME.[IsDeleted] = 0
    AND ECL.[RelatedEntityId] IS NOT NULL
    AND ECL.[EntityId] NOT IN (SELECT [EntityId] FROM #CurrentTxnRelatedEntityChangeLog) 

Workflow at this time are extremely slow. I cannot find this process through SDK. The problem began to appear after the update to 2019 UR2.Have you encountered similar?

Service Manager
Service Manager
A family of System Center products for managing incidents and problems.
210 questions
{count} votes