Cardinality and Indexes Explained

What is cardinality with respect to an indexed column? Well cardinality is just a measure of how unique the information is in a column. For most index types, unique values are good and repeated values are bad.

For example, with a telephone directory, the more unique a name is the faster you can identify the person you are looking for. A name like “John Smith” is likely to have many entries and thus require verification of unindexed data to resolve the correct entry for your search, whereas “Zaphod Beeblebrox”, would be relative simple to identify.

Thus having a high cardinality or relatively unique column values, is typically a positive thing, in terms of index efficiency anyway.

, ,

  1. #1 by Zaphod Beeblebrox on June 28, 2011 - 6:20 pm

    LOL – No comments – what an awesome blog

  2. #2 by anthony geoghegan on July 4, 2011 - 10:20 am

    Thank’s, I think, Zaph. I have to wonder just how firmly your tongue is in your cheek though.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: