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

Notifications

Announcements

No record found.

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
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans