High boss ' SQL Server optimizer attribute caused by memory grant related bug ' learning notes

Source: Internet
Author: User
Tags server memory

Today, senior boss has a good article. It was a bit confusing for me to take this opportunity to learn.

Just use the high-boss script. You need to go directly to him to find it, here is saved.

Plus query optimization tag before and after comparison

You can see that grantedmemory is 504928KB, about 213096/1024=208.101562MB (the value here seems to be different every time, but the gap is not too big.) Does not affect the effect)

After you add the trace flag

4560/1024 is probably only 4MB.

The difference is very big ~

In fact, these values may also be seen in the query plan XML, which contains more detailed information.

Such as

<queryplan degreeofparallelism= "1" memorygrant= "216568" cachedplansize= "" Compiletime= "2" CompileCPU= "2" compilememory= "168" >
<memorygrantinfo serialrequiredmemory= "serialdesiredmemory=" 504928 "requiredmemory=" DesiredMemory= " 504928 "requestedmemory=" 216568 "grantwaittime=" 0 " grantedmemory=" 216568 "maxusedmemory="/> "
<optimizerhardwaredependentproperties estimatedavailablememorygrant= "196572" EstimatedPagesCached= "7482" estimatedavailabledegreeofparallelism= "2"/>

Memorygrant This is the evaluation value that begins with the serial* field, as if the evaluation value when this query is serialized (Serial required/desired memory attributes is estimated during Query compile Itme for serial execution).

Highly Recommended articles:

Understanding SQL Server Memory Grant

Troubleshooting SQL Server Resource_semaphore Waittype Memory issuesmemory Grant execution Plan Statistics

To tell the truth, there are a few parameters in it or not very clear the exact meaning. In the actual work how to use, I hope someone can give some guidance.

High boss ' SQL Server optimizer attribute caused by memory grant related bug ' learning notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.