简体   繁体   English

mysql在innodb和myisam之间的更新时间

[英]mysql update time between innodb and myisam

I did a test on a table (with innodb and myisam), which use PHP to simulate 2 set of update, as follow 我对一个表(使用了innodb和myisam)进行了测试,该表使用PHP模拟了两组更新,如下所示

set 1. // execute 1000 times for ($i = 0; $i < 1000; $i++) { update with pdo } 设置1。//为($ i = 0; $ i <1000; $ i ++)执行1000次{用pdo更新}

set 2. // execute 1 time { update with pdo } 设置2。//执行1次{用pdo更新}

normally, each update take ~0.001x sec with myisam and ~0.03x sec with innodb, so not surprise for set 1 use 1000 more times then set 2, however, during testing set 1, I open set 2 at another browser windows, what I expect is the result will return within the total time of set 1, but it seems it wait for set 1 finish, rather then insert into the queue during set 1 running. 通常,每次更新使用myisam花费约0.001x秒,使用innodb花费约0.03x秒,因此对于set 1使用set 1,要多花1000次,这并不奇怪,但是,在测试set 1的过程中,我在另一个浏览器窗口中打开set 2我期望结果将在集合1的总时间内返回,但似乎它等待集合1的完成,而不是在集合1运行期间插入队列。

Am I did something wrong or my concept is wrong? 我做错了什么还是我的概念错了? And is the update time slow?(my pc config is AMD Athlon 64 4200+, 2G RAM, Windows 7, MySQL 5.5.9, nginx 0.8.5, PHP 5.3.5) 更新时间是否很慢?(我的电脑配置是AMD Athlon 64 4200 +,2G RAM,Windows 7,MySQL 5.5.9,nginx 0.8.5,PHP 5.3.5)

thanks a lot~! 非常感谢〜!

For MyISAM tables, concurrent inserts are an issue. 对于MyISAM表,并发插入是一个问题。 See 看到

http://dev.mysql.com/doc/refman/5.1/en/concurrent-inserts.html http://dev.mysql.com/doc/refman/5.1/en/concurrent-inserts.html

If you are inserting to an InnoDB table with an auto_increment column, there's a discussion of locking issues here: 如果您要插入带有auto_increment列的InnoDB表,那么这里将讨论锁定问题:

http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM