Re: Index selectivity

From: Tony <andrewst_at_onetel.net.uk>
Date: 8 Mar 2004 12:27:21 -0800
Message-ID: <c0e3f26e.0403081227.51fffae0_at_posting.google.com>


"Cox" <tushar_mahapatra_at_yahoo.com> wrote in message news:<3HZ2c.11709$fD2.3427_at_lakeread02>...
> It is always recommended that index keys must be selective. Does that mean
> that it is good to follow the general rule of always placing the primary key
> at the end of every index?

No: if you had the primary key at the end, it would only make a difference if you included the primary key value in the query. And if you did that, then the primary key index could be used anyway. What it means is that it is not worth indexing at all on columns that have very few distinct values, since it will probably be faster to scan the whole table. Received on Mon Mar 08 2004 - 21:27:21 CET

Original text of this message