近日,关于数据库性能优化的讨论持续升温。在《数据库架构100讲》系列课程中,关于 MySQL 索引的深入探讨引发了广泛关注。其中,关于强制类型转换可能导致死锁的案例,引出了一个更值得关注的话题:哪些情况下,看似使用了索引,实际却无法有效提升查询效率,甚至引发全表扫描?本文将深入剖析两种常见的、容易被忽视的 MySQL 索引失效场景,帮助读者更好地理解数据库索引的工作机制,从而优化查询性能。
In May of 2025, MySQL celebrated its 30th anniversary. Not many technology projects go strong for three decades, let alone at the level of use that MySQL enjoys. MySQL is listed at #2 on the ...