新增索引:
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存储过程对900w数据进行操作测试的更多相关文章

  1. 原!mysql存储过程 批量导入数据

    mysql需要导入某前缀例如12345为前缀的,后缀扩展2位 即00-99. 利用存储过程插入数据. DROP PROCEDURE IF EXISTS insert_popsms_code;DELIM ...

  2. [MySQL] MySQL存储过程 事务transaction 数据表重建

    直接上代码 -- 删除存储过程 DROP PROCEDURE IF EXISTS `renew_message_queue`; -- 添加; 的转义 DELIMITER ;; CREATE PROCE ...

  3. mysql 存储过程在批处理数据中的应用

    最近批处理数据的时候,突然想到:为什么不使用存储过程进行数据批处理? 为什么要进行批处理? 自答:减少数据库连接次数,提高效率. 存储过程批处理数据的优点:一次编译,永久执行. 这次的批处理逻辑较简单 ...

  4. mysql存储过程批量插入数据

    DROP TABLE IF EXISTS TeachersInfo; CREATE TABLE TeachersInfo ( id INT NOT NULL AUTO_INCREMENT, teach ...

  5. MySQL存储过程循环添加数据

    经常需要测试数据,写个存储过程方便日后使用. DROP PROCEDURE IF EXISTS add_member; DELIMITER $$ CREATE PROCEDURE add_member ...

  6. mysql 使用存储过程批量插数据

    #创建测试表 DROP TABLE IF EXISTS test.test; CREATE TABLE test.test( id int(10) not null auto_increment, a ...

  7. mysql存储过程之游标遍历数据表

    原文:mysql存储过程之游标遍历数据表 今天写一个mysql存储过程,根据自己的需求要遍历一个数据表,因为对存储过程用的不多,语法不甚熟悉,加之存储过程没有调试环境,花了不少时间才慢慢弄好,故留个痕 ...

  8. MYSQL存储过程,清除指前缀的定表名的数据

    MYSQL存储过程,清除指前缀的定表名的数据 DELIMITER $$ DROP PROCEDURE IF EXISTS `drop_table`$$ ),)) BEGIN ) DEFAULT NUL ...

  9. 性能测试四十:Mysql存储过程造数据

    性能测试是基于大量数据的,而进行性能测试之前肯定没那么多数据,所以就要自己准备数据 数据构造方法: 1.业务接口 -- 适合数据表关系复杂 -- 优点:数据完整性比较好2.存储过程 -- 适合表数量少 ...

随机推荐

  1. C++强制类型转换操作符 dynamic_cast

    dynamic_cast是四个强制类型转换操作符中最特殊的一个,它支持运行时识别指针或引用. >>>>>>>>>>>编译器的RTTI设 ...

  2. BZOJ3295 [Cqoi2011]动态逆序对

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000作者博客:http://www.cnblogs.com/ljh2000-jump/转 ...

  3. Genymotion关于【启动后player.exe已停止运行】解决方案总结

    1. 你硬盘空间不足,或是暂存区不够,请少执行一些程序或关掉一些p2p的程序,或是到控制面板卸载一些不必要的程序.最好的建议是定期进行硬盘清理,确保不浪费多余空间 ---以上来源(http://www ...

  4. [NOIP2013] 提高组 洛谷P1969 积木大赛

    题目描述 春春幼儿园举办了一年一度的“积木大赛”.今年比赛的内容是搭建一座宽度为n的大厦,大厦可以看成由n块宽度为1的积木组成,第i块积木的最终高度需要是hi. 在搭建开始之前,没有任何积木(可以看成 ...

  5. UVa 1328 Period

    数据范围较大,故用KMP求循环节 之后由小到大枚举长度范围,若该长度下有循环节就输出答案 还要注意输出格式.之前测试时候连着一串presentation error也是悲伤 #include<b ...

  6. 多线程 thread和Task的用法以及注意事项

    并行 多核线程:Task 首先引用System.Threading; 1:用静态方法:Task.Factory.StartNew()来创建了一个最简单的Task: Task.Factory.Start ...

  7. Axure7.0中文汉化语言包下载 axure汉化包

    Axure RP Pro 7.0 正式版 (兼容 6 版) 简体中文语言包 支持 Axure RP Pro 正式版 当前最新版本 7.0.0.3142 废话不多说,直接给下载地址: Axure7.0中 ...

  8. [COCI2012Final]Pro1

    校内OJ上的题. 数据范围非常小,用暴搜就可以,加点剪枝阶乘级别的复杂度竟然可以跑得比$O(N^4)$的算法还要快QAQ. 我用的是Floyd,参考了别人的代码.大概就是先跑个Floyd把点点之间路径 ...

  9. UVA11624Fire!(BFS)

    题目链接 题意:帮助joe走出一个大火蔓延的迷宫,其中joe每分钟可往上下左右四个方向之一走,所有着火的格子都会蔓延(空格与着火格有公共边,下一分钟这个空格也会着火).迷宫中有一些障碍格,joe和火都 ...

  10. javamail实践

    public static void main(String[] args) throws Exception, Exception { MimeMessage message=new MimeMes ...