<分区>
Possible Duplicate:
How can “set timestamp” be a slow query?
我正在使用 PHP 和 MySQL 5.1 运行 Web 应用程序和 Wordpress 博客,驻留在 VPS 服务器上。慢速查询日志显示了很多不需要很长时间即可完成的条目。奇怪的是,当我点击我的博客链接时,最初加载通常需要很长时间,但之后就很快了。然后在几个小时后它又回到了缓慢的第一次点击。似乎几乎所有慢条目中都存在“SET timestamp=”查询。这是它的外观示例:
# Time: 110129 4:02:06 # User@Host: appsadmin[appsadmin] @ localhost [] # Query_time: 1.367264 Lock_time: 0.000043 Rows_sent: 18 Rows_examined: 18 use apps; SET timestamp=1296291726; show tables; # Time: 110129 4:02:07 # User@Host: wp_user[wp_user] @ localhost [] # Query_time: 0.635450 Lock_time: 0.000041 Rows_sent: 11 Rows_examined: 11 use wordpress_user; SET timestamp=1296291727; show tables; # Time: 110130 4:02:03 # User@Host: appsadmin[appsadmin] @ localhost [] # Query_time: 0.592159 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 use apps; SET timestamp=1296378123; SELECT /*!40001 SQL_NO_CACHE */ * FROM `mail_queue`; # Time: 110131 4:02:08 # User@Host: appsadmin[appsadmin] @ localhost [] # Query_time: 2.789990 Lock_time: 0.000047 Rows_sent: 18 Rows_examined: 18 SET timestamp=1296464528; show tables; # Time: 110131 4:02:09 # User@Host: wp_user[wp_user] @ localhost [] # Query_time: 0.535981 Lock_time: 0.000041 Rows_sent: 11 Rows_examined: 11 use wordpress_user; SET timestamp=1296464529; show tables; # Time: 110201 3:19:03 # User@Host: wp_user[wp_user] @ localhost [] # Query_time: 1.401393 Lock_time: 0.000071 Rows_sent: 120 Rows_examined: 145 SET timestamp=1296548343; SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
这表明这不是我的数据库设计问题,而是某种配置问题。