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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Dynamic slow loading for entity with large number of records

(0) ShareShare
ReportReport
Posted on by 238

Hi, we have an on-prem Dynamics CRM server running version 8.2.5.4. We have one entity with about 1.2 million records (1,284,686). The SQL server is 2016 SP2. We are facing some performance issues pertaining this entity (and beyond)

The issue is that it takes about 10 seconds to click into the entity (if using the All Active Records View), and then about 10 seconds to save a record created from this View (and no its not a pending Sync job issue). Records created using Quick Create or from within Advanced Find do not experience this delay.

My question is twofold:

  1. The first obvious question that comes to mind is: If the first page only loads 50 records, then the SQL query should really take less than a millisecond. In fact, if a go directly to SQL and perform on a "Select Top 50" query against this Table or View, it completes in less than a millisecond. The issue however is the "Order By". If i added the "Order By" defined by the Dynamics View to my Table, the query jumped to 5 seconds (including all columns). I then used Profiler to capture the exact SQL query as performed by Dynamics, and sure enough that query took 9 seconds to complete. Dynamics is using the SQL View (not to confuse with the Dynamics View), not the table. I then tested the "Order By" i saw in the Profiler against the View. It took 30 seconds if i specified all columns, and 3 seconds if i specified just one column. If i add a filter to significantly limit the results (where CreatedOn =) , the SQL query completes is milliseconds. So yeah, the probable solution is to default a (Dynamics) View with less results. That said, i have a few questions.
    1. Is it possible to indicate to Dynamics to Not use OrderBy in the query?
    2. Why is the SQL View of the Dynamics CRM DB so much slower than the table?
    3. Are there any other suggestions and recommendations to improve Dynamics performance when dealing with a growing number of records (on a specific entity)?
  2.  When adding a new record from the "All Active Records" View, it takes 10 seconds to Save the record. Sounds like its refreshing the View from which i clicked the New button, which is why when using "Quick Create" or from the "Advanced Find", it Saves in less than a millisecond. Is it possible to change this behavior?

SQL-Profiler-Slow-Query.png

I have the same question (0)
  • JO-30091535-0 Profile Picture
    238 on at
    RE: Dynamic slow loading for entity with large number of records

    Hi Alex, 

    Thanks for your response. Unfortunately, I currently dont have an active support plan for my on-prem CRM. I doubt its an index issue, because i've already reindexed that table. The screenshot below is the current status before a reindex. 

  • alnewber Profile Picture
    on at
    RE: Dynamic slow loading for entity with large number of records

    Hello!

    This slow query performance may be caused by indexing.  To rectify this performance degradation, could you please open a support ticket? Here is a link to how this process is completed: mbs.microsoft.com/.../CRMSupport

    Once a support engineer receives your case and varies the slow performance of the query they can get your organization help with reindexing the query to ensure more optimal performance.  The issue may be as simple as a reindex, but the support engineer will want to ensure there are no other issues .

    Please open a ticket at your leisure and someone will begin assisting you asap!

    Thanks.

    Alexander

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 174

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 121 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans