Percona Database Performance Blog Percona Database Performance Blog -

Why SELECT COUNT(*) FROM TABLE Is Sometimes Very Slow in MySQL or MariaDB

If you have enough experience with MySQL, it is very possible that you stumbled upon an unusually slow SELECT COUNT(*) FROM TABLE; query execution, at least occasionally.Recently, I had a chance to investigate some of these cases closer, and it stunned me what huge differences there can be depending on the circumstance given the very […]

本文讨论了MySQL中SELECT COUNT(*) FROM TABLE查询速度慢的原因,包括明显和不明显的因素。明显的原因有表大小、存储引擎和并发工作负载,不明显的原因有MySQL变体和版本、事务上下文和表碎片化。文章还提到了MySQL和MariaDB版本之间的差异以及不同事务上下文中查询速度的差异。此外,还讨论了MySQL 8.0中并行读取线程和数据文件创建方式对查询结果的影响。总的来说,事务上下文对查询速度有重要影响,需要仔细考虑。

MySQL mariadb 事务上下文 存储引擎 查询速度 表碎片化

相关推荐 去reddit讨论