mysiam和innodb的插入和删除比较

实验环境:

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块

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值