你需要優化你的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. "