Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

1019


Chapter 45: Indexing Strategies


45


FIGURE 45-7
The clustered index seek’s predicate has a start and an end, which indicates the range of
rows searched for using the B-tree index.

To further investigate the range seek query path, this next query pushes the range to the
limit by selecting every row in the table. And both queries are tested just to prove that
between is logically the same as >= with <=:

SELECT *
FROM Production.WorkOrder
WHERE WorkOrderID >= 1 and WorkOrderID <= 72591;

SELECT *
FROM Production.WorkOrder
WHERE WorkOrderID between 1 and 72591;

c45.indd 1019c45.indd 1019 7/31/2012 10:16:40 AM7/31/2012 10:16:40 AM


http://www.it-ebooks.info
Free download pdf