# Tuesday, August 24, 2004
« Customers don't care about requirements | Main | SQL Server Management Studio Auto Recove... »

In order to optimise queries fully in previous versions of SQL Server you might have had to create a covering index by adding all the select and where columns to the index definition. This enabled an index to completely satisfy a query and avoid a bookmark lookup on the underlying table.

In Yukon there is a new keyword on the CREATE INDEX syntax - INCLUDE. This allows you to store additional non-key columns with the index but avoid the cost of them being in the actual non-leaf index structures. So for example:

create index IX_Dates_Date on dbo.Dates(Date)
include (
    Year, Month, Day,
    MonthName, DayOfWeekName, WeekOfYear
)

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, August 24, 2004 1:54:09 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback
Related posts:
Do you have great business intelligence skills?
Integration Services Design Principals
Physical Data Warehouse Design
Analysis Services Essential Reading
When should you do an incremental extract?
Post TechReady and Popfly Invites
Friday, August 27, 2004 2:41:24 PM (GMT Daylight Time, UTC+01:00)
Nice tip - I wasn't aware of this and I'm going to find it very useful.

P.S. I tried to send a gmail invite to your yahoo account but it bounced - maybe I typed it in wrong. Send me an an email to my OdeToCode account and I'll get the link to you again.
Comments are closed.