CRM Email Router performance issues have been noticed after the install of SERVICE PACK 1.
We have noticed a lot of deadlock occuring mainly because of 2 types of queries triggered by EMAIL router.
1. QUERY
update [ActivityPointerBase] set [PostAuthorYomiName]=@PostAuthorYomiName0 where ([PostAuthor] = @PostAuthor0 and [PostAuthorType] = @PostAuthorType0)
This update occures a lot and is trying to update values in ActivityPointerBase.
ActivityPointerBase has approx. 4 mio rows.
The "FUNNY" thing is, that there is no data in PostAuthor and PostAuthorType fields so update never really occurs, but it has to lock the whole table.
2. QUERY
exec sp_executesql N'select
top 5 "email0".Subject as "subject"
, "email0".Description as "description"
, "email0".PriorityCode as "prioritycode"
, "email0".ActivityId as "activityid"
, "email0".ModifiedOn as "modifiedon"
, "email0".StateCode as "statecode"
, "email0".StatusCode as "statuscode"
, "email0".DeliveryAttempts as "deliveryattempts"
, "email0".AttachmentCount as "attachmentcount"
, N'''' as "safedescription"
from
Email as "email0" (NOLOCK) join ActivityParty as "activityparty1" (NOLOCK) on ("email0".ActivityId = "activityparty1".ActivityId and (((("activityparty1".ParticipationTypeMask = @ParticipationTypeMask0 and ("activityparty1".PartyId in (@PartyId0
, @PartyId1
, @PartyId2
, @PartyId3
, @PartyId4)))))))
where
(("email0".StateCode = @StateCode0 and ("email0".StatusCode != @StatusCode0 or "email0".StatusCode is null) and "email0".DirectionCode = @DirectionCode0 and (((((("email0".DeliveryAttempts = @DeliveryAttempts0)))))))) order by
"email0".ActualEnd asc',N'@StateCode0 int,@StatusCode0 int,@DirectionCode0 bit,@DeliveryAttempts0 int,@ParticipationTypeMask0 int,@PartyId0 uniqueidentifier,@PartyId1 uniqueidentifier,@PartyId2 uniqueidentifier,@PartyId3 uniqueidentifier,@PartyId4 uniqueidentifier',@StateCode0=1,@StatusCode0=3,@DirectionCode0=1,@DeliveryAttempts0=0,@ParticipationTypeMask0=1,@PartyId0='4902A80D-D304-DE11-91C3-005056A25867',@PartyId1='75A7A213-D304-DE11-91C3-005056A25867',@PartyId2='91A7A213-D304-DE11-91C3-005056A25867',@PartyId3='98A7A213-D304-DE11-91C3-005056A25867',@PartyId4='9FA7A213-D304-DE11-91C3-005056A25867'
This query also occurs very frequently and is causing about 5mio logical reads per execution.
Is there any way to re-configure the CRM EMAIL router to stop the performance issues and deadlocks or should we create sql indexes that would somewhat remedy this situation?
Please help,
Regards,
Tom