码迷,mamicode.com
首页 > 数据库 > 详细

mysql存储过程对900w数据进行操作测试

时间:2015-09-11 20:31:18      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:

新增索引:
LTER TABLE `tablename` ADD INDEX `sdhid` (`createTime`) USING BTREE ;
[SQL]ALTER TABLE `tablename` ADD INDEX `sdhid` (`createTime`) USING BTREE ;
受影响的行: 0
时间: 737.600s

[SQL]ALTER TABLE  tablename add INDEX jkjk(createTime) USING BTREE;
受影响的行: 0
时间: 1586.745s 26分钟

[SQL]delete from tablename where createTime< 95 limit 1;
受影响的行: 0
时间: 109.540s

createTime有索引时删除测试:
[SQL]ALTER TABLE  tablename add INDEX jkjk(createTime) USING BTREE;
受影响的行: 0
时间: 1586.745s 26分钟

[SQL]delete from tablename where createTime< 95 limit 1;
受影响的行: 0
时间: 109.540s

[SQL] delete from tablename where createTime< 95 order by createTime,id limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction

[SQL] delete from tablename where createTime< 95 order by createTime,id limit 1;
受影响的行: 0
时间: 185.007s

[SQL]delete from tablename where createTime< 95 order by createTime limit 1;
受影响的行: 0
时间: 169.260s

[SQL]delete from tablename where createTime< 95 limit 1;
受影响的行: 0
时间: 153.959s

createTime无索引时删除测试:
[SQL]delete from tablename where createTime< 95 limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction

[SQL]delete from tablename where createTime< 95 limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction

[SQL] delete from tablename where createTime< 95 order by createTime,id limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction

[SQL]delete from tablename where createTime< 95 limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction

[SQL]delete from tablename where createTime< 95 limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction

[SQL]delete from tablename where createTime< 95 limit 1;
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction


多多指教呀,什么

mysql存储过程对900w数据进行操作测试

标签:

原文地址:http://www.cnblogs.com/langtianya/p/4801871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!