Query | IndexType |
select top 10000 * from SalesOrder | Clustered Index Scan |
select * from SalesOrder where SalesOrderDetailID>10000 and SalesOrderDetailID<20000 | clustered index seek |
select * from SalesOrder where ProductID=714 and ProductID=715 | constant scan |
select * from SalesOrder where ProductID=714 or ProductID=715 | Clustered Index Scan |
select SalesOrderID,OrderQty,UnitPrice from SalesOrder where ProductID in(714,715) | Clustered Index Scan |
select OrderQty,UnitPrice from SalesOrder where SalesOrderID =43659 | Index Seek |
select OrderQty,UnitPrice from SalesOrder where SalesOrderID >40000 | Index Seek |
select * from SalesOrder where SalesOrderID >40000 | Clustered Index Scan |
select * from SalesOrder where ProductID=714 or ProductID=715 order by SalesOrderID | Clustered Index Scan |
select OrderQty,UnitPrice from SalesOrder where SalesOrderID =43659 order by SalesOrderDetailID | Index Seek |
select OrderQty,UnitPrice from SalesOrder order by SalesOrderDetailID
Clustered Index - SalesOrderDetailID
Non Clustered - SalesOrderID,OrderQty,UnitPrice | Clustered Index Scan |
No comments:
Post a Comment