I am trying to learn mySQL database, and have started taking a look at the database behind wordpress. I am using the WordPress Data Base Descrition to review the structure and I came upon the following:
|Table: wp_commentmeta|
---------------------------------------------------------------------------------
|Field |Type |Null |Key |Default | Extra
|-----------|--------------------|------|----|--------|--------------------------
|meta_id |bigint(20) unsigned | |PRI |NULL |auto_increment
|comment_id |bigint(20) unsigned | |IND |0 |FK->wp_comments.comment_id
|meta_key |varchar(255) |YES |IND |NULL |
|meta_value |longtext |YES | |NULL |
|Indexes|
---------------------------------------------------------
|Keyname |Type |Cardinality |Field
|------------|---------|------------|--------------------
|PRIMARY |PRIMARY |0 |meta_ID
|comment_id |INDEX |none |comment_id
|meta_key |INDEX |none |meta_key
My question is, what does a Cardinality value of 0 indicate in the table above. I understand the explanation of cardinality as explained in this SO answer in that it is the number of unique values within a particular set of indexed values, but I dont get what setting a value of 0 does in this particular case.
From Mysql
So, it’s just an estimate of the number of unique values in an index and isn’t necessarily exact. It really just means, you probably have no chance of mysql using an index, probably because you have no data for Mysql to index on.
Taken from that WordPress link:
There is no data in this table on install, so there is nothing for MySql to index upon.