mysql存储过程对900w数据进行操作测试
2015-09-11 18:52
756 查看
新增索引:
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
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1;
受影响的行: 1
时间: 118.756s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() and id=1;
受影响的行: 1
时间: 0.042s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1;
受影响的行: 1
时间: 80.775s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() and id=3;
受影响的行: 1
时间: 0.052s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() ORDER BY id limit 0,2
受影响的行: 0
时间: 0.011s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() ORDER BY create_tm limit 0,2
受影响的行: 0
时间: 0.011s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 0,2
受影响的行: 0
时间: 0.978s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 1000
受影响的行: 0
时间: 0.966s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 1000
受影响的行: 0
时间: 1.052s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 0,1000
受影响的行: 0
时间: 1.028s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() and id=6;
受影响的行: 1
时间: 0.066s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1;
受影响的行: 1
时间: 36.632s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 113.335s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 72.046s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 100.126s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 100.126s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 1000
受影响的行: 0
时间: 1.159s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446851336 and id < 446852336 ORDER BY id;
受影响的行: 999
时间: 96.731s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446852336 and id < 446853336 ORDER BY id;
受影响的行: 1
时间: 66.578s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446853336 and id < 446854336 ORDER BY id;
受影响的行: 999
时间: 73.514s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446854336 and id < 446855336 ORDER BY id;
受影响的行: 999
时间: 71.382s
时间: 144.727s
Procedure executed successfully
受影响的行: 0
[SQL]DELETE FROM tl_accrued_bil_dtl where create_tm<NOW() LIMIT 999;
受影响的行: 999
时间: 70.356s
[SQL]DELETE FROM tl_accrued_bil_dtl where create_tm<NOW() LIMIT 999;
受影响的行: 999
时间: 65.939s
多多指教呀,什么
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
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1;
受影响的行: 1
时间: 118.756s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() and id=1;
受影响的行: 1
时间: 0.042s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1;
受影响的行: 1
时间: 80.775s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() and id=3;
受影响的行: 1
时间: 0.052s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() ORDER BY id limit 0,2
受影响的行: 0
时间: 0.011s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() ORDER BY create_tm limit 0,2
受影响的行: 0
时间: 0.011s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 0,2
受影响的行: 0
时间: 0.978s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 1000
受影响的行: 0
时间: 0.966s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 1000
受影响的行: 0
时间: 1.052s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 0,1000
受影响的行: 0
时间: 1.028s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() and id=6;
受影响的行: 1
时间: 0.066s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1;
受影响的行: 1
时间: 36.632s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 113.335s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 72.046s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 100.126s
[SQL]delete from tl_accrued_bil_dtl where create_tm< NOW() limit 1000;
受影响的行: 1000
时间: 100.126s
[SQL]SELECT * FROM tl_accrued_bil_dtl where create_tm< NOW() limit 1000
受影响的行: 0
时间: 1.159s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446851336 and id < 446852336 ORDER BY id;
受影响的行: 999
时间: 96.731s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446852336 and id < 446853336 ORDER BY id;
受影响的行: 1
时间: 66.578s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446853336 and id < 446854336 ORDER BY id;
受影响的行: 999
时间: 73.514s
[SQL]DELETE FROM tl_accrued_bil_dtl where id > 446854336 and id < 446855336 ORDER BY id;
受影响的行: 999
时间: 71.382s
时间: 144.727s
Procedure executed successfully
受影响的行: 0
[SQL]DELETE FROM tl_accrued_bil_dtl where create_tm<NOW() LIMIT 999;
受影响的行: 999
时间: 70.356s
[SQL]DELETE FROM tl_accrued_bil_dtl where create_tm<NOW() LIMIT 999;
受影响的行: 999
时间: 65.939s
多多指教呀,什么
相关文章推荐
- MYSQL 命令
- mysql 存储函数和过程的总结
- MySQL之——数据库双机热备的配置方法
- Mysql字段长度限制你真的了解吗?
- 【MySQL】sync_binlog innodb_flush_log_at_trx_commit 浅析
- mysql学习(4)-mysqldump备份和恢复数据
- mysql备份之xtrabackup
- mysql参数配置调优详解配置(1)
- Mysql事务处理
- mysql参数配置调优详解配置(2)
- mysql file sort
- MySQL 触发器简单实例
- Mysql分库分表方案
- mysql 安装配置的问题
- 解决Mysql导入乱码问题
- MySql中in和exists效率
- 使用innodb_force_recovery解决MySQL崩溃无法重启问题
- Mysql存储过程语法
- 【MySQL】查看MySQL配置文件路径及相关配置
- mac上终端起动MySQL的方法