简体   繁体   English

MySQL查询执行时间比较

[英]MySQL Query Execution Time Comparison

i am doing one select qry in my mysql database which contains " order by field desc". 我正在我的mysql数据库中执行一个选择qry,其中包含“ order by field desc”。 I get the resultset within 16 minutes. 我在16分钟内得到了结果集。

Now in the same qry i put "order by field desc limit 5" to get the first 5 records.. But my qry is running for more than 20 minutes. 现在在同一个qry中,我输入“ order by field desc limit 5”来获得前5个记录。但是我的qry运行了20多分钟。

How can i make the execution faster? 我怎样才能更快地执行程序? Any Ideas? 有任何想法吗?

Thanks- jithkaran 谢谢-jithkaran

在选择查询中使用top命令尝试

select top(5) * from table order by field desc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM