SQL blocks?

  • SQL blocks?

    Posted by Sandra Rudloff on July 3, 2019 at 12:07 pm
    • Sandra Rudloff

      Member

      July 3, 2019 at 12:07 PM

      We’ve discovered that occasionally, but at least weekly, we have users complaining of slowness or locking up, and that we have blocking in the system.Ā 
      Specifically

      the one below.Ā  If we end it, all goes back to normal.Ā  Wondering if anyone else has had this happen, and what have you done to trace it back to the cause?Ā 

      thumbnail image

      ——————————
      Sandra Rudloff
      Vice President Business Systems
      Pivot Interiors, Inc.
      Santa Clara CA
      ——————————

    • Neill Riordan

      Member

      July 4, 2019 at 4:53 AM

      Hello Sandra,

      Ā 

      Currently, Microsoft has published this guidance

      Ā 

      Scenario: Users report slow performance when using the system. One issue could be a blocking statement. Blocking by itself is typical in a healthy system and is only a problem when it becomes excessive or starts degrading business activities.

      1. Go to theĀ Live ViewĀ tab and check if there are any blocking statements. If there is a blocking statement, copy the blocking query ID.
      2. Open theĀ QueriesĀ tab and select theĀ Current Blocking TreeĀ query. This will return the root blocker that is blocking the SQL operation.
      3. To resolve the issue, you can either let it run and clear naturally, or end the process for the lead blocker, which will roll work back. Typically, you should only end the lead blocker process if you think that it will not clear naturally (such as a bad query plan), or in situations where a critical process is unable to run and needs to complete immediately.
      4. Confirm that it’s okay to terminate the statements that are currently being executed.
      5. Open theĀ ActionsĀ tab and select theĀ End SQL ProcessĀ action and pass in the root blocker query ID. This will execute a query against the SQL database to terminate the blocking statement.
      6. Go to theĀ QueriesĀ tab and runĀ Current blocking queryĀ to verify if the blocking statement was terminated.
      7. You can also check theĀ Environment HistoryĀ page to see details on what process was terminated.
      8. To avoid this issue in the future, you should use indexes or plan guides, or turn off lock escalation, or use page locks if processes are blocking each other while operating on different records. If processes are operating on the same records, the only way to avoid blocking is by refactoring or rescheduling the processes to not operate on the same records at the same time.

      Ā 

      That last point is a big “sort your self out statement”.Ā  The reality is it takes some digging and we found the most helpful area now you understood the statement is to go to the performance metrics.Ā  This query should be poorly performing and should show in this area.Ā  If you have any concerns this could be custom code please get your dev team to review the indexes and best practice information around performance.Ā  Outside of that sometimes an execution plan run by Microsoft is not always best so we have before request via support detail of the execution plan being used for the query as we may have to insert our own through lcs to stop the issue.

      Ā 

      We have also found that the indexing routines used by MS sometimes are not robust enough so as part of the above steps make sure you understand the state of the indexes used by the process that is blocking.

      ——————————
      Neill Riordan
      Dynamics 365 Solution Architect
      IBM
      ——————————
      ——————————————-

    • Zvika Rimalt

      Member

      July 4, 2019 at 2:05 PM

      Hi Neil – do you have a link to these guidelines? I want to distribute it to our technical people, so I want them to have the original (and possibly a place to review more guidelines)

      ——————————
      Zvika Rimalt
      Functional Consultant
      Vancouver BC
      ——————————
      ——————————————-

    • Neill Riordan

      Member

      July 4, 2019 at 2:44 PM

      Sure here is the link
      https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/lifecycle-services/monitoring-diagnostics

      You will find the performance link at the bottom of this page

      ——————————
      Neill Riordan
      Dynamics 365 Solution Architect
      IBM
      Watford
      ——————————
      ——————————————-

    • Sandra Rudloff

      Member

      July 5, 2019 at 1:44 PM

      Thanks Neill!Ā  Great info !

      ——————————
      Sandra Rudloff
      Vice President Financial Operations
      Pivot Interiors, Inc.
      Santa Clara CA
      ——————————
      ——————————————-

    Sandra Rudloff replied 6 years, 2 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘SQL blocks?’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!