索引添加后数据库仍然很慢

时间:2014-10-31 22:35:27

标签: mysql

我有一个拥有200万行的mysql数据库。当使用order by firstname firstname不是索引时,数据库非常慢。

我添加了firstname的索引,我认为它会加快!没有运气。

还有什么我想念的吗?

解释延伸:

1 SIMPLE医生所有1244888 100.00使用filesort

1 个答案:

答案 0 :(得分:0)

MySQL做一些叫做延迟查找的东西,解决它的方法是在子查询中包装顺序。您可以在http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/

上阅读详细信息