Hi John,
Glad you found these posts interesting! 🙂
Regarding only pages mattering being a preferred option… One thought is that the memory grant considers row counts and row size (I didn’t raise the discussion of row size in this post – but it is certainly relevant to the point you raise). So the number of pages may be less helpful in that context compared to just needing to know what will be needed for the memory grant based on estimated rows and their associated size. Not defending the model though – just thinking about why it may be the way it is today.
Thanks!
]]>OH! An these last two posts were very interesting! Thanks! =)
]]>It seems to me if you had 10000 rows in a table, it could be 10 data pages or it could be 10000 data pages (assuming one row per page,ick). It’s really the row size or number of pages that should determine memory usage I’d think.
I wonder why doesn’t the optimizer see the actual (average or estimated) data size (row size) vs. the row count.
]]>