0

We are having an issue in one of our SQL Azure.

The query plan shows 291269 estimated number of execution with a total of 13 million rows to read. This table has 36892 rows and is the first table that the query is searched for.

enter image description here

The operation must be a simple index lookup in bigint. With the Sentry explorer, I see the histogram, which looks normal and up-to-date. However, the number of executions reduces performance.

enter image description here

Normally, the query runs fine. A long time ago we used DTA to add statistics and we are deleting from time to time. This case is using one of those statistics.

However, with another value, the query runs normally. Estimate 13 rows and it gets 27 rows in runtime.

enter image description here

Same histogram with the same statistics object used.

enter image description here

Then the following plan shows the problem. (In Chrome it shows the run number fine, but loading xml into SQL Management shows the estimate incorrectly).

https://www.brentozar.com/pastetheplan/?id=ryMe27_nu

Good plan

https://www.brentozar.com/pastetheplan/?id=Bk3dGN_hu

I used Sentry explorer to anonymize the plan. I updated statistics and rebuild index in that table.

What can happend to produce this number of executions? What can I try to get more information?

1
  • Please avoid using images for the reasons outlined in this post.
    – Vérace
    Jul 4 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.