View Single Post
  #15 (permalink)  
Old 11-03-09, 13:04
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
OK, besides all the fun and games...

Understand 1 thing

Only the 1st column will make the optimizer decide what index to use

So, putting all the columns in an index, lets say from a phonebook table is useless, if the list of columns are phone_num, Last_name, first_name, ect

AND you were looking up by last name

it would NEVER use that index and would scan...it MIGHT scan the index depending on the number of columns in your select vs. the columns in the table, vs. the columns in the index

So you see....we need to know what the barrel of data is, and how you want to go after it

There's some exotic stuff like merry-go-round scans...but don't think about

The Index Intersection thing however might be beneficial

But you can do some reading

Understanding SQL Server Indexing

SQL Server Index Basics

General Tips on Optimizing SQL Server Indexes

SQL Server Indexes: The Basics - SQLTeam.com
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote