Closed
Description
Cardinality is counted based on statistics stored as integers, so the value is not necessarily exact even for small tables. The higher the cardinality, the greater the chance that MySQL uses the index when doing joins.
- https://www.percona.com/blog/2007/08/28/do-you-always-need-index-on-where-column/
- https://mariadb.com/kb/en/library/information-schema-statistics-table/
- https://dev.mysql.com/doc/refman/5.7/en/statistics-table.html
Set the threshold of cardinality so that a single value covers at most 20% of table rows:
And finally for case with 20% rows with
has_someting=0
.https://www.percona.com/blog/2007/08/28/do-you-always-need-index-on-where-column/
New report - low_cardinality_index