0

我在mysql数据库中有下表:

CREATE TABLE `chronologicallists` (
`sno` int(250) NOT NULL AUTO_INCREMENT,   
`empSno` int(11) NOT NULL,
`dateOfHearing` date DEFAULT NULL,
 `stageOfProceedings` text CHARACTER SET latin1,
 `isDecided` tinyint(1) DEFAULT '0',
`caseSno` int(11) NOT NULL,
`isCurrent` tinyint(1) DEFAULT '1',
`isOut` tinyint(1) DEFAULT '0',
 `isTransferred` tinyint(1) DEFAULT '0',
 `c_position` smallint(2) DEFAULT '1',
 `d_method` smallint(2) NOT NULL DEFAULT '0',
  `reason_for_delay` text CHARACTER SET latin1 NOT NULL,
  PRIMARY KEY (`sno`)
  ) ENGINE=MyISAM AUTO_INCREMENT=274926 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

该表在过去 2 年多的时间里工作得非常好,但从 3 天开始,它就被查询 DML 执行卡住了。执行 3 到 4 个 DML 查询后,执行相同的查询开始花费太多时间?似乎有任何其他进程将自己附加到 mysqld,因此 mysql 执行挂起。

我在 mysql 版本 5.6.14 的 windows 2012 Server -2 64 位上。此表的总大小为:30 MB

请指导我如何提高查询性能?

简单查询示例:

select COUNT(sno) as total from chronologicallists;
4

1 回答 1

0

做一个

OPTIMIZE TABLE chronologicallists

更新索引统计信息并释放未使用的磁盘空间。

于 2014-10-23T18:54:33.233 回答