Mysql慢查询,Lock_time和Rows_examined为0

时间:2017-02-24 11:37:44

标签: mysql mysql-slow-query-log

表格结构:

CREATE TABLE `table` (
  `ID` char(36) NOT NULL,
  `Value` varchar(21000) DEFAULT NULL,
  `Content` mediumblob,
  `CRDateTime` datetime NOT NULL,
  `Status` int(11) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID_UNIQUE` (`ID`),
  KEY `Time_INDEX` (`CRDateTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

值为100 strs,Content字段为空,表有60000行

另一张表:

CREATE TABLE `table2` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID_UNIQUE` (`ID`),
  UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

表有0行,它是一个空表,没有删除和更新\插入操作,只有选择

日志中的一些慢查询:

Id:14568

Query_time:10.935600 Lock_time:0.000000 Rows_sent:0 Rows_examined:0

SET timestamp = 1484230695; SELECT * FROM table  WHERE(ID ='aaaaaaaa')LIMIT 2;

Query_time:11.700000 Lock_time:0.000000 Rows_sent:1 Rows_examined:1

SET timestamp = 1486821357; 选择 GroupBy1A1 AS C1 FROM(选择 COUNT(1)AS A1 来自table2 AS Extent1  WHERE(Extent1name ='24977496')AND('24977496'IS NOT NULL))AS GroupBy1;

windows server 2008 r2 mysql 5.6.19

在高峰时,所有表查询都有此问题

0 个答案:

没有答案