MySQL-强制不使用缓存来测试查询速度 [英] MySQL - force not to use cache for testing speed of query

查看:652
本文介绍了MySQL-强制不使用缓存来测试查询速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试MySQL中某些查询的速度.数据库正在缓存这些查询,这使我很难在测试这些查询的速度时获得可靠的结果.

I'm testing the speed of some queries in MySQL. The database is caching these queries making it difficult for me to get reliable results when testing how fast these queries are.

是否可以禁用查询缓存?

Is there a way to disable caching for a query?

系统:Linux虚拟主机上的MySQL 4,我可以访问PHPMyAdmin.

System: MySQL 4 on Linux webhosting, I have access to PHPMyAdmin.

谢谢

推荐答案

尝试使用 HERE )

Try using the SQL_NO_CACHE (MySQL 5.7) option in your query. (MySQL 5.6 users click HERE )

例如

SELECT SQL_NO_CACHE * FROM TABLE

这将停止MySQL缓存结果,但是请注意,其他操作系统和磁盘缓存也可能会影响性能.这些都很难解决.

This will stop MySQL caching the results, however be aware that other OS and disk caches may also impact performance. These are harder to get around.

这篇关于MySQL-强制不使用缓存来测试查询速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆