mysiam和innodb的插入和删除比较

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

实验环境:

cpu:2GHZ,内存:2GB

本机命令行操作,使用存储过程操作处理18万条数据

deal_domain()里包含删除操作,删除了6万条数据

 

 
  1. mysql> INSERT INTO dns.domain_tmp(begin_ip,end_ip,pool_id,region_id) SELECT distinct c.begin_ip,c.end_ip,t.pool_id,t.region_id FROM dns.tid365 as ti inner join topology as t on ti.tid=t.id inner join cidr as c on t.region_id=c.region_id order by t.weight asc 
  2.  
  3.     -> ;  
  4.  
  5. Query OK, 182789 rows affected (10.19 sec)  
  6.  
  7. Records: 182789 Duplicates: 0 Warnings: 0  
  8.  
  9.  
  10.  
  11. --innodb  
  12.  
  13. mysql> INSERT INTO dns.domain_tmp(begin_ip,end_ip,pool_id,region_id) SELECT distinct c.begin_ip,c.end_ip,t.pool_id,t.region_id FROM dns.tid364 as ti inner join topology as t on ti.tid=t.id inner join cidr as c on t.region_id=c.region_id order by t.weight desc;  
  14.  
  15. Query OK, 182789 rows affected (9.02 sec)  
  16.  
  17. Records: 182789 Duplicates: 0 Warnings: 0  
  18.  
  19.  
  20.  
  21. mysql> call deal_domain();Query OK, 0 rows affected (7.89 sec)  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. --myisam   
  28.  
  29. mysql> INSERT INTO dns.domain_tmp(begin_ip,end_ip,pool_id,region_id) SELECT distinct c.begin_ip,c.end_ip,t.pool_id,t.region_id FROM dns.tid364 as ti inner join topology as t on ti.tid=t.id inner join cidr as c on t.region_id=c.region_id order by t.weight desc;  
  30.  
  31. Query OK, 182789 rows affected (2.71 sec)  
  32.  
  33. Records: 182789 Duplicates: 0 Warnings: 0  
  34.  
  35.  
  36.  
  37. mysql> call deal_domain();  
  38.  
  39. Query OK, 0 rows affected (8.60 sec)  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. --innodb   
  46.  
  47. mysql> INSERT INTO dns.domain_tmp(begin_ip,end_ip,pool_id,region_id) SELECT distinct c.begin_ip,c.end_ip,t.pool_id,t.region_id FROM dns.tid364 as ti inner join topology as t on ti.tid=t.id inner join cidr as c on t.region_id=c.region_id order by t.weight desc;  
  48.  
  49. Query OK, 182789 rows affected (10.46 sec)  
  50.  
  51. Records: 182789 Duplicates: 0 Warnings: 0  
  52.  
  53.  
  54.  
  55. mysql> call deal_domain();Query OK, 0 rows affected (6.70 sec)  

从上面的语句看来myisam的插入要比innodb快很多,但是innodb的删除却比myisam块

 

     本文转自yifangyou 51CTO博客,原文链接:http://blog.51cto.com/yifangyou/607089,如需转载请自行联系原作者

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
10月前
|
存储 索引
清空表时优先使用truncate
清空表时优先使用truncate
|
11月前
|
关系型数据库 MySQL 索引
Mysql中REPLACE INTO用法,判断数据是否存在,如果不存在,则插入,如果存在,则先删除此行数据,然后插入新的数据...
Mysql中REPLACE INTO用法,判断数据是否存在,如果不存在,则插入,如果存在,则先删除此行数据,然后插入新的数据...
173 0
|
关系型数据库 MySQL
MySQL数据的插入、更新、删除
MySQL数据的插入、更新、删除
91 0
|
存储 索引
十、清空表时优先使用truncate
十、清空表时优先使用truncate
85 0
|
存储 关系型数据库 MySQL
MySQL InnoDB的插入缓冲Insert Buffer
MySQL InnoDB的插入缓冲Insert Buffer
133 0
MySQL InnoDB的插入缓冲Insert Buffer
|
关系型数据库 MySQL
Mysql重启后innodb和myisam插入的主键id变化总结
Mysql重启后innodb和myisam插入的主键id变化总结
279 0
Mysql重启后innodb和myisam插入的主键id变化总结
|
存储 SQL 关系型数据库
InnoDB B-TREE 索引怎么定位一条记录
本文以 WHERE 条件能够命中索引为前提,介绍查询操作定位 WHERE 条件扫描区间的第一条记录。
InnoDB B-TREE 索引怎么定位一条记录
|
关系型数据库 MySQL
MySQL防止重复插入相同记录 insert if not exists
MySQL防止重复插入相同记录 insert if not exists
1204 0
|
关系型数据库 MySQL 索引
mysql insert判断记录存不存在 存在即更新不存在即插入 DUPLICATE key update
mysql insert判断记录存不存在 存在即更新不存在即插入 DUPLICATE key update
209 0
插入、更新、删除表中的数据
插入、更新、删除表中的数据 笔记 (文中的姓名、电话等为随机编写的,如有冒犯,请多多包涵) >需求1 向科目表中添加数据,如表1 科目编号 科目名 课时数 年级编号 1 Logic Java 220 1 2 HTML 160 1 3 Java OOP 230 2 第一步,创建科目表subject,create table `subject`(.
1528 0