MySQL Forums
Forum List  »  PHP

Re: Index Cardinality
Posted by: J Jorgenson
Date: January 10, 2007 11:49AM

Index cardinality is *CRITICAL* to index performance/usage by the optimizer.

Cardinality is applied as a RATIO of number of 'distinct' entries for the index against the total number of records in the table.

A high cardinality (closer to # of total records) the more precise the index is and more likely the SQL Optimizer will utilize that index. The lower the cardinality (closer to 0) the less precise the index and less likey to be used by the optimizer.

You want a 1:1 ratio of "Cardinality" TO "# of records" (Ultimately a PRIMARY/UNIQUE Key) to get the best performance of an index.

Options: ReplyQuote

Written By
September 20, 2006 06:17AM
Re: Index Cardinality
January 10, 2007 11:49AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.