web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Poor performing query

(0) ShareShare
ReportReport
Posted on by 19

We have a Dynamics CRM 365 onpremise with some webservices to fetch data for out other applications.

One of the webservices times out and when we trace in SQL what is happening we see that there is one SQL SELECT which reads miliions of rows and takes 88000 milliseconds.

Now, when we take that SQL query and run it separately in SqlServer Management Studio => same query takes 2000 milliseconds !

What can be behind this - it looks like when run from Dynamics CRM it will not use index - how can it work differently ?

I have the same question (0)
  • Gustavo Longo Profile Picture
    Microsoft Employee on at

    Hello Hakkinen,

    Hope you are well.

    If you are using the same query, would say SQL server engine should use the same execution plan to run the query regardless the source.

    Would say to capture SQL Server Execution Plan and identify potential areas to improve indexes or statistics:

    www.mssqltips.com/.../

    Regards,

  • Suggested answer
    Hakkinen Profile Picture
    19 on at

    Actually we found the reason. Technical user, which was running our web-services had wrong setup and it could not access indices. (did not know that that was possible in MSSQL)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 108 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 63

#3
Chris1968 Profile Picture

Chris1968 20

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans