Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2002-11-07 : 14:48:39
|
| I have a question about indexing. I have a composite index (2 columns in this one) whose density is 11% (based upon the first column in the index). If I switch the order of the columns, the density becomes less than 1%. Should I switch the order of the columns? My answer is yes, but I'm confused because the Index Tuning Wizard is the one that suggested this index. Of course, the wizard is only as good as the workload you provide it, but should I second guess the wizard when the density is greater than 5%? |
|
|
VyasKN
SQL Server MVP & SQLTeam MVY
313 Posts |
Posted - 2002-11-07 : 16:41:18
|
| Without paying much attention to densities, the first column in a composite index, should be the one that is mostly queried directly in the WHERE and JOINs. The other columns are to cover your queries. If the first column in the index are not beneficial to your queries, then you'll see index scans (slower), instead of index seeks.--HTH,Vyashttp://vyaskn.tripod.com |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2002-11-07 : 16:52:54
|
| Well I agree, but the optimizer will ignore an index if the density is higher than about 5-10%. At least that's what I have read so far. |
 |
|
|
|
|
|