MySQL insert with autoincrement - is insert ignore neccessary to avoid concurrency issue? -


i using simple insert statement in mysql innodb, auto-increment in primary id. need worry if user , user b execute same script @ same moment, user a's insertion overwritten user b's?

no, not. can treat thread safe.

from reference:

when accessing auto-increment counter, innodb uses special table-level auto-inc lock keeps end of current sql statement, not end of transaction

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


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -