Warning: Constant WP_TEMP_DIR already defined in /var/www/html/blogs/joe/wp-config.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/feed-rss2-comments.php on line 8
Comments on: Row and Page Count Influence on Sort Memory Grants https://www.sqlskills.com/blogs/joe/row-and-page-count-influence-on-memory-grants/ SQL Server Performance Tuning, High Availability and Disaster Recovery Blog Thu, 07 Feb 2013 13:13:23 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Joseph Sack https://www.sqlskills.com/blogs/joe/row-and-page-count-influence-on-memory-grants/#comment-1135 Fri, 25 Jan 2013 20:08:21 +0000 http://3.209.169.194/blogs/joe/?p=831#comment-1135 In reply to John V.

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!

]]>
By: John V https://www.sqlskills.com/blogs/joe/row-and-page-count-influence-on-memory-grants/#comment-1134 Fri, 25 Jan 2013 19:24:58 +0000 http://3.209.169.194/blogs/joe/?p=831#comment-1134 In reply to John V.

OH! An these last two posts were very interesting! Thanks! =)

]]>
By: John V https://www.sqlskills.com/blogs/joe/row-and-page-count-influence-on-memory-grants/#comment-1133 Fri, 25 Jan 2013 19:22:25 +0000 http://3.209.169.194/blogs/joe/?p=831#comment-1133 This seems backwards to me. It would seem to me that rows shouldn’t matter, only pages. I have this argument with developers when they say “oh no! it’s going to be 70 million rows”, but then I point out that it’s only 3 or 4 INT columns, that’s not really that big. The inverse is true. If a table is ‘only’ 10000 rows, but the row size is very large, that’s actually a big table.

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.

]]>