Originally posted by marist89
When creating a compound index, you should use the field that has the greatest number of unique values as the first column of the index.
I've heard this same line repeated many times. Personally, I think it needs to have the following disclaimer: "All other things being equal" added to it.

Why? Because applicability of the index matters more than selectivity. You may pick field 5 to be the first field in the index because of its selectivity. However, what if you almost never include field 5 in the WHERE clause? You have a more selective index that will never actually be used. You can always fix your selectivity issue using a hint, but you can't force an index if you aren't using the left, leading columns. Just something to think about.

- Chris