Chapter 109. InnoDB Tables

Table of Contents

InnoDB Tables Overview
InnoDB in MySQL Version 3.23
InnoDB Startup Options
Creating InnoDB Tablespace
If Something Goes Wrong in Database Creation
Creating InnoDB Tables
Converting MyISAM Tables to InnoDB
FOREIGN KEY Constraints
Multiple tablespaces - putting each table into its own .ibd file
Adding and Removing InnoDB Data and Log Files
Backing up and Recovering an InnoDB Database
Forcing recovery
Checkpoints
Moving an InnoDB Database to Another Machine
InnoDB Transaction Model and Locking
InnoDB and SET ... TRANSACTION ISOLATION LEVEL ...
Consistent Non-Locking Read
Locking Reads SELECT ... FOR UPDATE and SELECT ... LOCK IN SHARE MODE
Next-key Locking: Avoiding the Phantom Problem
Locks Set by Different SQL Statements in InnoDB
Deadlock Detection and Rollback
An Example of How the Consistent Read Works in InnoDB
How to Cope With Deadlocks
Performance Tuning Tips
SHOW INNODB STATUS and the InnoDB Monitors
Implementation of Multi-versioning
Table and Index Structures
Physical Structure of an Index
Insert Buffering
Adaptive Hash Indexes
Physical Record Structure
How an AUTO_INCREMENT Column Works in InnoDB
File Space Management and Disk I/O
Disk I/O
File Space Management
Defragmenting a Table
Error Handling in MySQL
Restrictions on InnoDB Tables
InnoDB Change History
MySQL/InnoDB-5.0.0, December 24, 2003
MySQL/InnoDB-4.0.17, December 17, 2003
MySQL/InnoDB-4.1.1, December 4, 2003
MySQL/InnoDB-4.0.16, October 22, 2003
MySQL/InnoDB-3.23.58, September 15, 2003
MySQL/InnoDB-4.0.15, September 10, 2003
MySQL/InnoDB-4.0.14, July 22, 2003
MySQL/InnoDB-3.23.57, June 20, 2003
MySQL/InnoDB-4.0.13, May 20, 2003
MySQL/InnoDB-4.1.0, April 3, 2003
MySQL/InnoDB-3.23.56, March 17, 2003
MySQL/InnoDB-4.0.12, March 18, 2003
MySQL/InnoDB-4.0.11, February 25, 2003
MySQL/InnoDB-4.0.10, February 4, 2003
MySQL/InnoDB-3.23.55, January 24, 2003
MySQL/InnoDB-4.0.9, January 14, 2003
MySQL/InnoDB-4.0.8, January 7, 2003
MySQL/InnoDB-4.0.7, December 26, 2002
MySQL/InnoDB-4.0.6, December 19, 2002
MySQL/InnoDB-3.23.54, December 12, 2002
MySQL/InnoDB-4.0.5, November 18, 2002
MySQL/InnoDB-3.23.53, October 9, 2002
MySQL/InnoDB-4.0.4, October 2, 2002
MySQL/InnoDB-4.0.3, August 28, 2002
MySQL/InnoDB-3.23.52, August 16, 2002
MySQL/InnoDB-4.0.2, July 10, 2002
MySQL/InnoDB-3.23.51, June 12, 2002
MySQL/InnoDB-3.23.50, April 23, 2002
MySQL/InnoDB-3.23.49, February 17, 2002
MySQL/InnoDB-3.23.48, February 9, 2002
MySQL/InnoDB-3.23.47, December 28, 2001
MySQL/InnoDB-4.0.1, December 23, 2001
MySQL/InnoDB-3.23.46, November 30, 2001
MySQL/InnoDB-3.23.45, November 23, 2001
MySQL/InnoDB-3.23.44, November 2, 2001
MySQL/InnoDB-3.23.43, October 4, 2001
MySQL/InnoDB-3.23.42, September 9, 2001
MySQL/InnoDB-3.23.41, August 13, 2001
MySQL/InnoDB-3.23.40, July 16, 2001
MySQL/InnoDB-3.23.39, June 13, 2001
MySQL/InnoDB-3.23.38, May 12, 2001
InnoDB Contact Information

InnoDB Tables Overview

InnoDB provides MySQL with a transaction-safe (ACID compliant) storage engine with commit, rollback, and crash recovery capabilities. InnoDB does locking on row level and also provides an Oracle-style consistent non-locking read in SELECT statements. These features increase multiuser concurrency and performance. There is no need for lock escalation in InnoDB, because row level locks in InnoDB fit in very small space. InnoDB is the first storage manager in MySQL to support FOREIGN KEY constraints.

InnoDB has been designed for maximum performance when processing large data volumes. Its CPU efficiency is probably not matched by any other disk-based relational database engine.

InnoDB is used in production at numerous large database sites requiring high performance. The famous Internet news site Slashdot.org runs on InnoDB. Mytrix, Inc. stores over 1 TB of data in InnoDB, and another site handles an average load of 800 inserts/updates per second in InnoDB.

Technically, InnoDB is a complete database backend placed under MySQL. InnoDB has its own buffer pool for caching data and indexes in main memory. InnoDB stores its tables and indexes in a tablespace, which may consist of several files (or raw disk partitions). This is different from, for example, MyISAM tables where each table is stored as a separate file. InnoDB tables can be of any size even on operating systems where file-size is limited to 2 GB.

You can find the latest information about InnoDB at http://www.innodb.com/. The most up-to-date version of the InnoDB manual is always placed there.

InnoDB is published under the same GNU GPL License Version 2 (of June 1991) as MySQL. If you distribute MySQL/InnoDB, and your application does not satisfy the restrictions of the GPL license, you have to buy a commercial MySQL Pro license from https://order.mysql.com/?sub=pg&pg_no=1.