Indexing

-----------------------------------------------------------
-- Total Training for SQL Server 2005
--
-- Part 3 - Developing Solutions
-- Lesson 4 - Indexing for Performance
--
-- Paul Nielsen
-----------------------------------------------------------

-----------------------------------------------------------
-- Examining Query Execution Plans

USE AdventureWorks

-- 1 Clustered Index Seek
SELECT *
FROM Production.TransactionHistory
WHERE TransactionID = 100777

-- 2 Bookmark Lookup
SELECT *
FROM Production.TransactionHistory
WHERE ReferenceOrderID = 55555

-- 3 Covering Index
SELECT TransactionID, ProductID, TransactionDate
FROM Production.TransactionHistory
WHERE ProductID = 319
AND Quantity >10 -- non SARG, uses Filter

Read Users' Comments (0)

0 Response to "Indexing"

Post a Comment