Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM Query execution time exceeded the threshold

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Experts,

We are seeing 'Query execution time exceeded the threshold' warning getting logged into CRM application server log contentiously (mostly during Bulk insert).

Please guide for troubleshooting. 

e.g. Application Log entries 

Query execution time of 30.0 seconds exceeded the threshold of 10 seconds. Thread: 48; Database: ABC_CRM_MSCRM; Server:abc123; Query: sp_getapplock.



Query execution time of 10.2 seconds exceeded the threshold of 10 seconds. Thread: 121; Database: ABC_CRM_MSCRM; Server:ABC123; Query: WITH "emp_ticketline0Security" as ( 
select emp_Reviewed as "emp_Reviewed", emp_ReasonCodeId as "emp_ReasonCodeId", emp_ticketlineId as "emp_ticketlineId", emp_ReasonCodeIdName as "emp_ReasonCodeIdName", emp_OrderId as "emp_OrderId", OwningBusinessUnit as "OwningBusinessUnit" from [emp_ticketline] as "emp_ticketline0" where "emp_ticketline0".emp_ticketlineId in (select ObjectId from fn_POARetrieveMultiple('0ce87c7e-1f01-e611-9403-00155dd91408', 10081,0)) 
UNION 
select emp_Reviewed as "emp_Reviewed", emp_ReasonCodeId as "emp_ReasonCodeId", emp_ticketlineId as "emp_ticketlineId", emp_ReasonCodeIdName as "emp_ReasonCodeIdName", emp_OrderId as "emp_OrderId", OwningBusinessUnit as "OwningBusinessUnit" from [emp_ticketline] as "emp_ticketline0" where "emp_ticketline0".OwningBusinessUnit in ('df5178ff-7500-e611-9405-00155d684a41') 

) 
select 
top 5001 "emp_ticketline0".emp_Reviewed as "emp_reviewed" 
, "emp_ticketline0".emp_ReasonCodeId as "emp_reasoncodeid" 
, "emp_ticketline0".emp_ticketlineId as "emp_ticketlineid" 
, "emp_ticketline0".emp_ReasonCodeIdName as "emp_reasoncodeidname" 
from
emp_ticketline0Security as "emp_ticketline0" 
where
(("emp_ticketline0".emp_OrderId = 'b2bf5b31-eb4d-e711-940d-00155de02db9')) order by
"emp_ticketline0".emp_ticketlineId asc.



Query execution time of 12.9 seconds exceeded the threshold of 10 seconds. Thread: 44; Database: MSCRM_CONFIG; Server:abc123; Query: exec p_SetLastAccessTime '24123fc6-c372-e511-93f8-00155d684a41', '04e87c7e-1f01-e611-9403-00155dd91408', '06/13/2017 21:05:49', 'abc456.com'.


*This post is locked for comments

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,477 on at
    RE: CRM Query execution time exceeded the threshold

    Hi,

      that's kind of a "normal" problem which happens everywhere (not all the time, but often enough).

      You can try to add indexes to the database to optimize those particular queries.. It could be a problem with the server resources as well.. Basically, CRM is telling you that some queries are taking longer than 10 seconds, and that's just about it. It's not, necessarily, a problem.

      Either way, you might want to have a look at this thread:

    https://community.dynamics.com/crm/f/117/t/64580

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans