Slow Queries? Check the Cardinality of Your MySQL Indexes | Lullabot
The article demonstrates how adding unnecessary indexes can actually harm database performance rather than improve it. The author discovered that the User Relationships module included an index on the `rtid` (relationship type) column despite it having extremely low cardinality—only one distinct value across 219,406 rows—which caused the database optimizer to choose an inefficient query path. By removing the low-cardinality index and restructuring the primary key, the author reduced query execution time from nearly one second to about 8 milliseconds, illustrating that indexes should be designed based on actual data distribution and cardinality, not just guessed at.