HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Formula for memory grant for DBCC CHECKDB

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
dbccgrantcheckdbformemoryformula

Problem

How is the memory grant for a DBCC checkdb determined (other than the max size for memory grants which is from resource governor, possibly the default pool)?

I'm not trying to solve a specific problem. I am just curious and trying to understand.

Solution

It's based on the number of expected pieces of information that CHECKDB will generate and then throw through the query processor to sort and then give back to CHECKDB to reconcile. You can get an idea of the calculation involved from my blog post https://www.sqlskills.com/blogs/paul/how-does-dbcc-checkdb-with-estimateonly-work/.

Jonathan also did some investigations into limiting the memory grants with Resource Governor - see https://www.sqlskills.com/blogs/jonathan/dbcc-checkdb-execution-memory-grants-not-quite-what-you-expect/.

Hope those help!

Context

StackExchange Database Administrators Q#315587, answer score: 2

Revisions (0)

No revisions yet.