Innodb 1.1 for Mysql 5.5 User's Guide Innodb 1.1 for Mysql 5.5 User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
InnoDB 1.1 for MySQL 5.5 User's Guide InnoDB 1.1 for MySQL 5.5 User's Guide Abstract This is the User's Guide for the InnoDB storage engine 1.1 for MySQL 5.5. Beginning with MySQL version 5.1, it is possible to swap out one version of the InnoDB storage engine and use another (the “plugin”). This manual documents the latest InnoDB plugin, version 1.1, which works with MySQL 5.5 and features cutting-edge improvements in performance and scalability. This User's Guide documents the procedures and features that are specific to the InnoDB storage engine 1.1 for MySQL 5.5. It supplements the general InnoDB information in the MySQL Reference Manual. Because InnoDB 1.1 is integrated with MySQL 5.5, it is generally available (GA) and production-ready. WARNING: Because the InnoDB storage engine 1.0 and above introduces a new file format, restrictions apply to the use of a database created with the InnoDB storage engine 1.0 and above, with earlier versions of InnoDB, when using mysqldump or MySQL replication and if you use the older InnoDB Hot Backup product rather than the newer MySQL Enterprise Backup product. See Section 1.4, “Compatibility Considerations for Downgrade and Backup”. For legal information, see the Legal Notices. Document generated on: 2014-01-30 (revision: 37565) Table of Contents Preface and Legal Notices .................................................................................................................. v 1 Introduction to InnoDB 1.1 ............................................................................................................... 1 1.1 Features of the InnoDB Storage Engine ................................................................................ 1 1.2 Obtaining and Installing the InnoDB Storage Engine ............................................................... 3 1.3 Viewing the InnoDB Storage Engine Version Number ............................................................. 3 1.4 Compatibility Considerations for Downgrade and Backup ........................................................ 3 2 Fast Index Creation in the InnoDB Storage Engine ........................................................................... 5 2.1 Overview of Fast Index Creation ........................................................................................... 5 2.2 Examples of Fast Index Creation .......................................................................................... 5 2.3 Implementation Details of Fast Index Creation ....................................................................... 6 2.4 Concurrency Considerations for Fast Index Creation .............................................................. 7 2.5 How Crash Recovery Works with Fast Index Creation ............................................................ 7 2.6 Limitations of Fast Index Creation ......................................................................................... 7 3 Working with InnoDB Compressed Tables ....................................................................................... 9 3.1 Overview of Table Compression ............................................................................................ 9 3.2 Enabling Compression for a Table ........................................................................................ 9 3.2.1 Configuration Parameters for Compression ............................................................... 10 3.3 Tuning Compression for InnoDB Tables ............................................................................... 11 3.4 How Compression Works for InnoDB Tables ........................................................................ 14 3.5 SQL Compression Syntax Warnings and Errors ................................................................... 17 4 InnoDB File-Format Management .................................................................................................. 21 4.1 Enabling File Formats ......................................................................................................... 21 4.2 Verifying File Format Compatibility ....................................................................................... 21 4.2.1 Compatibility Check When InnoDB Is Started ........................................................... 23 4.2.2 Compatibility Check When a Table Is Opened ........................................................... 24 4.3 Identifying the File Format in Use ........................................................................................ 25 4.4 Downgrading the File Format .............................................................................................. 26 4.5 Future InnoDB File Formats ............................................................................................... 26 5 InnoDB Row Storage and Row Formats ........................................................................................ 27 5.1 Overview of InnoDB Row Storage ...................................................................................... 27 5.2 Specifying the Row Format for a Table ................................................................................ 27 5.3 DYNAMIC and COMPRESSED Row Formats ........................................................................... 27 5.4 COMPACT and REDUNDANT Row Formats ............................................................................. 28 6 InnoDB INFORMATION_SCHEMA tables .......................................................................................... 29 6.1 Information Schema Tables about Compression ................................................................... 29 6.1.1 INNODB_CMP and INNODB_CMP_RESET .................................................................... 29 6.1.2 INNODB_CMPMEM and INNODB_CMPMEM_RESET ........................................................ 29 6.1.3 Using the Compression Information Schema Tables .................................................. 30 6.2 Information Schema Tables about Transactions ................................................................... 31 6.2.1 Using the Transaction Information Schema Tables .................................................... 31 6.3 Special Locking Considerations for InnoDB INFORMATION_SCHEMA Tables ........................... 36 6.3.1 Understanding InnoDB Locking ................................................................................ 36 6.3.2 Granularity of INFORMATION_SCHEMA Data .............................................................. 36 6.3.3 Possible Inconsistency with PROCESSLIST ............................................................... 37 7 InnoDB Performance and Scalability Enhancements ....................................................................... 39 7.1 Overview of InnoDB Performance ........................................................................................ 39 7.2 Faster Locking for Improved Scalability ................................................................................ 39 7.3 Using Operating System Memory Allocators ......................................................................... 40 7.4 Controlling InnoDB Change Buffering .................................................................................. 41 7.5 Controlling Adaptive Hash Indexing ..................................................................................... 42 7.6 Changes Regarding Thread Concurrency ............................................................................ 42 iii InnoDB 1.1 for MySQL 5.5 User's Guide 7.7 Changes in the Read-Ahead Algorithm ................................................................................ 43 7.8 Multiple Background InnoDB I/O Threads ............................................................................ 44 7.9 Asynchronous I/O on Linux ................................................................................................. 45 7.10 Group Commit .................................................................................................................. 45 7.11 Controlling the InnoDB Master Thread I/O Rate .................................................................. 45 7.12 Controlling the Flushing Rate of Dirty Pages from the InnoDB Buffer Pool ............................ 46 7.13 Using the PAUSE Instruction in InnoDB Spin Loops ........................................................... 47 7.14 Control of Spin Lock Polling .............................................................................................. 47 7.15 Making the Buffer Pool Scan Resistant .............................................................................. 47 7.16 Improvements to Crash Recovery Performance .................................................................. 49 7.17 Integration with the MySQL Performance Schema .............................................................. 49 7.18 Improvements to Performance from Multiple Buffer Pools ................................................... 50 7.19 Better Scalability with Multiple Rollback Segments .............................................................. 51 7.20 Better Scalability with Improved Purge Scheduling .............................................................. 51 7.21 Improved Log Sys Mutex .................................................................................................. 51 7.22 Separate Flush List Mutex ................................................................................................. 52 8 InnoDB Features