开发者

Is forking possible w/ InnoDB & unique records?

I am considering moving my MyISAM table to InnoDB. I have a lot of tables w/ columns set to unique values and I use perl. If I switch to InnoDB (and thus take advantage of row开发者_开发技巧-level locking rather than table-level locking) and use forking, will I encounter problems with duplicate entries? (ie, since I will be inserting many rows simultaneously into the table)


As long as you have UNIQUE indexes in place, no rows violating these constraints will be allowed.

You might however run into some concurrency issues when doing inserts within transactions. If two duplicating rows are inserted in two different, concurrent transactions, one of them will fail to commit.


Uniqueness can be achieved by creating unique indexes. In this case DB engine takes care of it. Also, a proper use of transactions helps you to avoid concurrency issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜