码迷,mamicode.com
首页 > 其他好文 > 详细

how does SELECT TOP works when no order by is specified?

时间:2019-11-02 12:14:38      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:execution   line   layout   tee   ack   scan   break   HERE   iter   

how does SELECT TOP works when no order by is specified?

There is no guarantee which two rows you get. It will just be the first two retrieved from the table scan.

The TOP iterator in the execution plan will stop requesting rows once two have been returned.

Likely for a scan of a heap this will be the first two rows in allocation order but this is not guaranteed. For example SQL Server might use the advanced scanning feature which means that your scan will read pages recently read from another concurrent scan.

 

 

 

 

 

 

how does SELECT TOP works when no order by is specified?

标签:execution   line   layout   tee   ack   scan   break   HERE   iter   

原文地址:https://www.cnblogs.com/chucklu/p/11781089.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!