Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL table indexing
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

39 Posts

Posted - 12/01/2013 :  15:54:39  Show Profile  Reply with Quote
I have created a SS warehouse, so perfect normalization is not a requirement. I have created non unique indexes of 5-7 columns
My question is:
for these 5-7 fields, should I create one index of 5-7 fields,
or 5-7 individual indexes?

thanks in advance. . .

MS Access 20 years, SQL hack

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 12/02/2013 :  04:35:26  Show Profile  Reply with Quote
depends on how you use these columns in the queries. whats the frequency of using them together for filtering.selecting against using them separately?

SQL Server MVP
Go to Top of Page

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 12/02/2013 :  16:21:58  Show Profile  Reply with Quote
The thing to know for deciding on indexes is when the index will not be used. For instance:

index1234 (col1, col2, col3, col4)

this index will be used when filter and/or joining is done with:
- all four columns
- only these 3: col1, col2, col3
- only these 2: col1, col2
- only this: col1

this index will not be for any other combination of columns.
In other words look at the index columns from left to right.
To use an index for a query that only filters on col3 then you need an index that either is only on col3 or starts with col3

Be One with the Optimizer
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000