1

When show index in a table, there are two parts Collation and Cardinality which I don't understand what there usage is. Anyone could briefly explain?

Bruce Lin
  • 2,700
  • 6
  • 28
  • 38
  • dup of [What is cardinality in MySQL? PLease explain simple non technical language](http://stackoverflow.com/q/2566211/), [What is collation method?](http://stackoverflow.com/q/1654077/). See also [Difference between Encoding and collation?](http://stackoverflow.com/q/7723648/) – outis Jul 19 '12 at 00:29

1 Answers1

4

Collation is the way sorting takes place, based on the character set you specify. See https://dev.mysql.com/doc/refman/5.5/en/charset-charsets.html

Cardinality is basically "How many unique elements does this column contain." A table with low cardinality has few unique values. Lookup tables generally have much lower cardinality than tables of a particular entity such as Customers.

http://en.wikipedia.org/wiki/Cardinality_%28SQL_statements%29

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501