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: Control Flow vs. Data Flow Demo https://www.sqlskills.com/blogs/joe/control-flow-vs-data-flow-demo/ SQL Server Performance Tuning, High Availability and Disaster Recovery Blog Fri, 14 Jun 2013 09:36:52 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Joseph Sack https://www.sqlskills.com/blogs/joe/control-flow-vs-data-flow-demo/#comment-2652 Fri, 14 Jun 2013 09:36:52 +0000 http://3.209.169.194/blogs/joe/?p=1006#comment-2652 In reply to Gullimeel.

Good stuff Gullimeel – thanks for the comment.

]]>
By: Gullimeel https://www.sqlskills.com/blogs/joe/control-flow-vs-data-flow-demo/#comment-2651 Fri, 14 Jun 2013 09:34:08 +0000 http://3.209.169.194/blogs/joe/?p=1006#comment-2651 read ahead read also impacts the output. Try the same thing on adventureworks2008R2. If traceflag 652 is off then for 30 rows around 484 pages are brought into cache. There are around 480 read ahead reads.For 50 or more rows it brings all the pages into memory. If the trace flag is off then just 11 pages comes into the buffer.

Also off course if no index on the column specified in orderby then It has to read all pages whether topp has specified just 1 row.

I ran below query.

select top 30 * from sales.salesorderheader order by slaesorderid

]]>