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 15

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 ?

  • Suggested answer
    Hakkinen Profile Picture
    15 on at
    RE: Poor performing query

    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)

  • Gustavo Longo Profile Picture
    on at
    RE: Poor performing query

    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,

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,000 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans