mysql存储过程对900w数据进行操作测试
新增索引:
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数据进行操作测试的更多相关文章
- 原!mysql存储过程 批量导入数据
mysql需要导入某前缀例如12345为前缀的,后缀扩展2位 即00-99. 利用存储过程插入数据. DROP PROCEDURE IF EXISTS insert_popsms_code;DELIM ...
- [MySQL] MySQL存储过程 事务transaction 数据表重建
直接上代码 -- 删除存储过程 DROP PROCEDURE IF EXISTS `renew_message_queue`; -- 添加; 的转义 DELIMITER ;; CREATE PROCE ...
- mysql 存储过程在批处理数据中的应用
最近批处理数据的时候,突然想到:为什么不使用存储过程进行数据批处理? 为什么要进行批处理? 自答:减少数据库连接次数,提高效率. 存储过程批处理数据的优点:一次编译,永久执行. 这次的批处理逻辑较简单 ...
- mysql存储过程批量插入数据
DROP TABLE IF EXISTS TeachersInfo; CREATE TABLE TeachersInfo ( id INT NOT NULL AUTO_INCREMENT, teach ...
- MySQL存储过程循环添加数据
经常需要测试数据,写个存储过程方便日后使用. DROP PROCEDURE IF EXISTS add_member; DELIMITER $$ CREATE PROCEDURE add_member ...
- mysql 使用存储过程批量插数据
#创建测试表 DROP TABLE IF EXISTS test.test; CREATE TABLE test.test( id int(10) not null auto_increment, a ...
- mysql存储过程之游标遍历数据表
原文:mysql存储过程之游标遍历数据表 今天写一个mysql存储过程,根据自己的需求要遍历一个数据表,因为对存储过程用的不多,语法不甚熟悉,加之存储过程没有调试环境,花了不少时间才慢慢弄好,故留个痕 ...
- MYSQL存储过程,清除指前缀的定表名的数据
MYSQL存储过程,清除指前缀的定表名的数据 DELIMITER $$ DROP PROCEDURE IF EXISTS `drop_table`$$ ),)) BEGIN ) DEFAULT NUL ...
- 性能测试四十:Mysql存储过程造数据
性能测试是基于大量数据的,而进行性能测试之前肯定没那么多数据,所以就要自己准备数据 数据构造方法: 1.业务接口 -- 适合数据表关系复杂 -- 优点:数据完整性比较好2.存储过程 -- 适合表数量少 ...
随机推荐
- 欢迎加入.Net高级部落 173844862
本群成立至今3年多,聚集了好多大牛级别的人物,欢迎高手前来指教,也欢迎小菜鸟进来学习.群成员热情开朗,有问必答.在这里聊聊技术,谈谈理想,不光技术会得到提高,也会收获一大帮志同道合的朋友,希望在未来的 ...
- 如何使用maven建一个web3.0的项目
使用eclipse手动建一个maven的web project可能会有版本不合适的情况,例如使用spring的websocket需要web3.0什么的,不全面的修改可能会出现各种红叉,甚是苦恼.我从我 ...
- Leetcode 375. Guess Number Higher or Lower II
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues ...
- ResourceManager没启动
终端看着没问题,然后进入hadoop的logs文件夹下找打yarn-hxsyl-resoucemanager.log,发现里面报错了,是因为fairscheduler需要放在etc/hadoop下,我 ...
- 帝国cms一些常用的修改路径
1.信息提示改成弹出框提示 修改e/message/index.php 2.修改提示信息 语言包e/data/language/gb/pub/q_message.php 3.文章设置权限后没登录提示模 ...
- 【原】js获取height为auto的高度问题
今天用react写一个页面,需要获取一个img高度设置为auto的高度,可是一直获取到的要么是0,要么是null,因为页面加载完了图片不一定加载完. 当我把高度由 auto 设置为固定值之后,又可以获 ...
- Extjs GridPanel用法详解
Extjs GridPanel 提供了非常强大数据表格功能,在GridPanel可以展示数据列表,可以对数据列表进行选择.编辑等.在之前的Extjs MVC开发模式详解中,我们已经使用到了GridPa ...
- JDK的安装和配置
JDK8 是JDK的最新版本,加入了很多新特性,如果我们要使用,需要下载安装: JDK8在windows xp下安装有点问题,所以在WIN7下安装 WIN7操作系统有32位和64位,分别要下载对应的J ...
- Java排序算法——选择排序
import java.util.Arrays; //================================================= // File Name : Select_S ...
- activity栈的关系
android:intent flags 一.Activity和Task(栈)的关系 Task就像一个容器,而Activity就相当与填充这个容器的东西,第一个东西(Activity)则会处于最下面, ...