Buy Percona ServicesBuy Now!

InnoDB’s gap locks

 | March 27, 2012 |  Posted In: MySQL

One of the most important features of InnoDB is the row level locking. This feature provides better concurrency under heavy write load but needs additional precautions to avoid phantom reads and to get a consistent Statement based replication. To accomplish that, row level locking databases also acquire gap locks. What is a Phantom Read A […]

Read More

Avoiding auto-increment holes on InnoDB with INSERT IGNORE

 | November 29, 2011 |  Posted In: MySQL

Are you using InnoDB tables on MySQL version 5.1.22 or newer? If so, you probably have gaps in your auto-increment columns. A simple INSERT IGNORE query creates gaps for every ignored insert, but this is undocumented behaviour. This documentation bug is already submitted. Firstly, we will start with a simple question. Why do we have […]

Read More