Here is the text showplan (slightly edited for brevity) for this query using a scan:
|–Table Scan(OBJECT:([ORDERS]), WHERE:([ORDERKEY]=(2)))
The following figure illustrates the scan:
Here is the text showplan for the same query using a seek:
|–Index Seek(OBJECT:([ORDERS].[OKEY_IDX]), SEEK:([ORDERKEY]=(2)) ORDERED FORWARD)
have a look on this SQL Server Plans : difference between Index Scan / Index Seek
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…