MySQL Forums
Forum List  »  InnoDB

Cardinality vs. distinct values
Posted by: Nathan Aschoff
Date: October 09, 2012 06:56AM

Dear all,

Can somebody explain to me the difference between cardinality and distinct(unique) values.

The reason I ask this is after I run an 'analyze table orders;' the 'show indexes from orders;' gives me a cardinality of 18 on my index created on the column order_id. But, when I run a 'select count(distinct order_id) from orders;' I receive a count of 47 distinct values.

I find this odd as I thought cardinality was indeed the count of unique values of a column.

Options: ReplyQuote


Subject
Views
Written By
Posted
Cardinality vs. distinct values
2342
October 09, 2012 06:56AM
888
October 31, 2012 03:07AM


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.