Chapter 14 The InnoDB Storage Engine

Table of Contents

14.1 Introduction to InnoDB
14.1.1 InnoDB as the Default MySQL Storage Engine
14.1.2 Checking InnoDB Availability
14.1.3 Turning Off InnoDB
14.2 InnoDB Concepts and Architecture
14.2.1 MySQL and the ACID Model
14.2.2 The InnoDB Transaction Model and Locking
14.2.3 InnoDB Lock Modes
14.2.4 Consistent Nonlocking Reads
14.2.5 Locking Reads (SELECT ... FOR UPDATE and SELECT ... LOCK IN SHARE MODE)
14.2.6 InnoDB Record, Gap, and Next-Key Locks
14.2.7 Avoiding the Phantom Problem Using Next-Key Locking
14.2.8 Locks Set by Different SQL Statements in InnoDB
14.2.9 Implicit Transaction Commit and Rollback
14.2.10 Deadlock Detection and Rollback
14.2.11 How to Cope with Deadlocks
14.2.12 InnoDB Multi-Versioning
14.2.13 InnoDB Table and Index Structures
14.3 InnoDB Configuration
14.3.1 Configuring InnoDB for Read-Only Operation
14.4 InnoDB Administration
14.5 InnoDB Tablespace Management
14.5.1 Creating the InnoDB Tablespace
14.5.2 InnoDB File-Per-Table Mode
14.5.3 Enabling and Disabling File-Per-Table Mode
14.5.4 Specifying the Location of a Tablespace
14.5.5 Copying Tablespaces to Another Server (Transportable Tablespaces)
14.5.6 Storing InnoDB Undo Logs in Separate Tablespaces
14.5.7 Changing the Number or Size of InnoDB Log Files and Resizing the InnoDB Tablespace
14.5.8 Using Raw Disk Partitions for the Shared Tablespace
14.6 InnoDB Table Management
14.6.1 Creating InnoDB Tables
14.6.2 Moving or Copying InnoDB Tables to Another Machine
14.6.3 Grouping DML Operations with Transactions
14.6.4 Converting Tables from MyISAM to InnoDB
14.6.5 AUTO_INCREMENT Handling in InnoDB
14.6.6 InnoDB and FOREIGN KEY Constraints
14.6.7 Limits on InnoDB Tables
14.7 InnoDB Compressed Tables
14.7.1 Overview of Table Compression
14.7.2 Enabling Compression for a Table
14.7.3 Tuning Compression for InnoDB Tables
14.7.4 Monitoring Compression at Runtime
14.7.5 How Compression Works for InnoDB Tables
14.7.6 Compression for OLTP Workloads
14.7.7 SQL Compression Syntax Warnings and Errors
14.8 InnoDB File-Format Management
14.8.1 Enabling File Formats
14.8.2 Verifying File Format Compatibility
14.8.3 Identifying the File Format in Use
14.8.4 Downgrading the File Format
14.8.5 Future InnoDB File Formats
14.9 InnoDB Row Storage and Row Formats
14.9.1 Overview of InnoDB Row Storage
14.9.2 Specifying the Row Format for a Table
14.9.3 DYNAMIC and COMPRESSED Row Formats
14.9.4 COMPACT and REDUNDANT Row Formats
14.10 InnoDB Disk I/O and File Space Management
14.10.1 InnoDB Disk I/O
14.10.2 File Space Management
14.10.3 InnoDB Checkpoints
14.10.4 Defragmenting a Table
14.10.5 Reclaiming Disk Space with TRUNCATE TABLE
14.11 InnoDB and Online DDL
14.11.1 Overview of Online DDL
14.11.2 Performance and Concurrency Considerations for Online DDL
14.11.3 SQL Syntax for Online DDL
14.11.4 Combining or Separating DDL Statements
14.11.5 Examples of Online DDL
14.11.6 Implementation Details of Online DDL
14.11.7 How Crash Recovery Works with Online DDL
14.11.8 Online DDL for Partitioned InnoDB Tables
14.11.9 Limitations of Online DDL
14.12 InnoDB Startup Options and System Variables
14.13 InnoDB Performance
14.13.1 InnoDB Buffer Pool Configuration
14.13.2 InnoDB Mutex and Read/Write Lock Implementation
14.13.3 Configuring the Memory Allocator for InnoDB
14.13.4 Configuring InnoDB Change Buffering
14.13.5 Configuring Thread Concurrency for InnoDB
14.13.6 Configuring the Number of Background InnoDB I/O Threads
14.13.7 Group Commit
14.13.8 Configuring the InnoDB Master Thread I/O Rate
14.13.9 Using the PAUSE Instruction in InnoDB Spin Loops
14.13.10 Configuring Spin Lock Polling
14.13.11 InnoDB Integration with MySQL Performance Schema
14.13.12 Better Scalability with Multiple Rollback Segments
14.13.13 Configuring InnoDB Purge Scheduling
14.13.14 Optimizing InnoDB Read-Only Transactions
14.13.15 Using the CRC32 Checksum Algorithm for Faster Checksums
14.13.16 Optimizer Statistics
14.13.17 Estimating ANALYZE TABLE Complexity for InnoDB Tables
14.14 InnoDB INFORMATION_SCHEMA Tables
14.14.1 Information Schema Tables about Compression
14.14.2 Information Schema Tables about Transactions
14.14.3 Information Schema Tables about Full-Text Search
14.14.4 Special Locking Considerations for InnoDB INFORMATION_SCHEMA Tables
14.15 InnoDB Monitors
14.15.1 InnoDB Monitor Types
14.15.2 Enabling InnoDB Monitors
14.15.3 InnoDB Standard Monitor and Lock Monitor Output
14.15.4 InnoDB Tablespace Monitor Output
14.15.5 InnoDB Table Monitor Output
14.16 InnoDB Backup and Recovery
14.16.1 The InnoDB Recovery Process
14.17 InnoDB and MySQL Replication
14.18 InnoDB Integration with memcached
14.18.1 Benefits of the InnoDB / memcached Combination
14.18.2 Architecture of InnoDB and memcached Integration
14.18.3 Getting Started with InnoDB Memcached Plugin
14.18.4 Security Considerations for the InnoDB memcached Plugin
14.18.5 Writing Applications for the InnoDB memcached Interface
14.18.6 Using the InnoDB memcached Plugin with Replication
14.18.7 Internals of the InnoDB memcached Plugin
14.18.8 Troubleshooting the InnoDB memcached Plugin
14.19 InnoDB Troubleshooting
14.19.1 Troubleshooting InnoDB I/O Problems
14.19.2 Forcing InnoDB Recovery
14.19.3 Troubleshooting InnoDB Data Dictionary Operations
14.19.4 InnoDB Error Handling
14.19.5 InnoDB Error Codes
14.19.6 Operating System Error Codes