Closed erikdarlingdata closed 4 months ago
@erikdarlingdata I agree it should be consistent, but believe we should be looking at this in the other direction. I think we should be counting memory in kilobytes not pages. My reasoning for this is people think of memory in the term’s kilobyte, megabyte, and gigabyte. We purchase memory this way. Windows, and SQL memory usage and configurations are measured the same. So why are we measuring a query’s memory usage in pages?
Yeah, it would save them having to convert it from pages back to another unit that makes more sense for most observations of query memory grants.
Looking at the new columns for
@get_memory_info
, they seem to account for memory grants a big strangely. There may be a good reason for this that I can't find reference to.For a particular query, the columns return these values:
But the XML column returns values that look like this:
They're different because all of the memory columns divide values by 8:
'x.max_used_memory_kb / 8 '
Is this the correct way to account for query memory grants?There's also a minor documentation issue here. All of the other notes about this column say
(Requires @get_memory_info = 1)
.