InnoDB和MyISAM引擎的效率比较

1. 这是InnoDB执行时间:
mysql> call p3();
Query OK, 0 rows affected (12 min 2.08 sec)

2. 这是表结构:
Table: t3
Create Table: CREATE TABLE `t3` (
  `id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

3. 这是p3的存储语句
begin
set @i=1;
while @i<10000 do
insert into t3 values(@i);
set @i=@i+1;
end while;

end

1. 这是MyISAM执行时间:

mysql> call p4();
Query OK, 0 rows affected (0.23 sec)

2. 这是表结构:
Table: t4MyISAM
Create Table: CREATE TABLE `t4MyISAM` (
  `id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8

3. 这是p4的存储语句
begin
set @i=1;
while @i<=10000 do
insert into t4MyISAM values(@i);
set @i=@i+1;
end while;
end

为什么InnoDB执行存储过程能这么慢呢???

你可能感兴趣的:(InnoDB和MyISAM引擎的效率比较)