新增索引:
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. 安装Visual Studio 2013 出现0x80070643错误

    安装Visual Studio 2013 没一会就出现问题:安装.net framework4.5.1出现严重错误.点击常见问题和解决方案的链接和日志文件,日志里说是0x80070643类型的错误,在 ...

  2. BZOJ 2080: [Poi2010]Railway 双栈排序

    2080: [Poi2010]Railway Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 140  Solved: 35[Submit][Statu ...

  3. Leetcode 221. Maximal Square

    本题用brute force超时.可以用DP,也可以不用. dp[i][j] 代表 以(i,j)为右下角正方形的边长. class Solution(object): def maximalSquar ...

  4. 【BZOJ-2055】80人环游世界 上下界费用流 (无源无汇最小费用最大流)

    2055: 80人环游世界 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 321  Solved: 201[Submit][Status][Discus ...

  5. C#中的斜变性和逆变性的详解

    1,问题 大家可以看到定义泛型类型的可以看到out和in这两个关键字,那么具体代表什么意思呢? 2,文字解释 C# 4.0通过两个关键字:out和in来分别支持以协变和逆变的方式使用泛型. 如果某个返 ...

  6. malware analysis、Sandbox Principles、Design && Implementation

    catalog . 引言 . sandbox introduction . Sandboxie . seccomp(short for secure computing mode): API级沙箱 . ...

  7. 数据结构算法C语言实现(六)---2.4一元多项式的表示及相加

    一.简述 利用链表表示稀疏多项式,并基于之前的一些操作(编程实现上还是有所不同的)组合新的操作实现一元多项式的表示及相加. 二.ADT 抽象数据类型一元多项式的定义 ADT Polyomail{ 数据 ...

  8. CentOS设置防火墙开放端口

    1. iptables是linux下的防火墙,同时也是服务的名称. service iptables status service iptables start service iptables st ...

  9. ffmpeg]ffmpeg使用参数的中文说明

    基本选项: -formats 输出所有可用格式 -f fmt 指定格式(音频或视频格式) -i filename 指定输入文件名,在linux下当然也能指定:0.0(屏幕录制)或摄像头 -y 覆盖已有 ...

  10. ARPSpoofing教程(三) - 捕获数据包

    1: #include"pcap.h" 2: //每次捕获到数据包时,libpcap都会自动调用这个回调函数 3: void packet_handler(u_char *para ...