14.1 Introduction to InnoDB

'InnoDB' is a general-purpose storage engine that balances high reliability and high performance. In MySQL 5.7, 'InnoDB' is the default MySQL storage engine. Unless you have configured a different default storage engine, issuing a *note 'CREATE TABLE': create-table. statement without an 'ENGINE' clause creates an 'InnoDB' table.

Key Advantages of InnoDB

InnoDB Storage Engine Features

Feature Support

B-tree indexes Yes

Backup/point-in-time recovery Yes (Implemented in the server, rather than
in the storage engine.)

Cluster database support No

Clustered indexes Yes

Compressed data Yes

Data caches Yes

Encrypted data Yes (Implemented in the server via encryption functions; In MySQL 5.7 and later, data-at-rest encryption is supported.)

Foreign key support Yes

Full-text search indexes Yes (Support for FULLTEXT indexes is available in MySQL 5.6 and later.)

Geospatial data type support Yes

Geospatial indexing support Yes (Support for geospatial indexing is available in MySQL 5.7 and later.)

Hash indexes No (InnoDB utilizes hash indexes internally for its Adaptive Hash Index feature.)

Index caches Yes

Locking granularity Row

MVCC Yes

Replication support (Implemented in the Yes server, rather than in the storage
engine.)

Storage limits 64TB

T-tree indexes No

Transactions Yes

Update statistics for data dictionary Yes

To compare the features of 'InnoDB' with other storage engines provided with MySQL, see the Storage Engine Features table in *note storage-engines::.

InnoDB Enhancements and New Features

For information about 'InnoDB' enhancements and new features, refer to:

Additional InnoDB Information and Resources

 File: manual.info.tmp, Node: innodb-benefits, Next: innodb-best-practices, Prev: innodb-introduction, Up: innodb-introduction

14.1.1 Benefits of Using InnoDB Tables

'InnoDB' tables have the following benefits:

For 'InnoDB'-specific tuning techniques you can apply to your MySQL server and application code, see *note optimizing-innodb::.

 File: manual.info.tmp, Node: innodb-best-practices, Next: innodb-check-availability, Prev: innodb-benefits, Up: innodb-introduction

14.1.2 Best Practices for InnoDB Tables

This section describes best practices when using 'InnoDB' tables.

 File: manual.info.tmp, Node: innodb-check-availability, Next: innodb-benchmarking, Prev: innodb-best-practices, Up: innodb-introduction

14.1.3 Verifying that InnoDB is the Default Storage Engine

Issue the *note 'SHOW ENGINES': show-engines. statement to view the available MySQL storage engines. Look for 'DEFAULT' in the 'SUPPORT' column.

 mysql> SHOW ENGINES;

Alternatively, query the Information Schema *note 'ENGINES': information-schema-engines-table. table.

 mysql> SELECT * FROM INFORMATION_SCHEMA.ENGINES;

 File: manual.info.tmp, Node: innodb-benchmarking, Next: innodb-turning-off, Prev: innodb-check-availability, Up: innodb-introduction

14.1.4 Testing and Benchmarking with InnoDB

If 'InnoDB' is not the default storage engine, you can determine if your database server and applications work correctly with 'InnoDB' by restarting the server with '--default-storage-engine=InnoDB' on the command line or with 'default-storage-engine=innodb' defined in the '[mysqld]' section of the MySQL server option file.

Since changing the default storage engine only affects newly created tables, run your application installation and setup steps to confirm that everything installs properly, then exercise the application features to make sure the data loading, editing, and querying features work. If a table relies on a feature that is specific to another storage engine, you receive an error. In this case, add the 'ENGINE=OTHER_ENGINE_NAME' clause to the *note 'CREATE TABLE': create-table. statement to avoid the error.

If you did not make a deliberate decision about the storage engine, and you want to preview how certain tables work when created using 'InnoDB', issue the command *note 'ALTER TABLE table_name ENGINE=InnoDB;': alter-table. for each table. Alternatively, to run test queries and other statements without disturbing the original table, make a copy:

 CREATE TABLE ... ENGINE=InnoDB AS SELECT * FROM OTHER_ENGINE_TABLE;

To assess performance with a full application under a realistic workload, install the latest MySQL server and run benchmarks.

Test the full application lifecycle, from installation, through heavy usage, and server restart. Kill the server process while the database is busy to simulate a power failure, and verify that the data is recovered successfully when you restart the server.

Test any replication configurations, especially if you use different MySQL versions and options on the source server and replicas.

 File: manual.info.tmp, Node: innodb-turning-off, Prev: innodb-benchmarking, Up: innodb-introduction

14.1.5 Turning Off InnoDB

Oracle recommends 'InnoDB' as the preferred storage engine for typical database applications, from single-user wikis and blogs running on a local system, to high-end applications pushing the limits of performance. In MySQL 5.7, 'InnoDB' is the default storage engine for new tables.

Important:

'InnoDB' cannot be disabled. The '--skip-innodb' option is deprecated and has no effect, and its use results in a warning. Expect it to be removed in a future MySQL release. This also applies to its synonyms ('--innodb=OFF', '--disable-innodb', and so forth).

 File: manual.info.tmp, Node: mysql-acid, Next: innodb-multi-versioning, Prev: innodb-introduction, Up: innodb-storage-engine