Database Reference
In-Depth Information
Figure 2-10. Allocation order scan
Figure 2-11. Allocation order scan execution plan
Unfortunately, it is not easy to detect when SQL Server uses an allocation order scan. Even though the Ordered
property in the execution plan shows false , it indicates that SQL Server does not care whether the rows were read in
the order of the index key rather than state that an allocation order scan was used.
An allocation order scan could be faster for scanning large tables, although it has higher startup cost. SQL Server
does not use that access method when the table is small. Another important consideration is data consistency. SQL
Server does not use forwarding pointers in tables with a clustered index, and an allocation order scan can produce
inconsistent results. Rows can be skipped or read multiple times due to the data movement caused by page splits.
As a result, SQL Server usually avoids using allocation order scans unless it reads the data in READ UNCOMMITTED or
SERIALIZABLE transaction isolation levels.
 
Search WWH ::




Custom Search