Clustered Index Scan and Clustered Index Seek

tolywang發表於2009-05-12

Clustered Index Scan and Clustered Index Seek for Clustered Index :  

   Index Seek means that SQL Server  will traverse the index  from the root down to the leaf level, comparing
the values in the SARG to the key values in the index rows to determine which page to look at next.  Seeking 
through an index typically means a root-to-leaf traversal.  

      Index scan,  the alternative to Index Seek, means that SQL Server will stay at the leaf level and traverse just that
one level of the index from the first page to the last. I like to think of a seek as a vertical traversal of an
index and a scan as a horizontal  traversal.    Remember that for a clustered index, the leaf level of the index is
the table data itself, so scanning the clustered index really means scanning  the table.  In fact, the only time you'll
see Table Scan as an operator in the plan is for heaps.

Clustered Index Scan  相當於全表掃描

Clustered Index Seek  相當於索引掃描

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-600856/,如需轉載,請註明出處,否則將追究法律責任。

相關文章