MySql性能医生:有人可以为我翻译这个值吗?

时间:2011-02-15 20:07:58

标签: mysql query-optimization

Slow_queries 11
Select_full_join 13 k
Handler_read_next 203 k
Handler_read_rnd_next 5,174 M
Created_tmp_disk_tables 53 k
Opened_tables 59 k

这是我在我的mysql状态中找到的RED标记值...我是一个自学成才的开发人员所以我不确定如何修复它或者我的那些值真的很高或者是什么......描述在phpmyadmin中给出并不总是让我清楚......

注意:我的网站仍处于暂存状态,除了我的测试之外没有网络流量

感谢

1 个答案:

答案 0 :(得分:1)

您需要优化MySQL查询。要查找慢查询,您需要记录慢查询。你可以从mysql配置文件启用my.cnf

提示:使用explain让您了解MySQL对您的查询做了什么。

以下是phpmyadmin状态中上述值的含义:

Slow_queries 11 : "The number of queries that have taken more than long_query_time seconds"

Select_full_join : "The number of joins that do not use indexes. If this value is not 0, you should carefully check the indexes of your tables.

Handler_read_next "The number of requests to read the next row in key order. This is incremented if you are querying an index column with a range constraint or if you are doing an index scan. "

Handler_read_rnd_next : "The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have. "

Created_tmp_disk_tables : "The number of temporary tables on disk created automatically by the server while executing statements. If Created_tmp_disk_tables is big, you may want to increase the tmp_table_size value to cause temporary tables to be memory-based instead of disk-based. "

Opened_tables : "The number of tables that have been opened. If opened tables is big, your table cache value is probably too small. "