Percona Server 5.5.34-32.0
Percona Server 5.5.34-32.0
Percona Server 5.5.34-32.0
Release 5.5.34-32.0
CONTENTS
Introduction 1.1 Percona Server Feature Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 The Percona XtraDB Storage Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installation 2.1 Installing Percona Server 5.5 from Binaries . . . . . . . . 2.2 Installing Percona Server from a Source Tarball . . . . . 2.3 Installing Percona Server from the Bazaar Source Tree . . 2.4 Percona Sever In-Place Upgrading Guide: From 5.1 to 5.5 Scalability Improvements 3.1 Improved Buffer Pool Scalability . . . . 3.2 Congurable Insert Buffer . . . . . . . . 3.3 Improved InnoDB I/O Scalability . . . . 3.4 Multiple Adaptive Hash Search Partitions 3.5 Multiple Rollback Segments . . . . . . .
3 3 5 7 7 12 12 13 23 23 24 25 31 31 33 33 34 35 37 38 38 39 39 39 41 43 46 49 49 49 50 51 52 52 56
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
Performance Improvements 4.1 Atomic write support for Fusion-io devices . 4.2 Drop table performance . . . . . . . . . . . 4.3 Conguration of the Doublewrite Buffer . . 4.4 Query Cache Enhancements . . . . . . . . . 4.5 Fast InnoDB Checksum . . . . . . . . . . . 4.6 Remove Excessive Function Calls (fcntl) . 4.7 Reduced Buffer Pool Mutex Contention . . . 4.8 InnoDB timer-based Concurrency Throttling 4.9 Improved NUMA support . . . . . . . . . . . 4.10 HandlerSocket . . . . . . . . . . . . . . . . 4.11 Thread Pool . . . . . . . . . . . . . . . . . 4.12 Binary Log Group Commit . . . . . . . . . Flexibility Improvements 5.1 Support of Multiple Page Sizes . . . . 5.2 Suppress Warning Messages . . . . . . 5.3 Handle BLOB End of Line . . . . . . . 5.4 Fixed Size for the Read Ahead Area . . 5.5 Fast Shutdown . . . . . . . . . . . . . 5.6 Improved MEMORY Storage Engine . 5.7 Restricting the number of binlog les .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
5.8 5.9 6
57 57 59 59 61 61 62 63 65 65 66 68 71 75 76 78 79 80 81 82 83 85 86 88 90 93 93 98 104 111 122 123 124 129 129 130 131 135
Reliability Improvements 6.1 Crash-Resistant Replication . . . . . 6.2 Too Many Connections Warning . . . 6.3 Error Code Compatibility . . . . . . 6.4 Handle Corrupted Tables . . . . . . . 6.5 Lock-Free SHOW SLAVE STATUS .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
Management Improvements 7.1 InnoDB Recovery Stats . . . . . . . . . . . . . . . 7.2 InnoDB Data Dictionary Size Limit . . . . . . . . . 7.3 Expand Table Import . . . . . . . . . . . . . . . . . 7.4 Dump/Restore of the Buffer Pool . . . . . . . . . . 7.5 Fast Index Creation . . . . . . . . . . . . . . . . . . 7.6 Expanded Fast Index Creation . . . . . . . . . . . . 7.7 Prevent Caching to FlashCache . . . . . . . . . . . 7.8 Percona Toolkit UDFs . . . . . . . . . . . . . . . . 7.9 Support for Fake Changes . . . . . . . . . . . . . . 7.10 Kill Idle Transactions . . . . . . . . . . . . . . . . 7.11 Enforcing Storage Engine . . . . . . . . . . . . . . 7.12 Utility user . . . . . . . . . . . . . . . . . . . . . . 7.13 Extending the secure-file-priv server option 7.14 Expanded Program Option Modiers . . . . . . . . 7.15 XtraDB changed page tracking . . . . . . . . . . . 7.16 PAM Authentication Plugin . . . . . . . . . . . . . Diagnostics Improvements 8.1 InnoDB Statistics . . . . . . . . . . . . . . 8.2 User Statistics . . . . . . . . . . . . . . . 8.3 Slow Query Log . . . . . . . . . . . . . . 8.4 Extended Show Engine InnoDB Status . . 8.5 Count InnoDB Deadlocks . . . . . . . . . 8.6 Log All Client Commands (syslog) . . . 8.7 Response Time Distribution . . . . . . . . 8.8 Show Storage Engines . . . . . . . . . . . 8.9 Show Lock Names . . . . . . . . . . . . . 8.10 Process List . . . . . . . . . . . . . . . . . 8.11 Misc. INFORMATION_SCHEMA Tables 8.12 Thread Based Proling . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
Obsolete and Removed Features 137 9.1 Shared Memory Buffer Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 139 139 143 144 152 155 156 157 157 158
10 Reference 10.1 Development of Percona Server . . . . . . . . . . . . . . . . . . . 10.2 Trademark Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3 List of upstream MySQL bugs xed in Percona Server 5.5 . . . . . 10.4 List of variables introduced in Percona Server 5.5 . . . . . . . . . . 10.5 Index of INFORMATION_SCHEMA Tables . . . . . . . . . . . . . 10.6 Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . 10.7 Copyright and Licensing Information . . . . . . . . . . . . . . . . 10.8 Options that make XtraDB tablespaces not compatible with MySQL 10.9 Percona Server 5.5 Release notes . . . . . . . . . . . . . . . . . . ii
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
iii
iv
Percona Server is an enhanced drop-in replacement for MySQL. With Percona Server, Your queries will run faster and more consistently. You will consolidate servers on powerful hardware. You will delay sharding, or avoid it entirely. You will save money on hosting fees and power. You will spend less time tuning and administering. You will achieve higher uptime. You will troubleshoot without guesswork. Does this sound too good to be true? Its not. Percona Server offers breakthrough performance, scalability, features, and instrumentation. Its self-tuning algorithms and support for extremely high-performance hardware make it the clear choice for companies who demand the utmost performance and reliability from their database server.
CONTENTS
CONTENTS
CHAPTER
ONE
INTRODUCTION
1.1 Percona Server Feature Comparison
Percona Server is an enhanced drop-in replacement for MySQL. With Percona Server, Your queries will run faster and more consistently. You will consolidate servers on powerful hardware. You will delay sharding, or avoid it entirely. You will save money on hosting fees and power. You will spend less time tuning and administering. You will achieve higher uptime. You will troubleshoot without guesswork. We provide these benets by signicantly enhancing Percona Server as compared to the standard MySQL database server: Features Open source ACID Compliance Multi-Version Concurrency Control Row-Level Locking Automatic Crash Recovery Table Partitioning Views Subqueries Triggers Stored Procedures Foreign Keys Extra Features for Developers NoSQL Socket-Level Interface Extra Hash/Digest Functions Percona Server 5.5.27 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Percona Server 5.5.27 Yes Yes MySQL 5.5.27 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes MySQL 5.5.27
Extra Diagnostic Features INFORMATION_SCHEMA Tables Global Performance and Status Counters Per-Table Performance Counters Per-Index Performance Counters Per-User Performance Counters Per-Client Performance Counters Per-Thread Performance Counters High-Resolution Process List Timing Detailed Query Execution and Plan Log Global Query Response Time Statistics InnoDB Data Dictionary as I_S Tables Access to InnoDB Data Statistics Enhanced SHOW ENGINE INNODB STATUS Enhanced Mutex Diagnostics Undo Segment Information Durability and Reliability Enhancements Transactional Replication State Handles Corrupted Tables Gracefully Performance & Scalability Enhancements Support for Multiple I/O Threads Dedicated Purge Thread Self-Tuning Checkpoint Algorithm Fine-Grained Mutex Locking Lock-Free Algorithms Improved MEMORY Storage Engine Partitioned Adaptive Hash Search Separate Doublewrite File Fast Checksum Algorithm Buffer Pool Pre-Load Fast Shut-Down Background Table Drop Support for FlashCache Read-Ahead Improvements Extra Features for DBA/Operations Staff Congurable Page Sizes Import Tables From Different Servers Congurable Data Dictionary Size Congurable Insert Buffer Size Active Change Buffer Purging Error/Warning Logging Enhancements Congurable Fast Index Creation Support for Fake Changes Changed Page Tracking Running Database as a Service Special Utility User Expanded Program Option Modiers Extended secure-file-priv option Enforcing the Specic Storage Engine
Percona Server 5.5.27 60 370 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Percona Server 5.5.27 Yes Yes Percona Server 5.5.27 Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Percona Server 5.5.27 Yes Yes Yes Yes Yes Yes Yes Yes Yes
MySQL 5.5.27
MySQL 5.5.27
MySQL 5.5.27
Chapter 1. Introduction
Percona XtraDB is an enhanced version of the InnoDB storage engine, designed to better scale on modern hardware, and including a variety of other features useful in high performance environments. It is fully backwards compatible, and so can be used as a drop-in replacement for standard InnoDB. Percona XtraDB includes all of InnoDB s robust, reliable ACID-compliant design and advanced MVCC architecture, and builds on that solid foundation with more features, more tunability, more metrics, and more scalability. In particular, it is designed to scale better on many cores, to use memory more efciently, and to be more convenient and useful. The new features are especially designed to alleviate some of InnoDB s limitations. We choose features and xes based on customer requests and on our best judgment of real-world needs as a high-performance consulting company. Percona XtraDB engine will not have further binary releases, it is distributed as part of Percona Server and MariaDB.
Chapter 1. Introduction
CHAPTER
TWO
INSTALLATION
2.1 Installing Percona Server 5.5 from Binaries
Before installing, you might want to read the Percona Server 5.5 Release notes. Ready-to-use binaries are available from the Percona Server download page, including: RPM packages for RHEL 5 and RHEL 6 Debian packages for Debian and Ubuntu
Add this to /etc/apt/sources.list, replacing VERSION with the name of your distribution:
deb http://repo.percona.com/apt VERSION main deb-src http://repo.percona.com/apt VERSION main
After that you can install the server and client packages
# apt-get install percona-server-server-5.5 percona-server-client-5.5
Supported Platforms
Supported Releases
Debian 6.0 (squeeze) 7.0 (wheezy) Ubuntu 10.04LTS (lucid) 12.04LTS (precise) 12.10 (quantal) 13.04 (raring)
Percona apt Experimental repository
Percona offers fresh beta builds from the experimental repository. To enable it add the following lines to your /etc/apt/sources.list , replacing VERSION with the name of your distribution:
deb http://repo.percona.com/apt VERSION main experimental deb-src http://repo.percona.com/apt VERSION main experimental
In some cases you might need to pin the selected packages to avoid the upgrades from the distribution repositories. Youll need to make a new le /etc/apt/preferences.d/00percona.pref and add the following lines in it:
Package: * Pin: release o=Percona Development Team Pin-Priority: 1001
For more information about the pinning you can check the ofcial debian wiki. Percona yum Repository The Percona yum repository supports popular RPM -based operating systems, including the Amazon Linux AMI. The easiest way to install the Percona Yum repository is to install an RPM that congures yum and installs the Percona GPG key. You can also do the installation manually.
Automatic Installation
Execute the following command as a root user, replacing x86_64 with i386 if you are not running a 64-bit operating system:
$ rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
Chapter 2. Installation
The RPMs for the automatic installation are available at http://www.percona.com/downloads/percona-release/ and include source code.
Manual Installation
place
the
following
into
new
le
named
[percona] name = CentOS $releasever - Percona baseurl=http://repo.percona.com/centos/$releasever/os/$basearch/ enabled = 1 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-percona gpgcheck = 1
Make sure packages are downloaded from the repository, by executing the following command as root:
yum list | grep percona
Supported Platforms
x86_64 i386
Supported Releases
The CentOS repositories should work well with Red Hat Enterprise Linux too, provided that yum is installed on the server. CentOS 5 and RHEL 5 CentOS 6 and RHEL 6 Amazon Linux AMI (works the same as CentOS 5) 2.1. Installing Percona Server 5.5 from Binaries 9
Percona offers fresh beta builds from the experimental repository. To subscribe to the experimental repository, install the experimental RPM :
rpm -Uhv http://repo.percona.com/testing/centos/6/os/noarch/percona-testing-0.0-1.noarch.rpm
Note: This repository works for both RHEL/CentOS 5 and RHEL/CentOS 6 Percona provides repositories for yum (RPM packages for Red Hat, CentOS and Amazon Linux AMI ) and apt (.deb packages for Ubuntu and Debian) for software such as Percona Server, XtraDB, XtraBackup, and Percona Toolkit. This makes it easy to install and update your software and its dependencies through your operating systems package manager. This is the recommend way of installing where possible. YUM-Based Systems Once the repository is set up, use the following commands:
$ yum install Percona-Server-client-55 Percona-Server-server-55
DEB-Based Systems Once the repository is set up, use the following commands:
$ sudo apt-get install percona-server-server-5.5
If you dont install all at the same time, you will need to do it in a specic order - shared, client, server:
$ rpm -ivh Percona-Server-shared-55-5.5.14-rel20.5.149.rhel5.i686.rpm $ rpm -ivh Percona-Server-client-55-5.5.14-rel20.5.149.rhel5.i686.rpm $ rpm -ivh Percona-Server-server-55-5.5.14-rel20.5.149.rhel5.i686.rpm
Otherwise, the dependencies wont be met and the installation will fail.
10
Chapter 2. Installation
Each of the Percona Server RPM packages have a particular purpose. The Percona-Server-server package contains the server itself (the mysqld binary). The Percona-Server-55-debuginfo package contains debug symbols for use debugging the database server. The Percona-Server-client package contains the command line client. The Percona-Server-devel package contains the header les needed to compile software using the client library. The Percona-Server-shared package includes the client shared library. The Percona-Server-shared-compat package includes shared libraries for software compiled against old versions of the client library. The Percona-Server-test package includes the test suite for Percona Server. DEB-Based Systems Download the packages of the desired series for your architecture from here. For example, at the moment of writing, for Ubuntu Maverick on i686, a way of doing this is:
The installation wont succeed as there will be missing dependencies. To handle this, use:
$ apt-get -f install
and all dependencies will be installed and the Percona Server installation will be nished by apt.
Whats in each DEB package?
The percona-server-server package contains the database server itself, the mysqld binary and associated les. The percona-server-common package contains les common to the server and client. The percona-server-client package contains the command line client. The percona-server-dfsg package contains.... The libmysqlclient-dev package contains header les needed to compile software to use the client library. The libmysqlclient18 package contains the client shared library. The 18 is a reference to the version of the shared library. The version is incremented when there is a ABI change that requires software using the client library to be recompiled or their source code modied.
11
Next, run cmake to congure the build. Here you can specify all the normal build options as you do for a normal MySQL build. Depending on what options you wish to compile Percona Server with, you may need other libraries installed on your system. Here is an example using a congure line similar to the options that Percona uses to produce binaries:
Install:
$ make install
You can now fetch the latest Percona Server 5.5 sources. In the future, we will provide instructions for fetching each specic Percona Server version and building it, but currently we will just talk about building the latest Percona Server 5.5 development tree.
$ cd ~/percona-server $ bzr branch lp:percona-server/5.5
You can now change into the 5.5 directory and build Percona Server 5.5:
$ make
This will fetch the upstream MySQL source tarball and apply the Percona Server patches to it. If you have the quilt utility installed, it will use it to apply the patches, otherwise it will just use the standard patch utility. You will then have a directory named Percona-Server that is ready to run the congure script and build.
Note: PAM Authentication Plugin has been merged into Percona Server in 5.5.24-26.0 but it is not built with the server by default. In order to build the Percona Server with PAM plugin, additional option -DWITH_PAM=ON should be used.
12
Chapter 2. Installation
The SHM buffer pool patch has been replaced with the safer LRU Dump/Restore patch, which provides similar improvements in restart performance and has the advantage of persisting across machine restarts. The conguration variables for my.cnf have been kept for compatibility and warnings will be printed for the deprecated options (innodb_buffer_pool_shm_key and innodb_buffer_pool_shm_checksum) if used. Instructions for disabling the SHM buffer pool can be found here and for setting up LRU dump/restore here.
13
Percona Server 5.1 offered a feature that enabled InnoDB to use multiple rollback segments, relieving a major cause of resource contention in write-intensive workloads. In MySQL 5.5, Oracle implemented a similar feature, and so in Percona Server 5.5, the innodb_extra_rsegments option has been replaced by the MySQL 5.5 innodb_rollback_segment option.
InnoDB Statistics
Three elds in table INNODB_INDEX_STATS were renamed: 5.1 Series row_per_keys index_size leaf_pages 5.5 Series rows_per_key index_total_pages index_leaf_pages
The columns ROWS_EXAMINED, ROWS_SENT, and ROWS_READ have been added to the SHOW PROCESSLIST command and the table PROCESSLIST. For more information, see its documentation documentation. Grepping Old Variables You can check if old variables are being used in your conguration le by issuing the following line in a shell:
New Features You may also want to check the new features available in Percona Server 5.5: Multiple Adaptive Hash Search Partitions Crash-Resistant Replication Show Engine InnoDB Status Plugins All plugins not included with Percona Server will have to be recompiled for Percona Server 5.5. There is a new plugin interface that complements the plugin API, plugins must be recompiled and linked to libmysqlservices. The plugins bundled with the server are already linked, you can list the installed plugins with the SHOW PLUGINS statement:
mysql> SHOW PLUGINS; +-----------------------+--------+--------------------+---------+---------+ | Name | Status | Type | Library | License | +-----------------------+--------+--------------------+---------+---------+ | binlog | ACTIVE | STORAGE ENGINE | NULL | GPL | ... +-----------------------+--------+--------------------+---------+---------+
http://dev.mysql.com/doc/refman/5.5/en/plugin-services.html http://dev.mysql.com/doc/refman/5.5/en/plugin-installing-uninstalling.html Upgrading from MySQL 5.1 If you are upgrading from MySQL 5.1 instead of Percona Server 5.1, you should take into account that the InnoDB Plugin has been included in the standard MySQL 5.5 distribution as default for the InnoDB storage engine. This change does not affect Percona Server as it has the XtraDB storage engine - an enhanced version of InnoDB built-in since the 5.1 series. If you are migrating from MySQL 5.1.X, and you were using the InnoDB plugin, make sure to remove it from the conguration le by deleting the following two lines from the [mysqld] section:
[mysqld] ignore-builtin-innodb # <- DELETE plugin-load=innodb=ha_innodb_plugin.so # <- DELETE
otherwise, the server wont start. Strictly speaking, the ignore-builtin-innodb option will disable XtraDB in Percona Server 5.5 if set, and the server will not start if no other default storage engine is specied (i.e. default-storage-engine=MyISAM). Also, the variable innodb_le_io_threads has been replaced by innodb_read_io_threads and innodb_write_io_threads (these variables were already introduced in Percona Server 5.1). All of them defaults to 4, you should replace the old variable with the two new ones with the proper value (or delete it if the default - 4 - is acceptable).
15
Replication When upgrading in a replication environment, a change in handling of IF NOT EXISTS results in an incompatibility for statement-based replication from a MySQL 5.1 master prior to 5.1.51 to a MySQL 5.5 slave. If you use CREATE TABLE IF NOT EXISTS ... higher. SELECT statements, upgrade the master rst to 5.1.51 or
Note that this differs from the usual replication upgrade advice of upgrading the slave rst. Indexes The stopword le is loaded and searched using latin1 if character_set_server is ucs2, utf16, or utf32. If any table was created with FULLTEXT indexes while the server character set was ucs2, utf16, or utf32, it should be repaired using this statement REPAIR TABLE tbl_name QUICK;. Error Messages The --language option has been deprecated and is an alias for --lc-messages-dir and --lc-messages. Also, error messages are now constructed in UTF-8 and returned with character_set_results encoding. Unicode Support The Unicode implementation has been extended to provide support for supplementary characters that lie outside the Basic Multilingual Plane (BMP), introducing the utf16, utf32 and utf8mb4 charsets. If you are considering upgrading from utf8 to utf8mb4 to take advantage of the supplementary characters, you may have to adjust the size of the elds and indexes in the future. See http://dev.mysql.com/doc/refman/5.5/en/charsetunicode-upgrading.html. Upgrading to utf8mb4 will not take place unless you explicitly change the charset, i.e. with a ALTER TABLE. . . statement. Changes in SQL The following changes require modications in the SQL statements in the client side: INTO clauses are no longer accepted in nested SELECT statements. Modify the SQL statements to not contain the clause. Alias declarations outside table_reference are not allowed for multiple-table DELETE statements. Modify those statements to use aliases only inside table_reference part. Alias resolution does not require qualication and alias reference should not be qualied with the database name. New reserved words: GENERAL IGNORE_SERVER_IDS MASTER_HEARTBEAT_PERIOD MAXVALUE RESIGNAL
16
Chapter 2. Installation
SIGNAL SLOW TRUNCATE TABLE fails for a XtraDB table if there are any FOREIGN KEY constraints from other tables that reference the table. As XtraDB always use the fast truncation technique in 5.5 - equivalent to DROP TABLE and CREATE TABLE - you should modify the SQL statements to issue DELETE FROM table_name for such tables instead of TRUNCATE TABLE or an error will be returned in that cases.
This will backup all the data in your server to a time stamped subdirectory of the path provided. innobackupex is a Perl script distributed with XtraBackup, a hot-backup utility for MySQL -based servers that doesnt block your database during the backup. If you dont have XtraBackup installed already, instructions can be found here. You should backup your entire conguration le - my.cnf - also. The le is usually located in /etc/mysql/ or /etc/ or as .my.cnf in users home directory,
$ cp /etc/mysql/my.cnf /path/where/to/store/backup/
While this is not an in-place upgrade technically, where possible, doing a full dump of the servers data for restoring it later is recommended. By this way, the indexes from all tables will be rebuilt explicitly, and any binary compatibility issue will be avoided:
$ mysqldump --user=root -p --all-databases --routines > mydata.sql
This is not possible in some cases because of available space or downtime requirements, but if it is feasible, it is highly recommended.
and proceed to do the modications needed in your conguration le, as explained at the beginning of this guide. Note: For extra safety doing the slow InnoDB shutdown before the upgrade is recommended. Then install the new server with:
17
The installation script will run automatically mysql_upgrade to migrate to the new grant tables, rebuild the indexes where needed and then start the server. Note that this procedure is the same for upgrading from MySQL 5.1 or 5.5 to Percona Server 5.5. RPM-based distributions Having done the full backup (and dump if possible), stop the server:
$ /sbin/service mysql stop
You may have a forth, shared-compat, which is for compatibility purposes. After checking, proceed to remove them without dependencies:
$ rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
It is important that you remove it without dependencies as many packages may depend on these (as they replace mysql) and will be removed if omitted. Note that this procedure is the same for upgrading from MySQL 5.1 or 5.5 to Percona Server 5.5: just grep ^mysql- instead of Percona-Server and remove them. You will have to install the following packages: Percona-Server-server-55 Percona-Server-client-55
$ yum install Percona-Server-server-55 Percona-Server-client-55
Once installed, proceed to modify your conguration le - my.cnf - and recompile the plugins if necessary, as explained at the beginning of this guide. As the schema of the grant table has changed, the server must be started without reading them:
$ /usr/sbin/mysqld --skip-grant-tables --user=mysql &
and use mysql_upgrade to migrate to the new grant tables, it will rebuild the indexes needed and do the modications needed:
$ mysql_upgrade ... OK
If it cant nd the PID le, kill the server and start it normally:
18
Chapter 2. Installation
Once removed, proceed to do the modications needed in your conguration le, as explained at the beginning of this guide. Then, download the following packages for your architecture: percona-server-server-5.5 percona-server-client-5.5 percona-server-common-5.5 libmysqlclient16 At the moment of writing this guide, for Ubuntu Maverick on i686, a way of doing this is:
The installation wont succeed as there will be missing dependencies. To handle this, use: $ apt-get -f install and all dependencies will be handled by apt. The installation script will run automatically mysql_upgrade to migrate to the new grant tables and rebuild the indexes where needed. RPM-based distributions Having done the full backup (and dump if possible), stop the server:
$ /sbin/service mysql stop
19
You may have a forth, shared-compat, which is for compatibility purposes. After checked that, proceed to remove them without dependencies:
$ rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
It is important that you remove it without dependencies as many packages may depend on these (as they replace mysql) and will be removed if ommited. Note that this procedure is the same for upgrading from MySQL 5.1 to Percona Server 5.5, just grep ^mysql- instead of Percona-Server and remove them. Download the following packages for your architecture: Percona-Server-server-55 Percona-Server-client-55 Percona-Server-shared-55 At the moment of writing this guide, a way of doing this is:
If you dont install all at the same time, you will need to do it in a specic order - shared, client, server:
$ rpm -ivh Percona-Server-shared-55-5.5.12-rel20.3.118.rhel5.i686.rpm $ rpm -ivh Percona-Server-client-55-5.5.12-rel20.3.118.rhel5.i686.rpm $ rpm -ivh Percona-Server-server-55-5.5.12-rel20.3.118.rhel5.i686.rpm
Otherwise, the dependencies wont be met and the installation will fail. Once installed, proceed to modify your conguration le - my.cnf - and recompile the plugins if necessary, as explained at the beginning of this guide. As the schema of the grant table has changed, the server must be started without reading them:
$ /usr/sbin/mysqld --skip-grant-tables --user=mysql &
and use mysql_upgrade to migrate to the new grant tables, it will rebuild the indexes needed and do the modications needed:
$ mysql_upgrade
If it cant nd the pid le, kill the server and start it normally:
$ killall /usr/sbin/mysqld $ /sbin/service mysql start
21
22
Chapter 2. Installation
CHAPTER
THREE
SCALABILITY IMPROVEMENTS
3.1 Improved Buffer Pool Scalability
The InnoDB buffer pool is a well known point of contention when many queries are executed concurrently. In XtraDB, the global mutex protecting the buffer pool has been split into several mutexes to decrease contention. This feature splits the single global InnoDB buffer pool mutex into several mutexes: Name buf_pool_mutex LRU_list_mutex ush_list_mutex page_hash_latch free_list_mutex zip_free_mutex zip_hash_mutex Protects ags about IO LRU list of blocks in buffer pool ush list of dirty blocks to ush hash table to search blocks in buffer pool list of free blocks in buffer pool lists of free area to treat compressed pages hash table to search compressed pages
The goal of this change is to reduce mutex contention, which can be very impacting when the working set does not t in memory.
If you have a high-concurrency workload this section may look like this:
1 2 3 4 5 ---------SEMAPHORES ---------OS WAIT ARRAY INFO: reservation count 36255, signal count 12675 --Thread 10607472 has waited at buf/buf0rea.c line 420 for 0.00 seconds the semaphore:
23
6 Mutex at 0x358068 created file buf/buf0buf.c line 597, lock var 0 7 waiters flag 0 8 --Thread 3488624 has waited at buf/buf0buf.c line 1177 for 0.00 seconds the semaphore: 9 Mutex at 0x358068 created file buf/buf0buf.c line 597, lock var 0 10 waiters flag 0 11 --Thread 6896496 has waited at btr/btr0cur.c line 442 for 0.00 seconds the semaphore: 12 S-lock on RW-latch at 0x8800244 created in file buf/buf0buf.c line 547 13 a writer (thread id 14879600) has reserved it in mode exclusive 14 number of readers 0, waiters flag 1 15 Last time read locked in file btr/btr0cur.c line 442 16 Last time write locked in file buf/buf0buf.c line 1797 [...] 17 Mutex spin waits 0, rounds 452650, OS waits 22573 18 RW-shared spins 27550, OS waits 13682; RW-excl spins 0, OS waits 0
Note that in the second case you will see indications that threads are waiting for a mutex created in the le buf/buf0buf.c (lines 5 to 7 or 8 to 10). Such an indication is a sign of buffer pool contention.
Scope Global Dynamic Yes Default Value 100 Range 100 - 999999999 This variable allows better control of the background thread processing the insert buffer. Each time the thread is called, its activity is altered by the value of both innodb_io_capacity and innodb_ibuf_accel_rate this way:
[real activity] = [default activity] * (innodb_io_capacity/100) * (innodb_ibuf_accel_rate/100)
By increasing the value of innodb_ibuf_accel_rate, you will increase the insert buffer activity. variable innodb_ibuf_max_size Command Line Yes Cong File Yes Scope Global Dynamic No Variable Type Numeric Default Value Half the size of the InnoDB buffer pool Range 0 - Half the size of the InnoDB buffer pool Units Bytes This variable species the maximum size of the insert buffer. By default the insert buffer is half the size of the buffer pool so if you have a very large buffer pool, the insert buffer will be very large too and you may want to restrict its size with this variable. Setting this variable to 0 is equivalent to disabling the insert buffer. But then all changes to secondary indexes will be performed synchronously which will probably cause performance degradation. Likewise a too small value can hurt performance. If you have very fast storage (ie storage with RAM-level speed, not just a RAID with fast disks), a value of a few MB may be the best choice for maximum performance.
25
Conguration of the insert buffer (maximum size, activity) Various other options
26
Adaptive checkpointing forces a constant ushing activity at a rate of approximately [modied age / maximum checkpoint age]. This can avoid or soften the impact of stalls casued by aggressive ushing. The following values are allowed: native [0]: This setting causes checkpointing to operate exactly as it does in native InnoDB. estimate [1]: If the oldest modied age exceeds 1/4 of the maximum age capacity, InnoDB starts ushing blocks every second. The number of blocks ushed is determined by [number of modied blocks], [LSN progress speed] and [average age of all modied blocks]. So, this behavior is independent of the innodb_io_capacity variable for the 1-second loop, but the variable still has an effect for the 10-second loop. keep_average [2]: This method attempts to keep the I/O rate constant by using a much shorter loop cycle (0.1 second) than that of the other methods (1.0 second). It is designed for use with SSD cards. reflex: This behavior is similar to innodb_max_dirty_pages_pct ushing. The difference is that this method starts ushing blocks constantly and contiguously based on the oldest modied age. If the age exceeds 1/2 of the maximum age capacity, InnoDB starts weak contiguous ushing. If the age exceeds 3/4, InnoDB starts strong ushing. The strength can be adjusted by the MySQL variable innodb_io_capacity. In other words, we must tune innodb_io_capacity for the reflex method to work the best. This method was removed in 5.5.20-beta as a x for bug #689450. variable innodb_checkpoint_age_target Command Line Yes Cong File Yes Scope GLOBAL Dynamic Yes Variable Type Numeric Default Value 0 Range 0+ This variable controls the maximum value of the checkpoint age if its value is different from 0. If the value is equal to 0, it has no effect. It is not needed to shrink innodb_log_file_size to tune recovery time. variable innodb_flush_method Command Line Yes Cong File Yes Scope Global Dyn No Variable Type Enumeration Default Value fdatasync Allowed Values fdatasync, O_DSYNC, O_DIRECT, ALL_O_DIRECT This is an existing MySQL 5.5 system variable. It determines the method InnoDB uses to ush its data and log les. (See innodb_flush_method in the MySQL 5.5 Reference Manual). The following values are allowed: fdatasync: use fsync() to ush both the data and log les.
27
O_SYNC: use O_SYNC to open and ush the log les; use fsync() to ush the data les. O_DIRECT: use O_DIRECT to open the data les and fsync() system call to ush both the data and log les. ALL_O_DIRECT: use O_DIRECT to open both data and log les, and use fsync() to ush the data les but it is skipped for all log les writes. This option is recommended when InnoDB log les are big (more than 8GB), otherwise there might be even a performance degradation. Note: When using this option on ext4 lesystem variable innodb_log_block_size should be set to 4096 (default log-block-size in ext4) in order to avoid the unaligned AIO/DIO warnings. variable innodb_flush_neighbor_pages Version Info 5.5.19-24.0 Introduced option value cont Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Enumeration Default Value area Range none, area, cont This variable species whether, when the dirty pages are ushed to the data le, the neighbor pages in the data le are also ushed at the same time or not. The following values (and their numeric counterparts 0, 1 and 2 for older patch compatibility) are available: none: disables the feature. area (default): enables ushing of non-contiguous neighbor pages. For each page that is about to be ushed, look into its vicinity for other dirty pages and ush them too. This value implements the standard InnoDB behavior. If you use a storage which has no head seek delay (e.g. SSD or enough memory for write buffering), none or cont may show better performance. cont: enable ushing of contiguous neighbor pages. For each page that is about to be ushed, look if there is a contiguous block of dirty pages surrounding it. If such block is found it is ushed in a sequential I/O operation as opposed to several random I/Os if area is used. variable innodb_read_ahead Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type String Default Value linear Allowed Values none, random (*), linear, both This variable controls the read-ahead algorithm of InnoDB. The following values are available: none: disables read-ahead random: if enough pages within the same extent are in the buffer pool, InnoDB will automatically fetch the remaining pages (an extent consists of 64 consecutive pages)
28
linear (default): if enough pages within the same extent are accessed sequentially, InnoDB will automatically fetch the remaining pages both: enable both random and linear algorithms. You can also control the threshold from which InnoDB will perform a read ahead request with the innodb_read_ahead_threshold variable (*) random is removed from InnoDB Plugin 1.0.5, XtraDB ignores it after 1.0.5. variable innodb_use_global_flush_log_at_trx_commit Version Info 5.5.8-20.0 Introduced Command Line Yes Cong File Yes Scope Global Dynamic Yes Type Boolean Default Value True Range True/False This variable is used to control the ability of the user to set the value of the global MySQL variable innodb_flush_log_at_trx_commit. If innodb_use_global_flush_log_at_trx_commit=0 (False), the client can set the global MySQL variable, using:
SET innodb_use_global_flush_log_at_trx_commit=N
If innodb_use_global_flush_log_at_trx_commit=1 (True), the user session will use the current value of innodb_flush_log_at_trx_commit, and the user cannot reset the value of the global variable using a SET command. variable innodb_log_block_size Command Line Yes Cong File Yes Scope Global Dynamic No Variable Type Numeric Default Value 512 Units Bytes This variable changes the size of transaction log records. The default size of 512 bytes is good in most situations. However, setting it to 4096 may be a good optimization with SSD cards. While settings other than 512 and 4096 are possible, as a practical matter these are really the only two that it makes sense to use. Clean restart and removal of the old logs is needed for the variable innodb_log_block_size to be changed. variable innodb_log_file_size Version Info 5.5.8-20.0 Introduced
29
Command Line Yes Cong File Yes Scope Global Dynamic No Type Numeric Default Value 5242880 Range 1048576 .. 4294967295 In upstream MySQL the limit for the combined size of log les must be less than 4GB. But in Percona Server it is: on 32-bit systems: individual log le limit is 4 GB and total log le size limit is 4 GB, i.e. the same as in the upstream server. on 64-bit systems: both individual log les and total log le size are practically unlimited (the limit is 2^63 - 1 bytes which is 8+ million TB). variable innodb_purge_threads Command Line Yes Cong File Yes Scope Global Dynamic No Type Numeric Default Value 1 This variable is the same as the one in the upstream version. The only difference is the default value, in Percona Server it is 1 while in the upstream version is 0. Status Variables The following information has been added to SHOW ENGINE INNODB STATUS to conrm the checkpointing activity:
The max checkpoint age The current checkpoint age target The current age of the oldest page modification which has not been flushed to disk yet. The current age of the last checkpoint ... --LOG --Log sequence number 0 1059494372 Log flushed up to 0 1059494372 Last checkpoint at 0 1055251010 Max checkpoint age 162361775 Checkpoint age target 104630090 Modified age 4092465 Checkpoint age 4243362 0 pending log writes, 0 pending chkp writes ...
30
31
Percona Server, in addition to the upstream multiple rollback segment implementation, provides the additonal Information Schema table: INFORMATION_SCHEMA.INNODB_RSEG.
32
CHAPTER
FOUR
PERFORMANCE IMPROVEMENTS
4.1 Atomic write support for Fusion-io devices
Note: This feature implementation is considered BETA quality. DirectFS lesystem on Fusion-io devices supports atomic writes. Atomic writes can be used instead of InnoDB doublewrite buffer to guarantee that the InnoDB data pages will be written to disk entirely or not at all. When atomic writes are enabled the device will take care of protecting the data against partial writes. In case the doublewrite buffer is enabled it will be disabled automatically. This will improve the write performance, because data doesnt need to be written twice anymore, and make the recovery simpler.
33
34
35
Whats New with This Feature In a standard InnoDB / XtraDB installation, the doublewrite buffer is located in the main tablespace (whether you activate the innodb_file_per_table or not) and you have no option to control anything about it. The feature adds an option (innodb_doublewrite_file) to have a dedicated location for the doublewrite buffer. How to Choose a Good Location for the Doublewrite Buffer Basically if you want to improve the I/O activity, you will put the doublewrite buffer on a different disk. But is it better on an SSD or a more traditional HDD? First you should note that pages are written in a circular fashion in the doublewrite buffer and only read on recovery. So the doublewrite buffer performs mostly sequential writes and a few sequential reads. Second HDDs are very good at sequential write if a write cache is enabled, which is not the case of SSDs. Therefore you should choose a fast HDD if you want to see performance benets from this option. For instance, you could place the redo logs (also written in a sequential way) and the doublewrite buffer on the same disk.
36
By default (option off), the queries are considered different, so the server will execute them both and cache them both. If the option is enabled, the queries are considered identical, so the server will execute and cache the rst one and will serve the second one directly from the query cache.
37
Makes the server ignore comments when checking for a query cache hit. Other Reading MySQL general thread states Query cache freezes
38
The solution is to use socket timeouts, with the SO_RCVTIMEO and SO_SNDTIMEO options. This way, the timeouts are automatically handled by the operating system, which means that all reads can be done in blocking mode.
It is generally recommended to enable all of the options together to maximize the performance effects on the NUMA architecture.
Default Value 0 Range 0/1 When this option is enabled, mysqld will run with its memory interleaved on all NUMA nodes by starting it with numactl --interleave=all. In case there is just 1 CPU/node, allocations will be interleaved between that node.
4.10 HandlerSocket
4.10.1 Description
HandlerSocket is a MySQL plugin that implements a NoSQL protocol for MySQL. This allows applications to communicate more directly with MySQL storage engines, without the overhead associated with using SQL. This includes operations such as parsing and optimizing queries, as well as table handling operations (opening, locking, unlocking, closing). As a result, using HandlerSocket can provide much better performance for certain applications that using normal SQL application protocols. Complete documentation on the HandlerSocket plugin, including installation and conguration options, is located here. The plugin is disabled by default. To enable it in Percona Server with XtraDB, see below.
4.10. HandlerSocket
41
mysql> SHOW PROCESSLIST; +----+-------------+-----------------+---------------+---------+------+-----------------------------| Id | User | Host | db | Command | Time | State +----+-------------+-----------------+---------------+---------+------+-----------------------------| 1 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 con | 2 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 con ... | 16 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 con | 17 | system user | connecting host | handlersocket | Connect | NULL | handlersocket: mode=wr, 0 con
To ensure HandlerSocket is working as expected, you can follow these steps: Create a new table:
mysql> CREATE TABLE t ( id int(11) NOT NULL, col varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB;
Conguration options HandlerSocket has many conguration options that are detailed here.
42
to the MySQL conguration le my.cnf. Although the default values for the thread pool should provide good performance, additional tuning can be performed with the dynamic system variables described below. Note: Current implementation of the thread pool is built in the server, unlike the upstream version which is implemented as a plugin. Another signicant implementation difference is that this implementation doesnt try to minimize the number of concurrent transactions like the MySQL Enterprise Threadpool. Because of these things this implementation isnt compatible with the upstream one.
43
same queue with other connections that are about to start a new transaction, or those that have run out of their high priority tickets. With the default value of 0, all connections are always put into the common queue, i.e. no priority scheduling is used as in the original implementation in MariaDB. The higher is the value, the more chances each transaction gets to enter the high priority queue and commit before it is put in the common queue.
variable thread_pool_oversubscribe Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Numeric Default Value 3 The higher the value of this parameter the more threads can be run at the same time, if the values is lower than 3 it could lead to more sleeps and wake-ups. variable thread_pool_size Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Numeric Default Value Number of processors This variable can be used to dene the number of threads that can use the CPU at the same time. variable thread_pool_stall_limit Command Line Yes Cong File Yes Scope Global Dynamic No Variable Type Numeric Default Value 500 (ms) The number of milliseconds before a running thread is considered stalled. When this limit is reached thread pool will wake up or create another thread. This is being used to prevent a long-running query from monopolizing the pool. variable extra_port Command Line Yes Cong File Yes Scope Global Dynamic No Variable Type Numeric Default Value 0 This variable can be used to specify additional port Percona Server will listen on. This can be used in case no new connections can be established due to all worker threads being busy or being locked when pool-of-threads feature is enabled. To connect to the extra port following command can be used:
45
variable extra_max_connections Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Numeric Default Value 1 This variable can be used to specify the maximum allowed number of connections on the extra port. This can be used with the extra_port variable to access the server in case no new connections can be established due to all worker threads being busy or being locked when pool-of-threads feature is enabled.
46
the disk. Binary Log Group Commit feature can use a single fsync() call to force data to the storage for multiple concurrently committing transactions, which provides throughput improvements in a write-concurrent workload. Because there are no negative effects of this feature, it has been enabled by default and cant be disabled. Effects of this feature can be measured by the binlog_commits and binlog_group_commits status variables. The bigger the difference between these two variables the bigger is the performance gained with this feature.
47
48
CHAPTER
FIVE
FLEXIBILITY IMPROVEMENTS
5.1 Support of Multiple Page Sizes
Warning: This feature has been deprecated in the Percona Server 5.5.30-30.2. It has been replaced by the upstream version released in MySQL 5.6.4. Percona Server has implemented support for multiple InnoDB page sizes. This can be used to increase the IO performance by setting this value close to storage device block size. InnoDB page size can be set up with the innodb_page_size variable.
49
50
51
52
Rows in DFR are represented internally by multiple memory blocks, which means that a single row can consist of multiple blocks organized into one set. Each row occupies at least one block, there can not be multiple rows within a single block. Block size can be congured when creating a table (see below). This DFR implementation has two caveats regarding to ordering and indexes.
5.6.1 Caveats
Ordering of Rows In the absence of ORDER BY, records may be returned in a different order than the previous MEMORY implementation. This is not a bug. Any application relying on a specic order without an ORDER BY clause may deliver unexpected results. A specic order without ORDER BY is a side effect of a storage engine and query optimizer implementation which may and will change between minor MySQL releases. Indexing It is currently impossible to use indexes on BLOB columns due to some limitations of the Dynamic Row Format. Trying to create such an index will fail with the following error:
BLOB column <name> cant be used in key specification with the used table type.
5.6.2 Restrictions
For performance reasons, a mixed solution is implemented: the xed format is used at the beginning of the row, while the dynamic one is used for the rest of it. The size of the xed-format portion of the record is chosen automatically on CREATE TABLE and cannot be changed later. This, in particular, means that no indexes can be created later with CREATE INDEX or ALTER TABLE when the dynamic row format is used. All values for columns used in indexes are stored in xed format at the rst block of the row, then the following columns are handled with DRF. This sets two restrictions to tables: the order of the elds and therefore, the minimum size of the block used in the table. Ordering of Columns The columns used in xed format must be dened before the dynamic ones in the CREATE TABLE statement. If this requirement is not met, the engine will not be able to add blocks to the set for these elds and they will be treated as xed. Minimum Block Size The block size has to be big enough to store all xed-length information in the rst block. If not, the CREATE TABLE or ALTER TABLE statements will fail (see below).
53
Explicit Request The explicit request is set with one of the following options in the CREATE TABLE statement: KEY_BLOCK_SIZE = <value> Requests the DFR with the specied block size (in bytes) ROW_FORMAT = DYNAMIC Requests the dynamic format with the default block size (256 bytes) Despite its name, the KEY_BLOCK_SIZE option refers to a block size used to store data rather then indexes. The reason for this is that an existing CREATE TABLE option is reused to avoid introducing new ones. The Improved MEMORY Engine checks whether the specied block size is large enough to keep all key column values. If it is too small, table creation will abort with an error. After DRF is requested explicitly and there are no BLOB or TEXT columns in the table denition, the Improved MEMORY Engine will check if using the dynamic format provides any space saving benets as compared to the xed one: if the xed row length is less than the dynamic block size (plus the dynamic row overhead - platform dependent) OR there isnt any variable-length columns in the table or VARCHAR elds are declared with length 31 or less, the engine will revert to the xed format as it is more space efcient in such case. The row format being used by the engine can be checked using SHOW TABLE STATUS.
5.6.4 Examples
On a 32-bit platform:
54
mysql> CREATE TABLE t1 (f1 VARCHAR(32), f2 VARCHAR(32), f3 VARCHAR(32), f4 VARCHAR(32), PRIMARY KEY (f1)) KEY_BLOCK_SIZE=124 ENGINE=HEAP ROW_FORMAT=DYNAMIC; mysql> SHOW TABLE STATUS LIKE t1; Name Engine Version Row_format t1 MEMORY 10 Dynamic 0
Rows X
Avg_row_length 0 X
Data_length 0 0
On a 64-bit platform:
mysql> CREATE TABLE t1 (f1 VARCHAR(32), f2 VARCHAR(32), f3 VARCHAR(32), f4 VARCHAR(32), PRIMARY KEY (f1)) KEY_BLOCK_SIZE=124 ENGINE=HEAP ROW_FORMAT=DYNAMIC; mysql> SHOW TABLE STATUS LIKE t1; Name Engine Version Row_format t1 MEMORY 10 Fixed 0
Rows X
Avg_row_length 0 X
Data_length 0 0
55
The allocation and contents of the actual chunks varies between xed and variable-size modes: Format of a xed-size chunk: uchar[] * With sizeof=chunk_dataspace_length, but at least sizeof(uchar*) bytes. It keeps actual data or pointer to the next deleted chunk, where chunk_dataspace_length equals to full record length uchar * Status eld (1 means in use, 0 means deleted) Format of a variable-size chunk: uchar[] * With sizeof=chunk_dataspace_length, but at least sizeof(uchar*) bytes. It keeps actual data or pointer to the next deleted chunk, where chunk_dataspace_length is set according to tables key_block_size uchar* * Pointer to the next chunk in this chunkset, or NULL for the last chunk uchar * Status eld (1 means rst, 0 means deleted, 2 means linked) Total chunk length is always aligned to the next sizeof(uchar*).
56
5.5.27-29.0 Introduced. Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type ULONG Default Value 0 (unlimited) Range 0-102400
5.7.3 Example
Number of the binlog les before setting this variable
$ ls -l mysql-bin.0* | wc -l 26
In order for new value to take effect FLUSH LOGS needs to be run. After that the number of binlog les is 20
$ ls -l mysql-bin.0* | wc -l 20
This could happen if mysqldump was taking a backup of a working slave and during that process table name would get changed. This error happens because mysqldump takes the list of the tables at the beginning of the dump process but the SHOW CREATE TABLE happens just before the table is being dumped. With this option mysqldump will still show error to stderr, but it will continue to work and dump the rest of the tables.
57
This feature allows using LOAD DATA LOCAL INFILE in combination with SELECT INTO OUTFILE to quickly load multiple partitions across the network or in other setups, without having to use an intermediate le which wastes space and I/O.
58
CHAPTER
SIX
RELIABILITY IMPROVEMENTS
6.1 Crash-Resistant Replication
This feature makes replication much more reliable after a crash by making the replicas position relative to the master transactional. MySQL replication normally stores its position in a le that is neither durable nor consistent. Thus, if the replica crashes, it can re-execute committed transactions. This usually causes replication to fail, potentially forcing the replicas data to be re-initialized from the master or from a recent backup. The improvement in Percona Server makes InnoDB store the replication position transactionally, and overwrite the usual relay_log.info le upon recovery, so replication restarts from the correct position and does not try to re-execute committed transactions. This change greatly improves the durability of MySQL replication. It can be set to activate automatically, so replication just works and no intervention is necessary after a crash.
6.1.1 Restrictions
When innodb_overwrite_relay_log_info is enabled, you should only update InnoDB / XtraDB tables, not MyISAM tables or other storage engines. You should not use relay or binary log lenames longer than 480 characters (normal: up to 512). If longer, the replication position information is not recorded in InnoDB.
If this feature is enabled, the output will look like the following, with additional lines prexed with a + symbol:
.... + InnoDB: + InnoDB: + InnoDB: + InnoDB: .... InnoDB:
Warning: innodb_overwrite_relay_log_info is enabled. Updates of other storage engines may h relay-log.info is detected. relay log: position 429, file name ./gauntlet3-relay-bin.000111 master log: position 280, file name gauntlet3-bin.000015 Starting crash recovery.
59
.... InnoDB: Apply batch completed + InnoDB: In a MySQL replication slave the last master binlog file + InnoDB: position 0 468, file name gauntlet3-bin.000015 + InnoDB: and relay log file + InnoDB: position 0 617, file name ./gauntlet3-relay-bin.000111 090205 17:41:31 InnoDB Plugin 1.0.2-3 started; log sequence number 57933 + InnoDB: relay-log.info have been overwritten. .... 090205 17:41:31 [Note] Slave SQL thread initialized, starting replication in log gauntlet3-bin.00
In this case, the master log position was overwritten to 468 from 280, so replication will start at position 468 and not repeat the transaction beginning at 280.
60
Variable Type BOOLEAN Default Value FALSE Range TRUE/FALSE If set to true, InnoDB overwrites relay-log.info at crash recovery when the information is different from the record in InnoDB. This variable was added in release 5.5.10-20.1. Prior to that, innodb_overwrite_relay_log_info, which still exists in earlier versions. it was named
61
header le include/mysqld_ername.h from the le errmsg.txt. To keep error numbers consistent, we should add some ctive errors to errmsg.txt, because comp_err assigns error code numbers sequentially, without gaps. I propose patch to comp_err. This patch allows usage of a new syntax, with prex PADD, for example:
PADD_QUERY_CACHE_DISABLED 1651 eng "ER_QUERY_CACHE_DISABLED padding to 1651 error" ER_QUERY_CACHE_DISABLED eng "Query cache is disabled; restart the server with query_cache_type=1 to enable it"
comp_err with my patch padds empty intervals (from last error code number to 1651) by error message ER_QUERY_CACHE_DISABLED padding to 1651 error, i.e. and ER_QUERY_CACHE_DISABLED now has error code 1651 (as desired). I propose to use this patch for Percona errors, for example:
PADD_PERCONA_NEW_ERROR_CODE 4000 end "Padd empty space to error code number 4000 (Percona error codes)" ...some percona error codes...
Patch only adds prex PADD_ and padds error in sys les. All other MySQL code (load*.sys les, my_error, etc) works as old one.
62
Dynamic Yes Variable Type ULONG Default Value 0 Range 0 - 1 Return error 1194 (ER_CRASHED_ON_USAGE) instead of crashing with an assertion failure, when used with innodb_file_per_table. Once corruption is detected, access to the corrupted tablespace is disabled. The only allowed operation on a corrupted tablespace is DROP TABLE. The only exception to this rule is when the option value is salvage (see below). This variable was renamed to innodb_corrupt_table_action, beginning in release 5.5.10-20.1. The option name was innodb_pass_corrupt_table in versions prior to that. variable innodb_corrupt_table_action Version Info 5.5.10-20.1 Introduced. Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type ENUM Default Value assert Range assert, warn, salvage With the default value XtraDB will intentionally crash the server with an assertion failure as it would normally do when detecting corrupted data in a single-table tablespace. If the warn value is used it will pass corruption of the table as corrupt table instead of crashing itself. For this to work innodb_file_per_table should be enabled. All le I/O for the datale after detected as corrupt is disabled, except for the deletion. When the option value is salvage, XtraDB allows read access to a corrupted tablespace, but ignores corrupted pages. This variable was added in release 5.5.10-20.1. Prior to that, it was named innodb_pass_corrupt_table, which still exists in earlier versions.
63
This will display the slaves status as if there were no lock, allowing the user to detect and understand the situation that is occurring. NOTE: The information given when NOLOCK is used may be slightly inconsistent with the actual situation while the lock is being held.
64
CHAPTER
SEVEN
MANAGEMENT IMPROVEMENTS
7.1 InnoDB Recovery Stats
When the variable innodb_recovery_stats is enabled and XtraDB has to do recovery on startup, server will write detailed recovery statistics information to the error log. This info will be written after the recovery process is nished. Example of output statistics for recovery process:
------------------RECOVERY STATISTICS ------------------Recovery time: 18 sec. (1 turns) Data page IO statistics Requested pages: 9126 Read pages: 9126 Written pages: 7957 (Dirty blocks): 1156 Grouping IO [times]: number of pages, read request neighbors (in 32 pages chunk), combined read IO, combined write IO 1, 32, 335, 548 2, 0, 121, 97 3, 7, 49, 44 4, 4, 43, 26 .... 64, 0, 2, 25 Recovery process statistics Checked pages by doublewrite buffer: Overwritten pages from doublewrite: Recovered pages by io_thread: Recovered pages by main thread: Parsed log records to apply: Sum of the length: Applied log records: Sum of the length: Pages which are already new enough: Oldest pages LSN: Newest pages LSN:
65
66
67
Unfortunately, the table cache is not always an accurate way to know whether the table is used by MySQL or not. Tables that are in the table cache might not really be in use, so if you have a big table cache, the algorithm will only be able to remove some of the items in the dictionary, which means that the memory consumed by the dictionary may exceed the value of innodb_dict_size_limit. This is why we said this variable sets a soft limit on the size of the dictionary, not an absolute limit. Estimating the Data Dictionary Size Percona Server provides instrumentation to show the data dictionary size directly, but if youre not using Percona Server, you can estimate the size of the data dictionary. By calculating how much memory InnoDB has allocated that is not attributable to the buffer pool, etc., you will have an idea of how much allocated memory is not accounted for. This will not be the exact size of the data dictionary, but it will be a reasonable estimate. To make this estimate, rst locate the following lines in the output of SHOW ENGINE INNODB STATUS:
---------------------BUFFER POOL AND MEMORY ---------------------Total memory allocated 13563931762; in additional pool allocated 1048576 Buffer pool size 524288
The line beginning Total memory allocated shows the total memory InnoDB has allocated. The next line shows the buffer pool size in pages; you can either multiply that by the page size to get a value in bytes, or determine the size of the InnoDB buffer pool by executing the command SHOW VARIABLES LIKE innodb_buffer_pool_size . The latter is easier, if you use MySQL 5.0 or later, so for the purpose of this example, assume we use that and it gives the value 8589934592. Finally, subtract the InnoDB buffer pool size from the total memory allocated:
13563931762 - 8589934592 = 4973997170
So, there is a little over 4.6 GB of memory that InnoDB has allocated and which is unaccounted for. This is a pretty large amount of extra memory usage; quite a bit more than the gigabyte or so suggested as a maximum. So, you may benet from using this feature.
68
Percona Server 5.5.28-29.2 extended the innochecksum with an option -f to read the le format information from a given InnoDB data le. As only the rst page needs to be read to detect the format/version information, it can also be used on a running server. Example of the output should look like this:
$ innochecksum -f ibdata1 Detected file format: Antelope (5.1.7 or newer).
7.3.1 Example
Assuming that: innodb_expand_import is set to 1. the les (.ibd and .exp) are prepared by the xtrabackup --prepare --export command. First create exactly same structured tables to the target database. Then discard the tables as preparation of import, for example,
mysql> set FOREIGN_KEY_CHECKS=0; Query OK, 0 rows affected (0.00 sec) mysql> alter table customer discard tablespace; Query OK, 0 rows affected (0.01 sec) mysql> alter table district discard tablespace; Query OK, 0 rows affected (0.01 sec) mysql> alter table history discard tablespace; Query OK, 0 rows affected (0.00 sec) ... put the .ibd and .exp files at the same place to .frm file. import the tables (command example) mysql> set FOREIGN_KEY_CHECKS=0; Query OK, 0 rows affected (0.00 sec) mysql> set global innodb_expand_import=1; Query OK, 0 rows affected (0.00 sec) mysql> alter table customer import tablespace; Query OK, 0 rows affected (0.17 sec) mysql> alter table district import tablespace; Query OK, 0 rows affected (0.00 sec) mysql> alter table history import tablespace; Query OK, 0 rows affected (0.04 sec) ... (.err file example) InnoDB: import: extended import of tpcc2/customer is started. InnoDB: import: 2 indexes are detected. InnoDB: Progress in %: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 InnoDB: import: extended import of tpcc2/district is started. InnoDB: import: 1 indexes are detected. InnoDB: Progress in %: 16 33 50 66 83 100 done. InnoDB: import: extended import of tpcc2/history is started.
69
70
71
This is a fast operation, and the resulting le is very small compared to the buffer pool. The le is in binary format, not text format. Now restart MySQL, and examine the number of pages in the buffer pool, for example,
mysql> show status like innodb_buffer_pool_pages_data; +-------------------------------+-------+ | Variable_name | Value | +-------------------------------+-------+ | innodb_buffer_pool_pages_data | 22 | +-------------------------------+-------+
The following command instructs XtraDB to restore the LRU from the le:
mysql> select * from information_schema.XTRADB_ADMIN_COMMAND /*!XTRA_LRU_RESTORE*/; +---------------------------------+ | result_message | +---------------------------------+ | XTRA_LRU_RESTORE was succeeded. | +---------------------------------+ 1 row in set (0.62 sec)
This command executes quickly, because it doesnt use direct_io. Afterwards, inspect the status of the buffer pool again:
mysql> show status like innodb_buffer_pool_pages_data; +-------------------------------+-------+ | Variable_name | Value | +-------------------------------+-------+ | innodb_buffer_pool_pages_data | 6231 | +-------------------------------+-------+
The requested number of pages is the number of pages that were in the LRU dump le. A page might not be read if it is already in the buffer pool, or for some other miscellaneous reasons, so the number of pages read can be less than the number requested.
72
73
5.5.16-22.0 Added Command Line Yes Cong File Yes Scope Global Dynamic No Variable Type Boolean Default Value OFF Range ON/OFF When this variable is set to ON XtraDB waits until the restore of the dump is completed before reporting successful startup to the server. variable innodb_buffer_pool_restore_at_startup Version Info 5.5.10-20.1 Added. Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Numeric Default Value 0 Range 0-UINT_MAX32 Units Seconds This variable species the time in seconds between automatic buffer pool dumps. When set to zero, automatic dumps are disabled and must be done manually. The variable innodb_buffer_pool_restore_at_startup controls both automatic buffer pool dumps and automatic restore on startup. When set to a non-zero value, an automatic restore of the buffer pool is also performed at startup, as described above. This variable was added in release 5.5.10-20.1. Prior to that, it was named innodb_auto_lru_dump, which still exists in earlier versions.
74
75
Dynamic Yes Variable Type ULONG Default Value 1048576 (1M) Range 1048576 - 1073741824 (1G)
76
OPTIMIZE TABLE Internally, OPTIMIZE TABLE is mapped to ALTER TABLE ... ENGINE=innodb for InnoDB tables. As a consequence, it now also benets from fast index creation, with the same restrictions as for ALTER TABLE. Caveats InnoDB fast index creation uses temporary les in tmpdir for all indexes being created. So make sure you have enough tmpdir space when using expand_fast_index_creation. It is a session variable, so you can temporarily switch it off if you are short on tmpdir space and/or dont want this optimization to be used for a specic table. Theres also a number of cases when this optimization is not applicable: UNIQUE indexes in ALTER TABLE are ignored to enforce uniqueness where necessary when copying the data to a temporary table; ALTER TABLE and OPTIMIZE TABLE always process tables containing foreign keys as if expand_fast_index_creation is OFF to avoid dropping keys that are part of a FOREIGN KEY constraint; mysqldump innodb-optimize-keys ignores foreign keys because InnoDB requires a full table rebuild on foreign key changes. So adding them back with a separate ALTER TABLE after restoring the data from a dump would actually make the restore slower; mysqldump innodb-optimize-keys ignores indexes on AUTO_INCREMENT columns, because they must be indexed, so it is impossible to temporarily drop the corresponding index; mysqldump innodb-optimize-keys ignores the rst UNIQUE index on non-nullable columns when the table has no PRIMARY KEY dened, because in this case InnoDB picks such an index as the clustered one.
77
7.8.3 Installation
These UDFs are part of the Percona Server packages. To install one of the UDFs into the server, execute one of the following commands, depending on which UDF you want to install:
$ mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME libfnv1a_udf.so" $ mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME libfnv_udf.so" $ mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME libmurmur_udf.so"
Executing each of these commands will install its respective UDF into the server.
7.8.4 Troubleshooting
If you get the error:
ERROR 1126 (HY000): Cant open shared library fnv_udf.so (errno: 22 fnv_udf.so: cannot open shared
Then you may need to copy the .so le to another location in your system. Try both /lib and /usr/lib. Look at your environments $LD_LIBRARY_PATH variable for clues. If none is set, and neither /lib nor /usr/lib works, you may need to set LD_LIBRARY_PATH to /lib or /usr/lib.
79
7.9.1 Caveats
DML operations are supported Currently only DML operations are supported, i.e. UPDATE, INSERT, REPLACE and DELETE (set deleted ag). DDL operations are not supported DDL operations are not supported, i.e. ALTER TABLE and TRUNCATE TABLE. Fake Changes should be disabled temporally if DDL statements are going to be executed. Otherwise, data may be lost. Explicit COMMIT will lead to an error From the viewpoint of transactional RDBMS, COMMIT should not be fake anytime. ROLLBACK must be used to terminate the fake transaction.
80
Version Info 5.5.28-29.2 Introduced Scope GLOBAL Type BOOLEAN Dynamic YES Default Value TRUE When this variable is set to FALSE, it makes fake transactions not to take any row locks. This feature was implemented because, although fake change transactions downgrade the requested exclusive (X) row locks to shared (S) locks, these S locks prevent X locks from being taken and block the real changes. However, this option is not safe to set to FALSE by default, because the fake changes implementation is not ready for lock-less operation for all workloads. Namely, if a real transaction will remove a row that a fake transaction is doing a secondary index maintenance for, the latter will fail. This option is considered experimental and might be removed in the future if lockless operation mode xes are implemented.
81
5.5.16-22.0 Introduced Scope GLOBAL Cong YES Dynamic YES Variable Type INTEGER Default Value 0 (disabled) Units Seconds To enable this feature, set this variable to the desired seconds wait until the transaction is killed.
7.11.3 Example
Adding following option to my.cnf will start the server with InnoDB as enforced storage engine.
enforce_storage_engine=InnoDB
82
83
schema by the name of any of those listed in this option is created after the server is started, the utility user will have full access to it. Example: --utility_user_schema_access =schema1,schema2,schema3 ; Option utility_user_privileges allows a comma-separated list of extra access privileges to grant to the utility user. Example: --utility-user-privileges =CREATE, DROP, LOCK TABLES
Species the schemas that the utility user has access to in a comma delimited list. variable utility_user_privileges Version Info 5.5.34-32.0 Implemented Command Line Yes Cong File utility_user_privileges=<privilege1>,<privilege2>,<privilege3> Scope Global Dynamic No Variable Type String Default Value NULL This variable can be used to specify a comma-separated list of extra access privileges to grant to the utility user. Supported values for the privileges list are: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS,FILE, GRANT, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES,EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE
85
In order to offer more control over option visibility, access and range limits, the following new option modiers have been added minimum [minimum-<option_name>=<value>] indicates that clients can not set the value of option_name to less than the limit specied. If the client does attempt to set the value of option_name lesser than the limit, the option_name will simply be set to the dened limit. hidden [hidden-<option_name>=<TRUE/FALSE>] indicates that clients can not see or modify the value of option_name. readonly [readonly-<option_name>=<TRUE/FALSE>] indicates that clients can see the value of option_name but can not modify the value.
7.14.3 Examples
Adding the following option to the my.cnf will set the minimum limit on query_cache_size
minimum-query_cache_size = 4M
86
Trying to set up bigger value will work correctly, but if we try to set it up with smaller than the limit, dened minimum limit will be used and warning (1292) will be issued: Initial query_cache_size size:
mysql> show variables like query_cache_size; +------------------+---------+ | Variable_name | Value | +------------------+---------+ | query_cache_size | 8388608 | +------------------+---------+ 1 row in set (0.00 sec)
87
Sequence number can be used to easily check if all the required bitmap les are present. Start LSN number will be used in XtraBackup and INFORMATION_SCHEMA queries to determine which les have to be opened and read for the required LSN interval data. The bitmap le is rotated on each server restart and whenever the current le size reaches the predened maximum. This maximum is controlled by a new innodb_max_bitmap_file_size variable. This feature will be used for implementing faster incremental backups that use this information to avoid full data scans in Percona XtraBackup.
7.15.1 User statements for handling the XtraDB changed page bitmaps
In Percona Server 5.5.29-30.0 new statements have been introduced for handling the changed page bitmap tracking. All of these statements require SUPER privilege. FLUSH CHANGED_PAGE_BITMAPS - this statement can be used for synchronous bitmap write for immediate catch-up with the log checkpoint. This is used by innobackupex to make sure that XtraBackup indeed has all the required data it needs. 88 Chapter 7. Management Improvements
RESET CHANGED_PAGE_BITMAPS - this statement will delete all the bitmap log les and restart the bitmap log le sequence. PURGE CHANGED_PAGE_BITMAPS BEFORE <lsn> - this statement will delete all the change page bitmap les up to the specied log sequence number.
89
variable innodb_track_changed_pages Version Info 5.5.27-29.0 Variable introduced Command Line Yes Cong File Yes Scope Global Dynamic No Variable Type Boolean Default Value 0 - False Range 0-1 variable innodb_max_bitmap_file_size Version Info 5.5.28-29.2 Variable introduced Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Numeric Default Value 104857600 (100 MB) Range 4096 (4KB) - 18446744073709551615 (16EB)
90
Oracle-compatible PAM called auth_pam_compat. This plugin uses mysql_clear_password which is a part of Oracle MySQL client. It also has some limitations, such as, it supports only one password input. You must use -p option in order to pass the password to auth_pam_compat. These two versions of plugins are physically different. To choose which one you want used, you must use IDENTIFIED WITH auth_pam for auth_pam, and IDENTIFIED WITH auth_pam_compat for auth_pam_compat.
7.16.1 Installation
This plugin requires manual installation because it isnt installed by default.
mysql> INSTALL PLUGIN auth_pam SONAME auth_pam.so;
After the plugin has been installed it should be present in the plugins list. To check if the plugin has been correctly installed and active
mysql> SHOW PLUGINS; ... ... | auth_pam
| ACTIVE
| AUTHENTICATION
| auth_pam.so | GPL
7.16.2 Conguration
In order to use the plugin, authentication method should be congured. Simple setup can be to use the standard UNIX authentication method (pam_unix). Note: To use pam_unix, mysql will need to be added to the shadow group in order to have enough privileges to read the /etc/shadow. A sample /etc/pam.d/mysqld le:
auth account required required pam_unix.so pam_unix.so
For added information in the system log, you can expand it to be:
auth auth account required required required pam_warn.so pam_unix.so audit pam_unix.so audit
This will create a user newuser that can connect from localhost who will be authenticated using the PAM plugin. If the pam_unix method is being used user will need to exist on the system.
group) and secondary groups developers and dba. A complete list of groups and users belonging to them can be checked with cat /etc/group command. This feature enables using secondary groups in the mapping part of the authentication string, like mysql, developers=joe, dba=mark. Previously only primary groups could have been specied there. If user is a member of both developers and dba, PAM plugin will map it to the joe because developers matches rst.
92
CHAPTER
EIGHT
DIAGNOSTICS IMPROVEMENTS
8.1 InnoDB Statistics
This feature provides new startup options (control method and collection of index statistics estimation) and information schema views to conrm the statistics.
93
variable innodb_stats_update_need_lock Type BOOLEAN Default Value 1 If you meet contention of &dict_operation_lock, setting 0 reduces the contention. But 0 disables to update Data_free: of SHOW TABLE STATUS. variable innodb_use_sys_stats_table Type BOOLEAN Default Value 0 If this option is enabled, XtraDB uses the SYS_STATS system table to store statistics of table indexes. Also, when InnoDB opens a table for the rst time, it loads the statistics from SYS_STATS instead of sampling index pages. If you use a high stats_sample_pages value, the rst open of a table is expensive. In such a case, this option will help. Intended behavior is to never update statistics unless an explicit ANALYZE TABLE is issued.
CLUST_INDEX_SIZE Number of pages on disk that store the clustered index. OTHER_INDEX_SIZE Number of pages on disk that store all secondary indexes. MODIFIED_COUNTER Number of rows modied by DML operations. AUTOINC MYSQL_HANDLES_OPENED table INFORMATION_SCHEMA.INNODB_SYS_INDEXES Shows the information about InnoDB indexes Columns INDEX_ID Index ID NAME Index Name TABLE_ID Table ID TYPE Numeric identier signifying the index type N_FIELDS Number of columns in the index PAGE_NO Page offset within its tablespace SPACE Tablespace ID table INFORMATION_SCHEMA.INNODB_SYS_COLUMNS Shows the information about the InnoDB table columns Columns TABLE_ID Table ID NAME Column Name POS Position of the column inside the table. MTYPE Numeric identier for the column type. PRTYPE Binary value with bits representing data type, character set code and nullability. LEN Column length. table INFORMATION_SCHEMA.INNODB_SYS_FIELDS Shows the information about the InnoDB index key elds. Columns INDEX_ID Index ID NAME Index Name POS Position of the eld inside the index. table INFORMATION_SCHEMA.INNODB_SYS_FOREIGN Shows the information about the InnoDB foreign keys. Columns ID Foreign Key ID FOR_NAME Database/Table which contains the Foreign Key FOR_REF Database/Table being referenced by the Foreign Key N_COLS Number of columns in the foreign key.
95
TYPE Type of foreign key, represented by the bit ags. table INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS Shows the information about the columns of the InnoDB foreign keys. Columns ID Foreign Key ID FOR_COL_NAME Foreign Key Column Name FOR_REF Referenced Column Name POS Position of the eld inside the index. table INFORMATION_SCHEMA.INNODB_TABLE_STATS Shows table statistics information of dictionary cached. Columns table_schema Database name of the table. table_name Table name. rows estimated number of all rows. clust_size cluster index (table/primary key) size in number of pages. other_size Other index (non primary key) size in number of pages. modied Internal counter to judge whether statistics recalculation should be done. If the value of modied column exceeds rows / 16 or 2000000000, the statistics recalculation is done when innodb_stats_auto_update == 1. We can estimate the oldness of the statistics by this value. table INFORMATION_SCHEMA.INNODB_INDEX_STATS Shows index statistics information of dictionary cached. Columns table_schema Database name of the table. table_name Table name. index_name Index name. elds How many elds the index key has. (it is internal structure of InnoDB, it may be larger than the CREATE TABLE). rows_per_key Estimate rows per 1 key value. ([1 column value], [2 columns value], [3 columns value], ...). index_total_pages Number of index pages. index_leaf_pages Number of leaf pages. In releases before 5.5.8-20.0, these elds had different names: rows_per_key was row_per_keys index_total_pages was index_size index_leaf_pages was leaf_pages
96
8.1.4 Example
[innodb_stats_method = nulls_equal (default behavior of InnoDB)]
mysql> explain SELECT COUNT(*), 0 FROM orgs2 orgs LEFT JOIN sa_opportunities2 sa_opportunities ON org +----+-------------+------------------+-------+-----------------+-----------------+---------+-------| id | select_type | table | type | possible_keys | key | key_len | ref +----+-------------+------------------+-------+-----------------+-----------------+---------+-------| 1 | SIMPLE | orgs | index | NULL | orgs$org_id | 4 | NULL | 1 | SIMPLE | sa_opportunities | ref | sa_opp$org_id | sa_opp$org_id | 5 | test2.o | 1 | SIMPLE | contacts | ref | contacts$org_id | contacts$org_id | 5 | test2.o +----+-------------+------------------+-------+-----------------+-----------------+---------+-------3 rows in set (0.00 sec)
mysql> explain SELECT COUNT(*), 0 FROM orgs2 orgs LEFT JOIN sa_opportunities2 sa_opportunities ON org +----+-------------+------------------+-------+-----------------+-----------------+---------+-------| id | select_type | table | type | possible_keys | key | key_len | ref +----+-------------+------------------+-------+-----------------+-----------------+---------+-------| 1 | SIMPLE | orgs | index | NULL | orgs$org_id | 4 | NULL | 1 | SIMPLE | sa_opportunities | ref | sa_opp$org_id | sa_opp$org_id | 5 | test2.o | 1 | SIMPLE | contacts | ref | contacts$org_id | contacts$org_id | 5 | test2.o +----+-------------+------------------+-------+-----------------+-----------------+---------+-------3 rows in set (0.00 sec) <example of information_schema> mysql> select * from information_schema.innodb_table_stats; +------------------------+-------+------------+------------+----------+ | table_name | rows | clust_size | other_size | modified | +------------------------+-------+------------+------------+----------+ | test/sa_opportunities2 | 11175 | 21 | 11 | 0 | | test/orgs2 | 128 | 1 | 0 | 0 | | test/contacts2 | 47021 | 97 | 97 | 0 | +------------------------+-------+------------+------------+----------+ 3 rows in set (0.00 sec) mysql> select * from information_schema.innodb_index_stats; +------------------------+-----------------+--------+--------------+------------+------------+ | table_name | index_name | fields | row_per_keys | index_size | leaf_pages | +------------------------+-----------------+--------+--------------+------------+------------+ | test/sa_opportunities2 | GEN_CLUST_INDEX | 1 | 1 | 21 | 20 | | test/sa_opportunities2 | sa_opp$org_id | 2 | 338, 1 | 11| 10 | | test/orgs2 | orgs$org_id | 1 | 1 | 1 | 1 | | test/contacts2 | GEN_CLUST_INDEX | 1 | 1 | 97 | 80 | | test/contacts2 | contacts$org_id | 2 | 516, 0 | 97 | 37 | +------------------------+-----------------+--------+--------------+------------+------------+ 5 rows in set (0.00 sec)
97
Default Value OFF Range ON/OFF Enables or disables collection of thread statistics. The default is OFF, meaning no thread statistics are gathered. This is to ensure that the statistics collection doesnt cause any extra load on the server unless desired. Variable userstat needs to be enabled as well in order for thread statistics to be collected. Note: In Percona Server 5.5 thread_statistics is a reserved word. Which means you have to quote it when using the system variable with the same name: mysql> set global thread_statistics=1;
99
DENIED_CONNECTIONS The number of connections denied to this client. LOST_CONNECTIONS The number of this clients connections that were terminated uncleanly. ACCESS_DENIED The number of times this clients connections issued commands that were denied. EMPTY_QUERIES The number of times this clients connections sent empty queries to the server. TOTAL_SSL_CONNECTIONS The number of times this clients connections connected using SSL to the server. This table holds statistics about client connections. The Percona version of the feature restricts this tables visibility to users who have the SUPER or PROCESS privilege. Example:
mysql> SELECT * FROM INFORMATION_SCHEMA.CLIENT_STATISTICS\G *************************** 1. row *************************** CLIENT: 10.1.12.30 TOTAL_CONNECTIONS: 20 CONCURRENT_CONNECTIONS: 0 CONNECTED_TIME: 0 BUSY_TIME: 93 CPU_TIME: 48 BYTES_RECEIVED: 5031 BYTES_SENT: 276926 BINLOG_BYTES_WRITTEN: 217 ROWS_FETCHED: 81 ROWS_UPDATED: 0 TABLE_ROWS_READ: 52836023 SELECT_COMMANDS: 26 UPDATE_COMMANDS: 1 OTHER_COMMANDS: 145 COMMIT_TRANSACTIONS: 1 ROLLBACK_TRANSACTIONS: 0 DENIED_CONNECTIONS: 0 LOST_CONNECTIONS: 0 ACCESS_DENIED: 0 EMPTY_QUERIES: 0 TOTAL_SSL_CONNECTIONS: 0
table INFORMATION_SCHEMA.INDEX_STATISTICS Columns TABLE_SCHEMA The schema (database) name. TABLE_NAME The table name. INDEX_NAME The index name (as visible in SHOW CREATE TABLE). ROWS_READ The number of rows read from this index. This table shows statistics on index usage. An older version of the feature contained a single column that had the TABLE_SCHEMA, TABLE_NAME and INDEX_NAME columns concatenated together. The Percona version of the feature separates these into three columns. Users can see entries only for tables to which they have SELECT access. This table makes it possible to do many things that were difcult or impossible previously. For example, you can use it to nd unused indexes and generate DROP commands to remove them. If the index has not been used it wont be in this table.
100
Example:
mysql> SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME=tables_priv; +--------------+-----------------------+--------------------+-----------+ | TABLE_SCHEMA | TABLE_NAME | INDEX_NAME | ROWS_READ | +--------------+-----------------------+--------------------+-----------+ | mysql | tables_priv | PRIMARY | 2 | +--------------+-----------------------+--------------------+-----------+
Note: Current implementation of index statistics doesnt support partitioned tables. table INFORMATION_SCHEMA.TABLE_STATISTICS Columns TABLE_SCHEMA The schema (database) name. TABLE_NAME The table name. ROWS_READ The number of rows read from the table. ROWS_CHANGED The number of rows changed in the table. ROWS_CHANGED_X_INDEXES The number of rows changed in the table, multiplied by the number of indexes changed. This table is similar in function to the INDEX_STATISTICS table. Example:
mysql> SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME=tables_priv; +--------------+-------------------------------+-----------+--------------+------------------------+ | TABLE_SCHEMA | TABLE_NAME | ROWS_READ | ROWS_CHANGED | ROWS_CHANGED_X_INDEXES | +--------------+-------------------------------+-----------+--------------+------------------------+ | mysql | tables_priv | 2 | 0 | 0 | +--------------+-------------------------------+-----------+--------------+------------------------+
Note: Current implementation of table statistics doesnt support partitioned tables. table INFORMATION_SCHEMA.THREAD_STATISTICS Columns THREAD_ID Thread ID TOTAL_CONNECTIONS The number of connections created from this thread. CONCURRENT_CONNECTIONS The number of concurrent connections from this thread. CONNECTED_TIME The cumulative number of seconds elapsed while there were connections from this thread. BUSY_TIME The cumulative number of seconds there was activity from this thread. CPU_TIME The cumulative CPU time elapsed while servicing this thread. BYTES_RECEIVED The number of bytes received from this thread. BYTES_SENT The number of bytes sent to this thread.
101
BINLOG_BYTES_WRITTEN The number of bytes written to the binary log from this thread. ROWS_FETCHED The number of rows fetched by this thread. ROWS_UPDATED The number of rows updated by this thread. TABLE_ROWS_READ The number of rows read from tables by this tread. SELECT_COMMANDS The number of SELECT commands executed from this thread. UPDATE_COMMANDS The number of UPDATE commands executed from this thread. OTHER_COMMANDS The number of other commands executed from this thread. COMMIT_TRANSACTIONS The number of COMMIT commands issued by this thread. ROLLBACK_TRANSACTIONS The number of ROLLBACK commands issued by this thread. DENIED_CONNECTIONS The number of connections denied to this thread. LOST_CONNECTIONS The number of thread connections that were terminated uncleanly. ACCESS_DENIED The number of times this thread issued commands that were denied. EMPTY_QUERIES The number of times this thread sent empty queries to the server. TOTAL_SSL_CONNECTIONS The number of thread connections that used SSL. In order for this table to be populated with statistics, additional variable thread_statistics should be set to ON. table INFORMATION_SCHEMA.USER_STATISTICS Columns USER The username. The value #mysql_system_user# appears when there is no username (such as for the slave SQL thread). TOTAL_CONNECTIONS The number of connections created for this user. CONCURRENT_CONNECTIONS The number of concurrent connections for this user. CONNECTED_TIME The cumulative number of seconds elapsed while there were connections from this user. BUSY_TIME The cumulative number of seconds there was activity on connections from this user. CPU_TIME The cumulative CPU time elapsed, in seconds, while servicing this users connections. BYTES_RECEIVED The number of bytes received from this users connections. BYTES_SENT The number of bytes sent to this users connections. BINLOG_BYTES_WRITTEN The number of bytes written to the binary log from this users connections. ROWS_FETCHED The number of rows fetched by this users connections. ROWS_UPDATED The number of rows updated by this users connections. TABLE_ROWS_READ The number of rows read from tables by this users connections. (It may be different from ROWS_FETCHED.)
102
SELECT_COMMANDS The number of SELECT commands executed from this users connections. UPDATE_COMMANDS The number of UPDATE commands executed from this users connections. OTHER_COMMANDS The number of other commands executed from this users connections. COMMIT_TRANSACTIONS The number of COMMIT commands issued by this users connections. ROLLBACK_TRANSACTIONS The number of ROLLBACK commands issued by this users connections. DENIED_CONNECTIONS The number of connections denied to this user. LOST_CONNECTIONS The number of this users connections that were terminated uncleanly. ACCESS_DENIED The number of times this users connections issued commands that were denied. EMPTY_QUERIES The number of times this users connections sent empty queries to the server. TOTAL_SSL_CONNECTIONS The number of times this users connections connected using SSL to the server. This table contains information about user activity. The Percona version of the patch restricts this tables visibility to users who have the SUPER or PROCESS privilege. The table gives answers to questions such as which users cause the most load, and whether any users are being abusive. It also lets you measure how close to capacity the server may be. For example, you can use it to nd out whether replication is likely to start falling behind. Example:
mysql> SELECT * FROM INFORMATION_SCHEMA.USER_STATISTICS\G *************************** 1. row *************************** USER: root TOTAL_CONNECTIONS: 5592 CONCURRENT_CONNECTIONS: 0 CONNECTED_TIME: 6844 BUSY_TIME: 179 CPU_TIME: 72 BYTES_RECEIVED: 603344 BYTES_SENT: 15663832 BINLOG_BYTES_WRITTEN: 217 ROWS_FETCHED: 9793 ROWS_UPDATED: 0 TABLE_ROWS_READ: 52836023 SELECT_COMMANDS: 9701 UPDATE_COMMANDS: 1 OTHER_COMMANDS: 2614 COMMIT_TRANSACTIONS: 1 ROLLBACK_TRANSACTIONS: 0 DENIED_CONNECTIONS: 0 LOST_CONNECTIONS: 0 ACCESS_DENIED: 0 EMPTY_QUERIES: 0 TOTAL_SSL_CONNECTIONS: 0
103
104
105
Default Value session Range session, query Species semantic of log_slow_rate_limit - session or query. variable log_slow_rate_limit Command Line Yes Cong File Yes Scope Global, session Dynamic Yes Behavior of this variable depends from log_slow_rate_type. Species that only a fraction of session/query should be logged. Logging is enabled for every nth session/query. By default, n is 1, so logging is enabled for every session/query. Please note: when log_slow_rate_type is session rate limiting is disabled for the replication thread. Logging all queries might consume I/O bandwidth and cause the log le to grow large. When log_slow_rate_type is session, this option lets you log full sessions, so you have complete records of sessions for later analysis; but you can rate-limit the number of sessions that are logged. Note that this feature will not work well if your application uses any type of connection pooling or persistent connections. Note that you change log_slow_rate_limit in session mode, you should reconnect for get effect. When log_slow_rate_type is query, this option lets you log just some queries for later analysis. For example, if you set the value to 100, then one percent of queries will be logged. Note that every query has global unique query_id and every connection can has it own (session) log_slow_rate_limit. Decision log or no calculated in following manner: if log_slow_rate_limit is 0 - log every query If log_slow_rate_limit > 0 - log query when (query_id % log_slow_rate_limit) is zero. This allows exible setup logging behavior. For example, if you set the value to 100, then one percent of sessions/queries will be logged. In Percona Server 5.5.34-32.0 information about the log_slow_rate_limit has been added to the slow query log. This means that if the log_slow_rate_limit is effective it will be reected in the slow query log for each written query. Example of the output looks like this:
Log_slow_rate_type: query Log_slow_rate_limit: 10
variable log_slow_slave_statements Command Line Yes Cong File Yes Scope Global, session Dynamic Yes Species that slow queries replayed by the slave SQL thread on a MySQL slave will be logged. Upstream version of the MySQL server has implemented command line option with same name. Signicant difference is that this feature is implemented as variable in Percona Server, that means it can be enabled/disabled dynamically without restarting the server.
106
To start the logging from the slave thread, you should change the global value: set global log_slow_slave_statements =ON; and then execute: STOP SLAVE; START SLAVE;. This will destroy and recreate the slave SQL thread, so it will see the newly set global value. To stop the logging from the slave thread, you should just change the global value: log_slow_slave_statements =OFF; the logging stops immediately. variable log_slow_sp_statements Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Boolean Default Value TRUE Range TRUE/FALSE If TRUE, statements executed by stored procedures are logged to the slow if it is open. Note: Support for logging stored procedures doesnt involve triggers, so they wont be logged even if this feature is enabled. variable log_slow_verbosity Version Info 5.5.8-20.0 Added profiling and profiling_use_getrusage Command Line Yes Cong File Yes Scope Global, session Dynamic Yes Species how much information to include in your slow log. The value is a comma-delimited string, and can contain any combination of the following values: microtime: Log queries with microsecond precision. query_plan: Log information about the querys execution plan. innodb: Log InnoDB statistics. minimal: Equivalent to enabling just microtime. standard: Equivalent to enabling microtime,innodb. full: Equivalent to all other values ORed together. profiling: Enables proling of all queries in all connections. profiling_use_getrusage: Enables usage of the getrusage function. Values are ORed together. For example, to enable microsecond query timing and InnoDB statistics, set this option to microtime,innodb or standard. To turn all options on, set the option to full. variable slow_query_log_timestamp_always set global
107
Version Info 5.5.10-20.1 Introduced (renamed from use_global_log_slow_control) Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Boolean Default Value FALSE Range TRUE/FALSE If TRUE, a timestamp is printed on every slow log record. Multiple records may have the same time. variable slow_query_log_timestamp_precision Version Info 5.5.10-20.1 Introduced (renamed from slow_query_log_microseconds_timestamp) Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Enumerated Default Value second Range second, microsecond Normally, entries to the slow query log are in seconds precision, in this format:
# Time: 090402 9:23:36 # User@Host: XXX @ XXX [10.X.X.X]
If slow_query_log_timestamp_precision =microsecond, entries to the slow query log are in microsecond precision, in this format:
# Time: 090402 9:23:36.123456 # User@Host: XXX @ XXX [10.X.X.X]
variable slow_query_log_use_global_control Command Line Yes Cong File Yes Scope Global Dynamic Yes Default Value None Version Info 5.5.10-20.1 Introduced (renamed from log_slow_timestamp_every) Species which variables have global scope instead of local. Value is a ag variable - you can specify multiple values separated by commas none: All variables use local scope
108
log_slow_filter: Global variable log_slow_filter has effect (instead of local) log_slow_rate_limit: Global variable log_slow_rate_limit has effect (instead of local) log_slow_verbosity: Global variable log_slow_verbosity has effect (instead of local) long_query_time: Global variable long_query_time has effect (instead of local) min_examined_row_limit: Global variable min_examined_row_limit has effect (instead of local) all Global variables has effect (instead of local) NOTE: This variable has been renamed from log_slow_timestamp_every since 5.5.10-20.1. variable slow_query_log_always_write_time Command Line Yes Cong File Yes Scope Global Dynamic Yes Default Value 10 (seconds) This variable can be used to specify the query execution time after which the query will be written to the slow query log. It can be used to specify an additional execution time threshold for the slow query log, that, when exceeded, will cause a query to be logged unconditionally, that is, log_slow_rate_limit will not apply to it.
# Query_time: 0.962742 Lock_time: 0.000202 Rows_sent: 4 Rows_examined: 1543719 Rows_affected: 0 # Bytes_sent: 278 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0 # Profile_starting: 0.000030 Profile_starting_cpu: 0.000028 Profile_Waiting_for_query_cache_lock: 0.0 Profile_Waiting_for_query_cache_lock_cpu: 0.000003 Profile_Waiting_on_query_cache_mutex: 0.000003 Profile_Waiting_on_query_cache_mutex_cpu: 0.000003 Profile_checking_query_cache_for_query: 0.000076 Profile_checking_query_cache_for_query_cpu: 0.000076 Profile_checking_permissions: 0.000011 Profile_checking_permissions_cpu: 0.000011 Profile_Opening_tables: 0.000078 Profile_Opening_tables_ Profile_System_lock: 0.000022 Profile_System_lock_cpu: 0.000022 Profile_Waiting_for_query_cache_loc Profile_Waiting_for_query_cache_lock_cpu: 0.000002 Profile_Waiting_on_query_cache_mutex: 0.000054 Profile_Waiting_on_query_cache_mutex_cpu: 0.000054 Profile_init: 0.000039 Profile_init_cpu: 0.00004 Profile_optimizing: 0.000015 Profile_optimizing_cpu: 0.000014 Profile_statistics: 0.000021 Profile_
109
Profile_preparing: 0.000020 Profile_preparing_cpu: 0.000020 Profile_executing: 0.000003 Profile_exe Profile_Sending_data: 0.962324 Profile_Sending_data_cpu: 0.961526 Profile_end: 0.000006 Profile_end Profile_query_end: 0.000004 Profile_query_end_cpu: 0.000004 Profile_closing_tables: 0.000008 Profil Profile_freeing_items: 0.000007 Profile_freeing_items_cpu: 0.000007 Profile_Waiting_for_query_cache Profile_Waiting_for_query_cache_lock_cpu: 0.000001 Profile_Waiting_on_query_cache_mutex: 0.000001 Profile_Waiting_on_query_cache_mutex_cpu: 0.000001 Profile_freeing_items: 0.000017 Profile_freeing_ Profile_Waiting_for_query_cache_lock: 0.000001 Profile_Waiting_for_query_cache_lock_cpu: 0.000001 Profile_Waiting_on_query_cache_mutex: 0.000000 Profile_Waiting_on_query_cache_mutex_cpu: 0.000001 Profile_freeing_items: 0.000001 Profile_freeing_items_cpu: 0.000001 Profile_storing_result_in_query Profile_storing_result_in_query_cache_cpu: 0.000002 Profile_logging_slow_query: 0.000001 Profile_lo # Profile_total: 0.962751 Profile_total_cpu: 0.961950 # InnoDB_trx_id: 1700
Connection and Schema Identier Each slow log entry now contains a connection identier, so you can trace all the queries coming from a single connection. This is the same value that is shown in the Id column in SHOW FULL PROCESSLIST or returned from the CONNECTION_ID() function. Each entry also contains a schema name, so you can trace all the queries whose default database was set to a particular schema.
# Thread_id: 11167745 Schema: board
Microsecond Time Resolution and Extra Row Information This is the original functionality offered by the microslow feature. Query_time and Lock_time are logged with microsecond resolution. The feature also adds information about how many rows were examined for SELECT queries, and how many were analyzed and affected for UPDATE, DELETE, and INSERT queries,
# Query_time: 0.962742 Lock_time: 0.000202 Rows_sent: 4 Rows_examined: 1543719 Rows_affected: 0
Values and context: Rows_examined: Number of rows scanned - SELECT Rows_affected: Number of rows changed - UPDATE, DELETE, INSERT Rows_read: Number of rows read - UPDATE, DELETE, INSERT Memory Footprint The feature provides information about the amount of bytes sent for the result of the query and the number of temporary tables created for its execution - differentiated by whether they were created on memory or on disk - with the total number of bytes used by them.
# Bytes_sent: 8053 Tmp_tables: 1 Tmp_disk_tables: 0 Tmp_table_sizes: 950528
Values and context: Bytes_sent: The amount of bytes sent for the result of the query Tmp_tables: Number of temporary tables created on memory for the query Tmp_disk_tables: Number of temporary tables created on disk for the query
110
Tmp_table_sizes: Total Size in bytes for all temporary tables used in the query Query Plan Information Each query can be executed in various ways. For example, it may use indexes or do a full table scan, or a temporary table may be needed. These are the things that you can usually see by running EXPLAIN on the query. The feature will now allow you to see the most important facts about the execution in the log le.
# QC_Hit: No Full_scan: Yes Full_join: No Tmp_table: No # Filesort: No Filesort_on_disk: No Merge_passes: 0 Tmp_table_on_disk: No
The values and their meanings are documented with the log_slow_filter option. InnoDB Usage Information The nal part of the output is the InnoDB usage statistics. MySQL currently shows many per-session statistics for operations with SHOW SESSION STATUS, but that does not include those of InnoDB, which are always global and shared by all threads. This feature lets you see those values for a given query.
# # # InnoDB_IO_r_ops: 6415 InnoDB_IO_r_bytes: 105103360 InnoDB_IO_r_wait: 0.001279 InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000 InnoDB_pages_distinct: 6430
Values: innodb_IO_r_ops: Counts the number of page read operations scheduled. The actual number of read operations may be different, but since this can be done asynchronously, there is no good way to measure it. innodb_IO_r_bytes: Similar to innodb_IO_r_ops, but the unit is bytes. innodb_IO_r_wait: Shows how long (in seconds) it took InnoDB to actually read the data from storage. innodb_rec_lock_wait: Shows how long (in seconds) the query waited for row locks. innodb_queue_wait: Shows how long (in seconds) the query spent either waiting to enter the InnoDB queue or inside that queue waiting for execution. innodb_pages_distinct: Counts approximately the number of unique pages the query accessed. The approximation is based on a small hash array representing the entire buffer pool, because it could take a lot of memory to map all the pages. The inaccuracy grows with the number of pages accessed by a query, because there is a higher probability of hash collisions. If the query did not use InnoDB tables, that information is written into the log instead of the above statistics.
This feature modied the SHOW ENGINE INNODB STATUS command as follows: TRANSACTION section was moved to the end of the output, so that important information is not overlooked when the there is a large amount of it. Added two variables to control SHOW ENGINE INNODB STATUS information presented (bugx for #29123): innodb_show_verbose_locks - Whether to show records locked innodb_show_locks_held - Number of locks held to print for each InnoDB transaction Added extended information about InnoDB internal hash table sizes (in bytes) in the BUFFER POOL AND MEMORY section; also added buffer pool size in bytes. Added additional LOG section information (beginning in release 5.5.8-20.0).
112
Dynamic Yes Variable Type ULONG Default Value 10 Range 0 - 1000 Species the number of locks held to print for each InnoDB transaction in SHOW ENGINE INNODB STATUS.
5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_background_log_sync Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global SEMAPHORES The following variables contain information in the SEMAPHORES section of the output from SHOW ENGINE INNODB STATUS. An example of that output is:
---------SEMAPHORES ---------OS WAIT ARRAY INFO: reservation count 9664, signal count 11182 Mutex spin waits 20599, rounds 223821, OS waits 4479 RW-shared spins 5155, OS waits 1678; RW-excl spins 5632, OS waits 2592 Spin rounds per wait: 10.87 mutex, 15.01 RW-shared, 27.19 RW-excl
variable Innodb_mutex_os_waits Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_mutex_spin_rounds Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_mutex_spin_waits Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_s_lock_os_waits Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global 114 Chapter 8. Diagnostics Improvements
variable Innodb_s_lock_spin_rounds Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_s_lock_spin_waits Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_x_lock_os_waits Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_x_lock_spin_rounds Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_x_lock_spin_waits Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global INSERT BUFFER AND ADAPTIVE HASH INDEX The following variables contain information in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the output from SHOW ENGINE INNODB STATUS. An example of that output is:
------------------------------------INSERT BUFFER AND ADAPTIVE HASH INDEX ------------------------------------Ibuf: size 1, free list len 6089, seg size 6091, 44497 inserts, 44497 merged recs, 8734 merges Hash table size 276707, node heap has 1 buffer(s) 0.00 hash searches/s, 0.00 non-hash searches/s
variable Innodb_ibuf_discarded_delete_marks Version Info 5.5.8-20.0 Introduced. 8.4. Extended Show Engine InnoDB Status 115
Variable Type Numeric Scope Global variable Innodb_ibuf_discarded_deletes Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_discarded_inserts Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_free_list Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_merged_delete_marks Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_merged_deletes Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_merged_inserts Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_merges Version Info 5.5.8-20.0 Introduced. Variable Type Numeric
116
Scope Global variable Innodb_ibuf_segment_size Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_ibuf_size Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_adaptive_hash_cells Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_adaptive_hash_heap_buffers Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_adaptive_hash_hash_searches Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_adaptive_hash_non_hash_searches Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global LOG The following variables contain information in the LOG section of the output from SHOW ENGINE INNODB STATUS. An example of that output is:
117
--LOG --Log sequence number 28219393219 Log flushed up to 28219393219 Last checkpoint at 28212583337 Max checkpoint age 7782360 Checkpoint age target 7539162 Modified age 6809882 Checkpoint age 6809882 0 pending log writes, 0 pending chkp writes 8570 log i/os done, 2000.00 log i/os/second
variable Innodb_lsn_current Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_lsn_flushed Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_lsn_last_checkpoint Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_checkpoint_age Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_checkpoint_max_age Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_checkpoint_target_age Version Info 5.5.8-20.0 Introduced.
118
Variable Type Numeric Scope Global BUFFER POOL AND MEMORY The following variables contain information in the BUFFER POOL AND MEMORY section of the output from SHOW ENGINE INNODB STATUS. An example of that output is:
---------------------BUFFER POOL AND MEMORY ---------------------Total memory allocated 137625600; in additional pool allocated 0 Total memory allocated by read views 88 Internal hash tables (constant factor + variable factor) Adaptive hash index 3774352 (2213656 + 1560696) Page hash 139144 Dictionary cache 629811 (554864 + 74947) File system 83536 (82672 + 864) Lock system 380792 (332872 + 47920) Recovery system 0 (0 + 0) Threads 84040 (82696 + 1344) Dictionary memory allocated 74947 Buffer pool size 8192 Buffer pool size, bytes 134217728 Free buffers 0 Database pages 8095 Old database pages 2968 Modified db pages 5914 Pending reads 0 Pending writes: LRU 0, flush list 129, single page 0 Pages made young 372084, not young 0 2546000.00 youngs/s, 0.00 non-youngs/s Pages read 103356, created 154787, written 979572 469000.00 reads/s, 78000.00 creates/s, 138000.00 writes/s Buffer pool hit rate 994 / 1000, young-making rate 34 / 1000 not 0 / 1000 Pages read ahead 0.00/s, evicted without access 15000.00/s
variable Innodb_mem_adaptive_hash Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_mem_dictionary Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_mem_total Version Info 5.5.8-20.0 Introduced. 8.4. Extended Show Engine InnoDB Status 119
Variable Type Numeric Scope Global variable Innodb_buffer_pool_pages_LRU_flushed Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_buffer_pool_pages_made_not_young Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_buffer_pool_pages_made_young Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_buffer_pool_pages_old Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_descriptors_memory Version Info 5.5.31-30.3 Introduced. Variable Type Numeric Scope Global This status variable shows the current size of the descriptors array (in bytes). The descriptor array is an XtraDB data structure that contains the information on currently running transactions. variable Innodb_read_views_memory Version Info 5.5.31-30.3 Introduced. Variable Type Numeric Scope Global This status variable shows the total amount of memory allocated for the InnoDB read view (in bytes).
120
OLDEST VIEW This part contains the information about the oldest active transaction in the system. An example of that output is:
---OLDEST VIEW--Normal read view Read view low limit trx n:o 3300 Read view up limit trx id 3300 Read view low limit trx id 3300 Read view individually stored trx ids:
Read view low limit trx n:o and Read view up limit trx id are the highest transactions IDs at the time the view was created. This means that it should not see newer transactions with IDs bigger than or equal to that value. Read view low limit trx id is the latest committed transaction ID at the time the oldest view was created. This means that it should see all transactions with IDs smaller than or equal to that value. Read view individually stored trx ids contains the list of active transactions at the time the view was created. TRANSACTIONS The following variables contain information in the TRANSACTIONS section of the output from SHOW ENGINE INNODB STATUS. An example of that output is:
-----------TRANSACTIONS -----------Trx id counter F561FD Purge done for trxs n:o < F561EB undo n:o < 0 History list length 19 LIST OF TRANSACTIONS FOR EACH SESSION: ---TRANSACTION 0, not started, process no 993, OS thread id 140213152634640 mysql thread id 15933, query id 32109 localhost root show engine innodb status ---TRANSACTION F561FC, ACTIVE 29 sec, process no 993, OS thread id 140213152769808 updating or deleti mysql tables in use 1, locked 1
variable Innodb_history_list_length Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_max_trx_id Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_oldest_view_low_limit_trx_id Version Info
121
5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_purge_trx_id Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_purge_undo_no Version Info 5.5.8-20.0 Introduced. Variable Type Numeric Scope Global variable Innodb_current_row_locks version 5.5.8-20.0 Introduced. version 5.5.10-20.1 Renamed. vartype Numeric scope Global This variable was named innodb_row_lock_numbers in release 5.5.8-20.0.
122
mysql> SHOW GLOBAL STATUS LIKE innodb_deadlocks; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | innodb_deadlocks | 323 | +------------------+-------+
mysql> SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = innodb_dead +----------------+ | VARIABLE_VALUE | +----------------+ | 323 | +----------------+
A deadlock will occur when at least two transactions are mutually waiting for the other to nish, thus creating a circular dependency that lasts until something breaks it. InnoDB is quite good at detecting deadlocks and generally returns an error instantly. Most transactional systems have no way to prevent deadlocks from occurring and must be designed to handle them, for instance by retrying the transaction that failed.
The range_base is some positive number (see Limitations). The interval is dened as the difference between two nearby powers of the range base. For example, if the range base=10, we have the following intervals:
(0; 10 ^ -6], (10 ^ -6; 10 ^ -5], (10 ^ -5; 10 ^ -4], ..., (10 ^ -1; 10 ^1], (10^1; 10^2]...(10^7; po
or
(0; 0.000001], (0.000001; 0.000010], (0.000010; 0.000100], ..., (0.100000; 1.0]; (1.0; 10.0]...(10000
124
For each interval, a count is made of the queries with execution times that fell into that interval. You can select the range of the intervals by changing the range base. For example, for base range=2 we have the following intervals:
(0; 2 ^ -19], (2 ^ -19; 2 ^ -18], (2 ^ -18; 2 ^ -17], ..., (2 ^ -1; 2 ^1], (2 ^ 1; 2 ^ 2]...(2 ^ 25;
or
(0; 0.000001], (0.000001, 0.000003], ..., (0.25; 0.5], (0.5; 2], (2; 4]...(8388608; positive infinity
Small numbers look strange (i.e., dont look like powers of 2), because we lose precision on division when the ranges are calculated at runtime. In the resulting table, you look at the high boundary of the range. For example, you may see:
+----------------+-------+------------+ | time | count | total | +----------------+-------+------------| | 0.000001 | 0 | 0.000000 | | 0.000010 | 17 | 0.000094 | | 0.000100 | 4301 | 0.236555 | | 0.001000 | 1499 | 0.824450 | | 0.010000 | 14851 | 81.680502 | | 0.100000 | 8066 | 443.635693 | | 1.000000 | 0 | 0.000000 | | 10.000000 | 0 | 0.000000 | | 100.000000 | 1 | 55.937094 | | 1000.000000 | 0 | 0.000000 | | 10000.000000 | 0 | 0.000000 | | 100000.000000 | 0 | 0.000000 | | 1000000.000000 | 0 | 0.000000 | | TOO LONG QUERY | 0 | 0.000000 | +----------------+-------+------------+
* 17 queries with 0.000001 < query execution time < = 0.000010 seconds; total execution time of the 1
* 4301 queries with 0.000010 < query execution time < = 0.000100 seconds; total execution time of the
* 1499 queries with 0.000100 < query execution time < = 0.001000 seconds; total execution time of the
* 14851 queries with 0.001000 < query execution time < = 0.010000 seconds; total execution time of th
* 8066 queries with 0.010000 < query execution time < = 0.100000 seconds; total execution time of the
* 1 query with 10.000000 < query execution time < = 100.0000 seconds; total execution time of the 1 q
8.7.1 Usage
SELECT You can get the distribution using the query:
> SELECT * from INFORMATION_SCHEMA.QUERY_RESPONSE_TIME time count total 0.000001 0 0.000000 0.000010 0 0.000000
125
0.000100 0.001000 0.010000 0.100000 1.000000 10.000000 100.000000 1000.000000 10000.000000 100000.000000 1000000.000000 TOO LONG QUERY
1 0 0 0 0 8 0 0 0 0 0 0
0.000072 0.000000 0.000000 0.000000 0.000000 47.268416 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
SELECT c.count, c.time, (SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_co (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as not_zero (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count > 0;
Note: If query_response_time_stats is ON, the execution times for these two SELECT queries will also be collected. SHOW Also, you can use this syntax:
> SHOW QUERY_RESPONSE_TIME; time count 0.000001 0 0.000010 0 0.000100 1 0.001000 0 0.010000 0 0.100000 0 1.000000 0 10.000000 8 100.000000 0 1000.000000 0 10000.000000 0 100000.000000 0 1000000.000000 0 TOO LONG QUERY 0 total 0.000000 0.000000 0.000072 0.000000 0.000000 0.000000 0.000000 47.268416 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
Note: The execution time for the SHOW query will also be collected. FLUSH Flushing can be done with:
FLUSH QUERY_RESPONSE_TIME;
FLUSH does two things: Clears the collected times from the QUERY_RESPONSE_TIME table Reads the value of query_response_time_range_base and uses it to set the range base for the table 126 Chapter 8. Diagnostics Improvements
Note: The execution time for the FLUSH query will also be collected. Stored procedures Stored procedure calls count as single query. Collect time point Time is collected after query execution completes (before clearing data structures).
8.7.2 Limitations
String width for seconds Value: 7 Compile-time variable: QUERY_RESPONSE_TIME_STRING_POSITIVE_POWER_LENGTH String width for microseconds Value: 6 Compile-time variable: QUERY_RESPONSE_TIME_STRING_NEGATIVE_POWER_LENGTH Minimum range base Value: 2 Compile-time variable: QUERY_RESPONSE_TIME_MINIMUM_BASE Minimum range base Value: 1000 Compile-time variable: QUERY_RESPONSE_TIME_MAXIMUM_BASE Minimum time interval Value: 1 microsecond Maximum time interval Value: 9999999 seconds
127
Dynamic No Variable Type Boolean Default Value YES Range YES/NO Contains the value YES if the server youre running supports this feature; contains NO if the feature is not supported. It is enabled by default. variable query_response_time_range_base Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Numeric Default Value 10 Range 2-1000 Sets up the logarithm base for the scale. Note: The variable takes effect only after this command has been executed:
FLUSH QUERY_RESPONSE_TIME;
variable query_response_time_stats Version Info 5.5.8-20.0 Introduced. Command Line Yes Cong File Yes Scope Global Dynamic Yes Variable Type Boolean Default Value OFF Range ON/OFF This variable enables and disables collection of query times if the feature is available in the server thats running. If the value of variable have_response_time_distribution is YES, then you can enable collection of query times by setting this variable to ON using SET GLOBAL. Prior to release 5.5.8-20.0, this variable was named enable_query_response_time_stats.
mysql> show storage engines; +------------+---------+----------------------------------------------------------------+-----------| Engine | Support | Comment | Transaction +------------+---------+----------------------------------------------------------------+-----------| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES ... +------------+---------+----------------------------------------------------------------+------------
mysql> show storage engines; +------------+---------+----------------------------------------------------------------------------+ | Engine | Support | Comment | +------------+---------+----------------------------------------------------------------------------+ | InnoDB | YES | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | ... +------------+---------+----------------------------------------------------------------------------+
129
| os_waits=415
130
mysql> show processlist; +------+-----------+-----------+--------+---------+------+------------+-----------------------------| Id | User | Host | db | Command | Time | State | Info +------+-----------+-----------+--------+---------+------+------------+-----------------------------| 2 | root | localhost | test | Query | 0 | NULL | SHOW PROCESSLIST | 14 | root | localhost | test | Query | 0 | User lock | SELECT GET_LOCK(t,1000) +------+-----------+-----------+--------+---------+------+------------+------------------------------
Table PROCESSLIST:
mysql> select * from information_schema.PROCESSLIST; +------+-----------+-----------+--------+---------+------+------------+-----------------------------| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO +------+-----------+-----------+--------+---------+------+------------+-----------------------------| 14 | root | localhost | test | Query | 0 | User lock | SELECT GET_LOCK(t,1000) | 2 | root | localhost | test | Query | 0 | executing | SELECT * from INFORMATION_SCH +------+-----------+-----------+--------+---------+------+------------+------------------------------
131
SESSION_ID MySQL connection id TABLE_SCHEMA Schema in which the temporary table is created TABLE_NAME Name of the temporary table ENGINE Engine of the temporary table NAME Internal name of the temporary table TABLE_ROWS Number of rows of the temporary table AVG_ROW_LENGTH Average row length of the temporary table DATA_LENGTH Size of the data (Bytes) INDEX_LENGTH Size of the indexes (Bytes) CREATE_TIME Date and time of creation of the temporary table UPDATE_TIME Date and time of the latest update of the temporary table This table holds information on the temporary tables existing for the running connection.
132
| index | 0 | 290 | 16 | 0 | 2 | | index | 0 | 304 | 17 | 0 | 0 | | allocated | 0 | 0 | 18 | 0 | 2 | | index | 0 | 10 | 19 | 0 | 0 | | index | 0 | 12973 | 20 | 0 | 0 | | index | 0 | 9 | 21 | 0 | 2 | | index | 0 | 12 | 22 | 0 | 0 | +-----------+----------+---------+--------------+-----------+------------+ 20 rows in set (0.81 sec)
This table shows the characteristics of the allocated pages in buffer pool and current state of them. table INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX Columns index_id index name space_id Tablespace ID page_no Page offset within its tablespace n_recs number of user records on page data_size sum of the sizes of the records in page hashed the block is in adaptive hash index (1) or not (0) access_time time of the last access to that page modied modied since loaded (1) or not (0) dirty modied since last ushed (1) or not (0) old is old blocks in the LRU list (1) or not (0) lru_position page position in the LRU list x_count reference count of a page. It is incremented every time the page is accessed by InnoDB, and is 0 if and only if the page is not currently being accessed ush_type type of the last ush of the page (0:LRU 2:ush_list) Example:
+----------+----------+---------+--------+-----------+--------+-------------+----------+-------+----| index_id | space_id | page_no | n_recs | data_size | hashed | access_time | modified | dirty | old +----------+----------+---------+--------+-----------+--------+-------------+----------+-------+----| 39 | 0 | 5787 | 468 | 14976 | 1 | 2636182517 | 1 | 0 | 1 | 40 | 0 | 5647 | 1300 | 15600 | 1 | 2636182517 | 1 | 0 | 1 | 39 | 0 | 5786 | 468 | 14976 | 1 | 2636182516 | 1 | 0 | 1 | 40 | 0 | 6938 | 1300 | 15600 | 1 | 2636193968 | 1 | 0 | 1 | 39 | 0 | 5785 | 468 | 14976 | 1 | 2636182514 | 1 | 0 | 1 | 39 | 0 | 5784 | 468 | 14976 | 1 | 2636182512 | 1 | 0 | 1 | 40 | 0 | 5646 | 1300 | 15600 | 1 | 2636182511 | 1 | 0 | 1 | 39 | 0 | 7203 | 468 | 14976 | 1 | 2636193967 | 1 | 0 | 1 | 39 | 0 | 5783 | 468 | 14976 | 1 | 2636182507 | 1 | 0 | 1 | 39 | 0 | 5782 | 468 | 14976 | 1 | 2636182506 | 1 | 0 | 1 +----------+----------+---------+--------+-----------+--------+-------------+----------+-------+-----
This table shows information about the index pages located in the buffer pool. table INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB Columns
133
space_id tablespace ID page_no page offset within its tablespace compressed contains compressed data (1) or not (0) part_len data length in the page next_page_no page number of the next data lru_position page position in the LRU list x_count reference count of a page. It is incremented every time the page is accessed by InnoDB, and is 0 if and only if the page is not currently being accessed ush_type type of the last ush of the page (0:LRU 2:ush_list) Example:
mysql> select * from information_schema.INNODB_BUFFER_POOL_PAGES_BLOB LIMIT 20; +----------+---------+------------+----------+--------------+--------------+-----------+------------+ | space_id | page_no | compressed | part_len | next_page_no | lru_position | fix_count | flush_type | +----------+---------+------------+----------+--------------+--------------+-----------+------------+ | 1748 | 111 | 0 | 10137 | 0 | 263 | 0 | 2 | | 1748 | 307 | 0 | 5210 | 0 | 1084 | 0 | 2 | | 1748 | 1329 | 0 | 6146 | 0 | 4244 | 0 | 2 | | 1748 | 1330 | 0 | 11475 | 0 | 4245 | 0 | 2 | | 1748 | 1345 | 0 | 5550 | 0 | 4247 | 0 | 2 | | 1748 | 1346 | 0 | 7597 | 0 | 4248 | 0 | 2 | | 1748 | 3105 | 0 | 6716 | 0 | 8919 | 0 | 2 | | 1748 | 3213 | 0 | 8170 | 0 | 9390 | 0 | 2 | | 1748 | 6142 | 0 | 5648 | 0 | 19638 | 0 | 2 | | 1748 | 7387 | 0 | 10634 | 0 | 24191 | 0 | 2 | | 1748 | 7426 | 0 | 5355 | 0 | 24194 | 0 | 2 | | 1748 | 7489 | 0 | 16330 | 7489 | 24196 | 0 | 2 | | 1748 | 7490 | 0 | 7126 | 0 | 24197 | 0 | 2 | | 1748 | 7657 | 0 | 13571 | 0 | 24681 | 0 | 2 | | 1748 | 7840 | 0 | 11208 | 0 | 25737 | 0 | 2 | | 1748 | 9599 | 0 | 11882 | 0 | 31989 | 0 | 2 | | 1748 | 11719 | 0 | 7367 | 0 | 40466 | 0 | 2 | | 1748 | 12051 | 0 | 11049 | 0 | 41441 | 0 | 2 | | 1748 | 12052 | 0 | 16330 | 12052 | 41442 | 0 | 2 | | 1748 | 12053 | 0 | 2674 | 0 | 41443 | 0 | 2 | +----------+---------+------------+----------+--------------+--------------+-----------+------------+ 20 rows in set (0.05 sec)
This table shows information from blob pages located in buffer pool.
134
trx_id Transaction ID - this is the id of the transaction that has currently allocated the undo segment and will potentially place undo records within it. More information on this transaction can be found by matching the trx_id with that in the INFORMATION_SCHEMA.INNODB_TRX table. rseg_id Rollback segment ID associated with this particular undo segment. More info on this rollback segment can be found by matching the rseg_id with that in the INFORMATION_SCHEMA.INNODB_RSEG. useg_id Undo segment ID type Segment type - identies what type of operation the segments is allocated for. state Segment state size Segment size in pages States of an undo log segment: ACTIVE - contains an undo log of an active transaction CACHED - cached for quick reuse TO_FREE - insert undo segment can be freed TO_PURGE - update undo segment will not be reused; it can be freed in purge when all undo data in it is removed PREPARED - contains an undo log of a prepared transaction
135
136
CHAPTER
NINE
Scope Global Dynamic No Variable Type Boolean Default Value ON Range ON/OFF
138
CHAPTER
TEN
REFERENCE
10.1 Development of Percona Server
Percona Server is an open source project to produce a distribution of the MySQL server with improved performance, scalability and diagnostics.
139
Making a change to a project In this case were going to use percona-xtrabackup as an example. workow is similar for Percona Server, but patch will need to be modied both in 5.1 and 5.5 branches. bzr branch lp:percona-xtrabackup featureX (where featureX is a sensible name for the task at hand) (developer makes changes in featureX, testing locally) Developer pushes to lp:~username/percona-xtrabackup/featureX When the developer thinks the branch may be ready to be merged, they will run the branch through param build. If there are any build or test failures, developer xes them (in the case of failing tests in trunk... no more tests should fail. Eventually all tests will pass in trunk) Developer can then submit a merge proposal to lp:percona-xtrabackup, referencing URL for the param build showing that build and test passes Code undergoes review Once code is accepted, it can be merged (see other section) If the change also applies to a stable release (e.g. 1.6) then changes should be made on a branch of 1.6 and merged to a branch of trunk. In this case there should be two branches run through param build and two merge proposals (one for 1.6 and one with the changes merged to trunk). This prevents somebody else having to guess how to merge your changes. Merging approved branches Before code hits trunk, it goes through a staging branch, where some extra tests may be run (e.g. valgrind) along with testing that all branches behave well together (build and test) before pushing to trunk. To ensure quality, DO NOT push directly to trunk! everything must go through adequate testing rst. This ensures that at any point trunk is in a releasable state. Please note that ALL changes must go through staging rst This is to ensure that several approved merge requests do not interact badly with each other. Merge captain (for lack of a better term for the person merging approved code into trunk) may collate several approved branches that have individually passed param-build as run by the original developers. Workow would look something like this: * bzr branch lp:percona-xtrabackup staging * bzr merge lp:~user/percona-xtrabackup/featureX * bzr commit -m "merge feature X" * bzr merge lp:~user/percona-xtrabackup/featureY * bzr commit -m "merge feature Y" * bzr push --overwrite lp:percona-xtrabackup/staging * Run lp:percona-xtrabackup/staging through param build (in future, well likely have a Jenkins job specically for this) * If build succeeds, bzr push lp:percona-server (and branches will be automatically marked as merged.. although bug reports will need to be manually changed to Fix Released)
140
* If build or test fails, attempt to nd which branch may be the cause, and repeat process but without that branch. Any failing branch will be set to Work in Progress with a Needs xing review with the URL of the build in jenkins where the failure occured. This will allow developers to x their code. Resubmitting a merge request In the event of a merge request being marked as Work In Progress due to build/test failures when merging, the developer should x up the branch, run through param build and then Resubmit the merge proposal. There is a link on launchpad to resubmit the merge proposal, this means it appears in the list of merge requests to review again rather than off in the work in progress section. Percona Server The same process for Percona Server, but we have different branches (and merge requests) for 5.1 and 5.5 series. Upgrading MySQL base version Same process as other modications. create local branch make changes param build merge request We will need some human processes to ensure that we do not merge extra things during the time when base MySQL version is being updated to avoid making life harder for the person doing the update.
10.1.3 Jenkins
Our Jenkins instance uses a mixture of VMs on physical hosts that Percona runs and Virtual Machines in Amazon EC2 that are launched on demand.
141
Basic Concepts We have some jobs that are activated based on source control changes (new commits in a bzr repository). We have some that are param build - that is, a user species parameters for the build (e.g. the bzr tree). A param-build allows developers to ensure their branch compiles and passes tests on all supported platforms before submitting a merge request. This helps us maintain the quality of the main bzr branches and not block other developers work. Jenkins is a Master/Slave system and the jenkins master schedules the builds across available machines (and may launch new VMs in EC2 to meet demand). Most of our jobs are whats known as matrix builds. That is, a job that will be run with several different congurations of the project (e.g. release, debug) across several platforms (e.g. on a host matching the label of centos5-32 and a host matching label of ubuntu-natty-32bit). Matrix builds show a table of lights to indicate their status. Clicking build now on one of these queues up builds for all of the combinations. We have some integration of our regression test suites (currently xtrabackup) with Jenkins ability to parse JUnitXML, presenting a nice user interface to any test failures. Because building some projects is non-trivial, in order to not duplicate the list of compile instructions for each job, we use template builds. Youll see builds such as percona-xtrabackup-template which is a disabled job, but all current xtrabackup jobs point to it for the commands to build and run the test suite. Percona Xtrabackup http://jenkins.percona.com/view/XtraBackup/ We currently build Xtrabackup 1.6, 2.0 and xtrabackup trunk (will become 2.1). There are param-builds for 1.6 and trunk too. These should be run for each merge request (and before any collection of merged branches is pushed to trunk) Percona Server We have separate jobs for Percona Server 5.1 and Percona Server 5.5 due to the different build systems that MySQL 5.1 and 5.5 use. The mysql-test-run.pl test suite is integrated with Jenkins through subunit and subunit2junitxml allowing us to easily see which tests passed/failed on any particular test run.
Percona Server 5.1
http://jenkins.percona.com/view/PS%205.1/ We have trunk and param jobs. We also have a valgrind job that will run after a successful trunk build.
Percona Server 5.5
142
MySQL Builds http://jenkins.percona.com/view/MySQL/ Ive set up a few jobs in Jenkins that should help us predict the future for Percona Server. Namely, if upstream MySQL may cause us any problems. I wanted to see if some test failures were possibly upstream, so I set up two jobs: http://jenkins.percona.com/view/MySQL/job/mysql-5.1-url-param/ http://jenkins.percona.com/view/MySQL/job/mysql5.5-url-param/ both of which ask for a URL to a MySQL source tarball and then do a full build and test across the platforms we have in jenkins. But my next thought was that we could try and do this before the source tarballs come out - hopefully then being able to have MySQL release source tarballs that do in fact pass build and test everywhere where were wanting to support Percona Server. http://jenkins.percona.com/view/MySQL/job/mysql-5.1-trunk/ http://jenkins.percona.com/view/MySQL/job/mysql5.5-trunk/ are scheduled to just try once per week (we can change the frequency if we want to) to build and test from the MySQL bzr trees. I also have a valgrind build (same conguration as for Percona Server) to help us see if theres any new valgrind warnings (or missed suppressions). Im hoping that these jobs will help us catch any future problems before they become our problem. (e.g. we can easily see that the sporadic test failures we see in Percona Server are actually in upstream MySQL).
immediately cease using the applicable Percona mark. If you do not immediately cease using the Percona mark upon revocation, Percona may take action to protect its rights and interests in the Percona mark. Percona does not grant any license to use any Percona mark for any other modied versions of Percona software; such use will require our prior written permission. Neither trademark law nor any of the exceptions set forth in this Trademark Policy permit you to truncate, modify or otherwise use any Percona mark as part of your own brand. For example, if XYZ creates a modied version of the Percona Server, XYZ may not brand that modication as XYZ Percona Server or Percona XYZ Server, even if that modication otherwise complies with the third exception noted above. In all cases, you must comply with applicable law, the underlying license, and this Trademark Policy, as amended from time to time. For instance, any mention of Percona trademarks should include the full trademarked name, with proper spelling and capitalization, along with attribution of ownership to Percona Inc. For example, the full proper name for XtraBackup is Percona XtraBackup. However, it is acceptable to omit the word Percona for brevity on the second and subsequent uses, where such omission does not cause confusion. In the event of doubt as to any of the conditions or exceptions outlined in this Trademark Policy, please contact trademarks@percona.com for assistance and we will do our very best to be helpful.
Upstream bug #69639 - mysql failed to build with dtrace Sun D 1.11 Launchpad bug #1196460 Upstream state Open (checked on 2013-08-26) Fix Released 5.5.33-31.1 Upstream x N/A
Upstream bug #68354 - Server crashes on update/join FEDERATED + local table when only 1 local... Launchpad bug #1182572 Upstream state N/A Fix Released 5.5.32-31.0 Upstream x N/A
Upstream bug #42415 - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... Launchpad bug #1132194 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.32-31.0 Upstream x N/A
Upstream bug #69179 - accessing information_schema.partitions causes plans to change Launchpad bug #1192354 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.32-31.0 Upstream x N/A Continued on next page
144
Table 10.1 continued from previous page Upstream bug #68970 - fsp_reserve_free_extents switches from small to big tblspace handling ... Launchpad bug #1169494 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.32-31.0 Upstream x N/A
Upstream bug #65077 - internal temporary tables are contended on THR_LOCK_myisam Launchpad bug #1179978 Upstream state Closed Fix Released 5.5.31-30.3 Upstream x N/A
Upstream bug #68999 - SSL_OP_NO_COMPRESSION not dened Launchpad bug #1183610 Upstream state Open (checked on 2013-08-26) Fix Released 5.5.31-30.3 Upstream x N/A
Upstream bug #68197 - InnoDB reports that its going to wait for I/O but the I/O is async Launchpad bug #1107539 Upstream state Closed Fix Released 5.5.30-30.2 Upstream x 5.5.31
Upstream bug #68845 Unnecessary mtr_log_reserve_and_write() Launchpad bug #1163439 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.30-30.2 Upstream x N/A
log_sys->mutex
reacquisition
in
Upstream bug #62578 - mysql client aborts connection on terminal resize Launchpad bug #925343 Upstream state Wont Fix Fix Released 5.5.30-30.2 Upstream x N/A
Upstream bug #49169 - read_view_open_now is inefcient with many concurrent sessions Launchpad bug #1131187 and #1131189 Upstream state Closed Fix Released 5.5.30-30.2 Upstream x N/A Continued on next page
145
Table 10.1 continued from previous page Upstream bug #63144 - CREATE TABLE IF NOT EXISTS metadata lock is too restrictive Launchpad bug #1127008 Upstream state Closed Fix Released 5.5.30-30.2 Upstream x N/A
Upstream bug #68477 - Suboptimal code in skip_trailing_space() Launchpad bug #1132351 Upstream state Closed Fix Released 5.5.30-30.1 Upstream x N/A
Upstream bug #68476 - Suboptimal code in my_strnxfrm_simple() Launchpad bug #1132350 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.30-30.1 Upstream x N/A
Upstream bug #68116 - InnoDB monitor may hit an assertion error in buf_page_get_gen in debug ... Launchpad bug #1100178 Upstream state Analyzing (checked on 2013-08-26) Fix Released 5.5.29-30.0 Upstream x N/A
Upstream bug #67504 - Duplicate error in replication with slave triggers and auto increment Launchpad bug #1068210 Upstream state Closed Fix Released 5.5.29-30.0 Upstream x N/A
Upstream bug #67983 - Memory leak on ltered slave Launchpad bug #1042946 Upstream state Closed Fix Released 5.5.29-30.0 Upstream x 5.5.31
Upstream bug #67974 - Server crashes in add_identier on concurrent ALTER TABLE and SHOW ENGINE Launchpad bug #1017192 Upstream state N/A Fix Released 5.5.29-30.0 Upstream x N/A Continued on next page
146
Table 10.1 continued from previous page Upstream bug #68045 - security vulnerability CVE-2012-4414 Launchpad bug #1049871 Upstream state N/A Fix Released 5.5.29-29.4 Upstream x N/A
Upstream bug #70277 - last argument of LOAD DATA ... SET ... statement repeated twice in binlog Launchpad bug #1223196 Upstream state Veried (checked on 2013-09-30) Fix Released 5.5.28-29.3 Upstream x N/A
Upstream bug #69380 - Incomplete x for security vulnerability CVE-2012-5611 Launchpad bug #1186748 Upstream state N/A Fix Released 5.5.28-29.3 Upstream x N/A
Upstream bug #66550 - security vulnerability CVE-2012-4414 Launchpad bug #1049871 Upstream state N/A Fix Released 5.5.28-29.3 Upstream x N/A
Upstream bug #67685 - security vulnerability CVE-2012-5611 Launchpad bug #1083377 Upstream state N/A Fix Released 5.5.28-29.3 Upstream x N/A
Upstream bug #66237 - Temporary les created by binary log cache are not purged after transa... Launchpad bug #1070856 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.28-29.3 Upstream x N/A
Upstream bug #69124 - Incorrect truncation of long SET expression in LOAD DATA can cause SQL ... Launchpad bug #1175519 Upstream state N/A Fix Released 5.5.28-29.3 Upstream x N/A Continued on next page
147
Table 10.1 continued from previous page Upstream bug #67606 - MySQL crashes with segmentation fault when disk quota is reached Launchpad bug #1079596 Upstream state Duplicate Fix Released 5.5.28-29.3 Upstream x N/A
Upstream bug #67737 - mysqldump test sometimes fails due to mixing stdout and stderr Launchpad bug #959198 Upstream state Closed Fix Released 5.5.28-29.2 Upstream x 5.5.29
Upstream bug #66890 - Slave server crash after a START SLAVE Launchpad bug #1053342 Upstream state Duplicate Fix Released 5.5.28-29.1 Upstream x 5.5.29
Upstream bug #62856 - Check for stack overrun doesnt work with gcc-4.6, server crashes Launchpad bug #1042517 Upstream state Closed Fix Released 5.5.28-29.1 Upstream x N/A
Upstream bug #61180 - korr/store macros in my_global.h assume the argument to be a char pointer Launchpad bug #1042517 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.27-29.0 Upstream x N/A
Upstream bug #61178 - Incorrect implementation of intersect(ulonglong) in non-optimized Bitmap.. Launchpad bug #1042517 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.27-29.0 Upstream x N/A
Upstream bug #54127 - mysqld segfaults when built using with-max-indexes=128 Launchpad bug #1042517 Upstream state Closed Fix Released 5.5.27-29.0 Upstream x N/A Continued on next page
148
Table 10.1 continued from previous page Upstream bug #64800 - mysqldump with include-master-host-port putting quotes around port no. Launchpad bug #1013432 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.27-28.0 Upstream x N/A
Upstream bug #66301 - INSERT ... odb_autoinc_lock_mode=1 is broken Launchpad bug #1035225 Upstream state Closed Fix Released 5.5.27-28.0 Upstream x N/A
ON
DUPLICATE
KEY
UPDATE
inn-
Upstream bug #60743 - typo in cmake/dtrace.cmake Launchpad bug #1013455 Upstream state Closed Fix Released 5.5.25a-27.1 Upstream x 5.5.33
Upstream bug #64663 - Segfault when adding indexes to InnoDB temporary tables Launchpad bug #999147 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.24-26.0 Upstream x N/A
Upstream bug #64624 - Mysql is crashing during replication Launchpad bug #915814 Upstream state Closed Fix Released 5.5.24-26.0 Upstream x 5.5.26
Upstream bug #64160 - page size 1024 but the only supported page size in this release is=16384 Launchpad bug #966844 Upstream state Closed Fix Released 5.5.21-25.1 Upstream x 5.5.22
Upstream bug #64432 - Bug #54330 (Broken fast index creation) was never xed in 5.5 Launchpad bug #939485 Upstream state Closed Fix Released 5.5.21-25.0 Upstream x 5.5.30 Continued on next page
149
Table 10.1 continued from previous page Upstream bug #49336 - mysqlbinlog does not accept input from stdin when stdin is a pipe Launchpad bug #933969 Upstream state Closed Fix Released 5.5.21-25.0 Upstream x 5.5.28
Upstream bug #62557 - SHOW SLAVE STATUS gives wrong output with master-master and using SET... Launchpad bug #860910 Upstream state Closed Fix Released 5.5.17-22.1 Upstream x 5.5.28
Upstream bug #45702 - Impossible to specify myisam_sort_buffer > 4GB on 64 bit machines Launchpad bug #878404 Upstream state Closed Fix Released 5.5.17-22.1 Upstream x 5.5.22
Upstream bug #62516 - Fast index creation does not update index statistics Launchpad bug #857590 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.16-22.0 Upstream x N/A
Upstream bug #25007 - memory tables with dynamic rows format Launchpad bug N/A Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.15-21.0 Upstream x N/A
Upstream bug #51196 - Slave SQL: Got an error writing communication packets, Error_code: 1160 Launchpad bug #813587 Upstream state Closed Fix Released 5.5.14-20.5 Upstream x 5.5.21
Upstream bug #43593 - dump/backup/restore/upgrade tools fails because of utf8_general_ci Launchpad bug N/A Upstream state Closed Fix Released 5.5.14-20.5 Upstream x 5.5.21 Continued on next page
150
Table 10.1 continued from previous page Upstream bug #61595 - mysql-test/include/wait_for_slave_param.inc timeout logic is incorrect Launchpad bug #800035 Upstream state Veried (checked on 2013-08-26) Fix Released 5.5.13-20.4 Upstream x N/A
Upstream bug #54160 - InnoDB should retry on failed read or write, not immediately panic Launchpad bug #764395 Upstream state Closed Fix Released 5.5.11-20.2 Upstream x N/A
Upstream bug #51325 - Dropping an empty innodb table takes a long time with large buffer pool Launchpad bug none Upstream state Closed Fix Released 5.5.10-20.1 Upstream x 5.5.20
Upstream bug #56433 - Auto-extension of InnoDB les Launchpad bug none Upstream state Closed Fix Released 5.5.10-20.1 Upstream x N/A
Upstream bug #20001 - Support for temp-tables in INFORMATION_SCHEMA Launchpad bug none Upstream state Closed Fix Released 5.5.8-20.0 Upstream x N/A
Upstream bug #69146 Optimization srv_buf_pool_instances Launchpad bug #1176496 Upstream state Open (checked on 2013-08-26) Fix Released 5.5.8-20.0 Upstream x N/A
in
buf_pool_get_oldest_modication
if
Upstream bug #54790 - Use of non-blocking mode for sockets limits performance Launchpad bug #606810 Upstream state Closed Fix Released 5.5.8-20.0 Upstream x N/A
151
152
innodb_read_ahead innodb_recovery_stats innodb_recovery_update_relay_log innodb_show_locks_held innodb_show_verbose_locks innodb_stats_auto_update innodb_stats_update_need_lock innodb_thread_concurrency_timer_based innodb_track_changed_pages innodb_use_atomic_writes innodb_use_global_flush_log_at_trx_commit innodb_use_sys_stats_table log_slow_admin_statements log_slow_filter log_slow_rate_limit log_slow_rate_type log_slow_slave_statements log_slow_sp_statements log_slow_verbosity log_warnings_suppress max_binlog_files optimizer_fix query_cache_strip_comments query_response_time_range_base query_response_time_stats slow_query_log_timestamp_always slow_query_log_timestamp_precision slow_query_log_use_global_control thread_pool_high_prio_tickets thread_pool_idle_timeout thread_pool_max_threads thread_pool_oversubscribe thread_pool_size thread_pool_stall_limit thread_statistics userstat
153
Innodb_lsn_last_checkpoint Innodb_master_thread_1_second_loops Innodb_master_thread_10_second_loops Innodb_master_thread_background_loops Innodb_master_thread_main_flush_loops Innodb_master_thread_sleeps Innodb_max_trx_id Innodb_mem_adaptive_hash Innodb_mem_dictionary Innodb_mem_total Innodb_mutex_os_waits Innodb_mutex_spin_rounds Innodb_mutex_spin_waits Innodb_oldest_view_low_limit_trx_id Innodb_purge_trx_id Innodb_purge_undo_no Innodb_current_row_locks Innodb_read_views_memory Innodb_descriptors_memory Innodb_s_lock_os_waits Innodb_s_lock_spin_rounds Innodb_s_lock_spin_waits Innodb_x_lock_os_waits Innodb_x_lock_spin_rounds Innodb_x_lock_spin_waits Threadpool_idle_threads Threadpool_threads binlog_commits binlog_group_commits
QUERY_RESPONSE_TIME TABLE_STATISTICS TEMPORARY_TABLES THREAD_STATISTICS USER_STATISTICS INNODB_RSEG INNODB_UNDO_LOGS INNODB_SYS_TABLESTATS INNODB_INDEX_STATS INNODB_CHANGED_PAGES INNODB_BUFFER_POOL_PAGES INNODB_BUFFER_POOL_PAGES_BLOB INNODB_BUFFER_POOL_PAGES_INDEX INNODB_SYS_TABLES INNODB_SYS_FIELDS INNODB_SYS_COLUMNS INNODB_SYS_STATS INNODB_SYS_FOREIGN INNODB_SYS_INDEXES XTRADB_ADMIN_COMMAND INNODB_TABLE_STATS INNODB_SYS_FOREIGN_COLS
10.6.2 Q: Will we have to GPL our whole application if we use Percona Server with XtraDB ?
A: This is a common misconception about the GPL. We suggest reading the Free Software Foundation s excellent reference material on the GPL Version 2, which is the license that applies to MySQL and therefore to Percona Server with XtraDB. That document contains links to many other documents which should answer your questions. Percona is unable to give legal advice about the GPL.
156
10.6.4 Q: When using the Percona XtraBackup to setup a replication slave on Debian based systems Im getting: ERROR 1045 (28000): Access denied for user debian-sys-maint@localhost (using password: YES)
A: In case youre using init script on Debian based system to start mysqld, be sure that the password for debian-sys-maint user has been updated and its the same as that users password from the server that the backup has been taken from. Password can be seen and updated in /etc/mysql/debian.cnf. For more information on how to set up a replication slave using Percona XtraBackup see this how-to.
10.8 Options that make XtraDB tablespaces not compatible with MySQL
10.8.1 Fast checksums
Enabling innodb_fast_checksum will use more CPU-efcient algorithm, based on 4-byte words which can be benecial for some workloads. Once enabled, turning it off will require table to be dump/imported again, since Percona Server will fail to start on data les created when innodb_fast_checksums was enabled. In case youve migrated from Percona Server to MySQL you could get the corrupted checksum error message. In order to recover that table youll need to: 1. Reinstall Percona Server to read your tables that were created with fast checksums. 2. Dump the tables (or temporarily convert them to MyISAM). 3. Install stock MySQL (or at least disable fast checksums). 4. Restore the InnoDB tables (or convert back from MyISAM).
157
information
A new variable slow_query_log_always_write_time has been introduced. It can be used to specify an additional execution time threshold for the slow query log, that, when exceeded, will cause a query to be logged unconditionally, that is, log_slow_rate_limit will not apply to it. Utility user feature has been extended by adding a new utility_user_privileges that allows a comma separated value list of extra access privileges that can be granted to the utility user. Bugs Fixed Due to an incompatible upstream change that went in unnoticed, the log tracker thread would attempt to replay any le operations it encountered. In most cases this were a no-op, but there were race conditions for certain DDL operations that would have resulted in server crash. Bug xed #1217002. apt-get upgrade of Percona Server would fail in post-installation step if server failed to start. Bug xed #1002500. Fixed the libssl.so.6 dependency issues in binary tarballs releases. Bug xed #1172916. Error in install_layout.cmake could cause that some library les, during the build, end up in different directories on x86_64 environment. Bug xed #1174300. Percona Server could crash while accessing BLOB or TEXT columns in InnoDB tables if Support for Fake Changes was enabled. Bug xed #1188168.
158
Memory leak was introduced by the x for bug #1132194. Bug xed #1204873. The unnecessary overhead from persistent InnoDB adaptive hash index latching has been removed, potentially improving stability of the Multiple Adaptive Hash Search Partitions feature as well. Upstream bug xed #70216, bug xed #1218347. Fixed the incorrect dependency with 5.5.33-31.1. Bug xed #1237097. libmysqlclient18-dev from Percona Server
A memory leak in Utility user feature has been xed. Bug xed #1166638. Expanded Program Option Modiers did not deallocate memory correctly. Bug xed #1167487. A server could crash due to a race condition between a INNODB_CHANGED_PAGES query and a bitmap le delete by PURGE CHANGED_PAGE_BITMAP or directly on the le system. Bug xed #1191580. Percona Server could not be built with Thread Pool feature and -DWITH_PERFSCHEMA_ENGINE=OFF option. Bug xed #1196383. Building Percona Server with -DHAVE_PURIFY option would result in an error. Fixed by porting the close_socket function from MariaDB. Bug xed #1203567. Adaptive hash index memory size was incorrectly calculated in SHOW ENGINE INNODB STATUS and Innodb_mem_adaptive_hash status variable. Bug xed #1218330. Some Expanded Program Option Modiers didnt have an effect if they were specied in non-normalized way (innodb_io_capacity vs innodb-io-capacity). Bug xed #1233294. Enabling Enforcing Storage Engine feature could lead to error on Percona Server shutdown. Bug xed #1233354. Storage engine enforcement (enforce_storage_engine) is now ignored when the server is started in either bootstrap or skip-grant-tables mode. Bug xed #1236938. Fixed the build warnings caused by User Statistics code on non-Linux platforms. Bug xed #711817. Adaptive hash indexing partitioning code has been simplied, potentially improving performance. Bug xed #1218321. Other bugs xed: bug xed #1239630, bug xed #1191589, bug xed #1200162, bug xed #1214449, and bug xed #1190604.
159
Changes made to the RPM scripts for previous Percona Server version caused installer to fail if there were different datadir options in multiple conguration les. Bug xed #1201036. Percona Server shared-compat package was being built with the 5.1.66 version of the client, which didnt work with OpenSSL. Fixed by building the shared-compat package with a more recent version. Bug xed #1201393. Fixed the upstream bug #69639 which caused compile errors for Percona Server with DTrace version Sun D 1.11 provided by recent SmartOS versions. Bug xed #1196460. Fixed a regression introduced in Percona Server 5.5.32-31.0, where server wouldnt be able to start if Atomic write support for Fusion-io devices was enabled. Bug xed #1214735. Percona Server used to acquire the buffer pool LRU list mutex in the I/O completion routine for the compressed page ush list ushes where it was not necessary. Bug xed #1181269. Other bugs xed: bug xed #1189743, bug xed #1188162 and bug xed #1203308.
Percona Server wouldnt start if the XtraDB changed page tracking was enabled and variable innodb_flush_method was set to ALL_O_DIRECT. Bug xed #1131949. Fixed the upstream bug #68970 that, in Percona Server, would cause small tablespaces to expand too fast around 500KB tablespace size. Bug xed #1169494. Query to the INNODB_CHANGED_PAGES table would cause server to stop with an I/O error if a bitmap le in the middle of requested LSN range was missing. Bug xed #1179974. Server would crash if an INNODB_CHANGED_PAGES query is issued that has an empty LSN range and thus does not need to read any bitmap les. Bug xed #1184427. Querying INFORMATION_SCHEMA.PARTITIONS could cause key distribution statistics for partitioned tables to be reset to those corresponding to the last partition. Fixed the upstream bug #69179. Bug xed #1192354. Incorrect schema denition for the User Statistics tables in INFORMATION_SCHEMA (CLIENT_STATISTICS, INDEX_STATISTICS, TABLE_STATISTICS, THREAD_STATISTICS, and USER_STATISTICS) led to the maximum counter values being limited to 32-bit signed integers. Fixed so that these values can be 64-bit unsigned integers now. Bug xed #714925.
160
Fixed the upstream bug #42415 that would cause UPDATE/DELETE statements with the LIMIT clause to be unsafe for Statement Based Replication even when ORDER BY primary key was present. Fixed by implementing an algorithm to do more elaborate analysis on the nature of the query to determine whether the query will cause uncertainty for replication or not. Bug xed #1132194. When an upgrade was performed between major versions (e.g. by uninstalling a 5.1 RPM and then installing a 5.5 one), mysql_install_db was still called on the existing data directory which lead to re-creation of the test database. Bug xed #1169522. XtraDB changed page tracking used to hold the log system mutex for the log reads needlessly, potentially limiting performance on write-intensive workloads. Bug xed #1171699. The RPM installer script had the datadir hardcoded to /var/lib/mysql instead of using my_print_defaults function to get the correct datadir info. Bug xed #1181753. Missing path separator between the directory and le name components in a bitmap le name could stop the server starting if the innodb_data_home_dir variable didnt have the path separator at the end. Bug xed #1181887. Fixed the upstream bug #68354 that could cause server to crash when performing update or join on Federated and MyISAM tables with one row, due to a bug in the Federated storage engine. Bug xed #1182572. A warning is now returned if a bitmap le I/O error occurs after an INNODB_CHANGED_PAGES query started returning data to indicate an incomplete result set. Bug xed #1185040. Under very rare circumstances, deleting a zero-size bitmap le at the right moment would make server stop with an I/O error if changed page tracking is enabled. Bug xed #1184517. Fixed the compiler warnings caused by Atomic write support for Fusion-io devices when building Percona Server on non-Linux platforms. Bug xed #1189429. The INNODB_CHANGED_PAGES table couldnt be queried if the log tracker wasnt running. Bug xed #1185304. Transaction objects are now allocated calling calloc() directly instead of using InnoDB heap allocation. This may improve write performance for high levels of concurrency. Bug xed #1185686. Other bugs xed: bug xed #1099764, bug xed #1132412, bug xed #1191395, bug xed #1079688, bug xed #1132422, bug xed #1153651, bug xed #1160951, bug xed #1183583, bug xed #1133266.
Bug Fixes Fix for bug #1131187 introduced a regression that could cause a memory leak if query cache was used together with InnoDB. Bug xed #1170103. Fixed RPM packaging regression that was introduced with the x for bug #710799. This regression caused mysql schema to be missing after the clean RPM installation. Bug xed #1174426. Fixed the Percona-Server-shared-55 and Percona-XtraDB-Cluster-shared RPM package dependences. Bug xed #1050654. Fixed the upstream bug #68999 which caused compiling Percona Server to fail on CentOS 5 and Debian squeeze due to older OpenSSL version. Bug xed #1183610. If a slave was running with its binary log enabled and then restarted with the binary log disabled, Crash-Resistant Replication could overwrite the relay log info log with an incorrect position. Bug xed #1092593. Fixed the CVE-2012-5615 vulnerability. This vulnerability would allow remote attacker to detect what user accounts exist on the server. This bug x comes originally from MariaDB (see MDEV-3909). Bug xed #1171941. Fixed the CVE-2012-5627 vulnerability, where an unprivileged MySQL account owner could perform brute-force password guessing attack on other accounts efciently. This bug x comes originally from MariaDB (see MDEV-3915). Bug xed #1172090. mysql_set_permission was failing on Debian due to missing libdbd-mysql-perl package. Fixed by adding the package dependency. Bug xed #1003776. Rebuilding Debian source package would fail because dpatch and automake were missing from builddep. Bug xed #1023575 (Stephan Adig). Backported the x for the upstream bug #65077 from the MySQL 5.6 version, which removed MyISAM internal temporary table mutex contention. Bug xed #1179978.
162
Known Issues This release contains a regression introduced by the x for bug #1131187. The workaround is to disable the query cache. Regression is reported as bug #1170103. Bug Fixes Due to parse error in the percona-server.spec Percona Server rpm packages couldnt be built on RHEL 5 and CentOS 5. Bug xed #1144777 (Ignacio Nin). When mysqldump was used with --innodb-optimize-keys option it produced invalid SQL for cases when there was an explicitly named foreign key constraint which implied an implicit secondary index with the same name. Fixed by detecting such cases and omitting the corresponding secondary keys from deferred key creation optimization. Bug xed #1081016 (Alexey Kopytov). Percona Server was built with YaSSL which could cause some of the programs that use it to crash. Fixed by building packages with OpenSSL support rather than the bundled YaSSL library. Bug xed #1104977 (Ignacio Nin). Running a DDL statement while innodb_lazy_drop_table was enabled could cause assertion failure. Bugs xed #1086227 and #1128848 (Laurynas Biveinis). Fixed yum dependencies that were causing conicts in CentOS 6.3 during installation. Bugs xed #1031427 and #1051874 (Ignacio Nin). The log tracker thread was unaware of the situation when the oldest untracked log records are overwritten by the new log data. In some corner cases this could lead to assertion errors in the log parser or bad changed page data. Bug xed #1108613 (Laurynas Biveinis). Ported a x from MariaDB for the upstream bug #63144. CREATE TABLE or CREATE TABLE IF NOT EXISTS statements on an existing table could wait on a metadata lock instead of failing or returning immediately if there is a transaction that executed a query which opened that table. Bug xed #1127008 (Sergei Glushchenko). Fix for bug #1070856 introduced a regression in Percona Server 5.5.28-29.3 which could cause a server to hang when binary log is enabled. Bug xed #1162085 (Alexey Kopytov). Fixed upstream bug #49169 by avoiding the malloc call in the read_view_create_low() in most cases. This signicantly improves InnoDB scalability on read-only workloads, especially when the default glibc memory allocator is used. Bug xed #1131187 (Alexey Kopytov). Removed trx_list scan in read_view_open_now() which is another problem originally reported as upstream bug #49169. This also provides much better scalability in InnoDB high-concurrent workloads. Bugs xed #1131189 (Alexey Kopytov). In the event that a slave was disconnected from the master, under certain conditions, upon reconnect, it would report that it received a packet larger than the slave_max_allowed_packet variable. Bug xed #1135097 (George Ormond Lorch III ). Fixed the upstream bug #62578 which caused MySQL client to abort the connections on terminal resize. Bug xed #925343 (Sergei Glushchenko). Percona Server would re-create the test database when using rpm on server upgrade, even if the database was previously removed. Bug xed #710799 (Alexey Bychko). Debian packages included the old version of innotop. Fixed by removing innotop and its InnoDBParser Perl package from source and Debian installation. Bug xed #1032139 (Alexey Bychko). UDF/congure.ac was incompatible with automake 1.12. Bug xed #1099387 (Alexey Bychko).
163
Reduced the overhead from innodb_pass_corrupt_table value checks by optimizing them for better CPU branch prediction. Bug xed #1125248 (Alexey Kopytov). dialog.so used by the PAM Authentication Plugin couldnt be loaded with Perl and Python clients when plugin-dir option was set in the [client] section of the my.cnf. Bug xed #1155859 (Sergei Glushchenko). Fixed the upstream bug #68845 which could unnecessarily increase contention on log_sys->mutex in write-intensive workloads. Bug xed #1163439 (Alexey Kopytov). Ported back from the upstream MySQL 5.6 the x for unnecessary log_flush_order_mutex acquisition. Bug xed #1163262 (Alexey Kopytov). When mysqldump was used with --innodb-optimize-keys and --no-data options, all secondary key denitions would be lost. Bug xed #989253 (Alexey Kopytov). Warning about the Percona Toolkit UDFs was omitted when installing from Perconas Debian repositories. Bug xed #1015506 (Alexey Bychko). Percona Server was missing help texts in the MySQL client because the help tables were missing. Bug xed #1041981 (Alexey Bychko). Fixed the upstream bug #68197 that caused InnoDB to misclassify internal read operations as synchronous when they were actually asynchronous when Thread Pool feature was used. Bug xed #1107539 (Sergei Glushchenko). Suboptimal code for User Statistics feature has been optimized to make sure no additional work is done when userstat is disabled. Bug xed #1128066 (Alexey Kopytov). Other bug xes: bug xed #1103850 (Laurynas Biveinis), bug xed #1146621 (Laurynas Biveinis), bug xed #1050536 (Alexey Bychko), bug xed #1144059 (Roel Van de Paar), bug xed #1154962 (Hrvoje Matijakovic), bug xed #1154959 (Hrvoje Matijakovic), bug xed #1154957 (Hrvoje Matijakovic), bug xed #1154954 (Hrvoje Matijakovic).
164
The static srv_pass_corrupt_table variable could share CPU cache lines with InnoDB row counters, which resulted in high false sharing effect in high-concurrent workloads. Bug xed #1125259 (Alexey Kopytov). Fixed the regression introduced with x for bug #791030 in Percona Server 5.5.13-20.4 by implementing an optimized version of the same function. Bug xed #1130655 (Alexey Kopytov). Potentially improve server performance by implementing an optimized version of the my_strnxfrm_simple function. Bug xed #1132350, upstream bug xed #68476 (Alexey Kopytov). Potentially improve server performance by implementing an optimized version of the skip_trailing_space function. Bug xed #1132351, upstream bug xed #68477 (Alexey Kopytov). Other bug xes: bug xed #1089265 (Laurynas Biveinis).
165
The XtraDB used to print the open read view list without taking the kernel mutex. Thus any list element might become invalid during its iteration. Fixed by taking the kernel mutex. Bug xed #1101030 (Laurynas Biveinis). When option innodb_flush_method=O_DIRECT was set up, log bitmap les were created and treated as InnoDB data les for ushing purposes, which wasnt original intention. Bug xed #1105709 (Laurynas Biveinis). INFORMATION_SCHEMA plugin name innodb_changed_pages serves also as a command line option, but it is also a prex of another command line option innodb_changed_pages_limit. MySQL option handling would then shadow the former with the latter, resulting in start up errors. Fixed by renaming the innodb_changed_pages_limit option to innodb_max_changed_pages. Bug xed #1105726 (Laurynas Biveinis). Time in slow query log was displayed incorrectly when slow_query_log_timestamp_precision variable was set to microseconds. Bug xed #887928 (Laurynas Biveinis). Writing bitmap larger than 4GB would cause write to fail. Also a write error for every bitmap page, except the rst one, would result in a heap corruption. Bug xed #1111226 (Laurynas Biveinis). Fixed the upstream bug #67504 that caused spurious duplicate key errors. Errors would happen if a trigger is red while a slave was processing replication events for a table that is present only on slave server while there are updates on the replicated table on the master which is used in that trigger. For this to happen master needs to have more than one auto-increment table and the slave needs to have at least one of those tables specied in the replicate-ignore-table. Bug xed #1068210 (George Ormond Lorch III ). Fixed failing rpm builds, that were caused by missing les. Bug xed #1099809 (Alexey Bychko). Fixed the upstream #68116 that caused the server crash with assertion error when InnoDB monitor with verbose lock info was used under heavy load. This bug is affecting only -debug builds. Bug xed #1100178 (Laurynas Biveinis). XtraDB changed page tracking wasnt compatible with innodb_force_recovery=6. When starting the server log tracking initialization would fail. The server would abort on startup. Bug xed #1083596 (Laurynas Biveinis). Newly created bitmap le would silently overwrite the old one if they had the same le name. Bug xed #1111144 (Laurynas Biveinis). A server would stop with an assertion error in I/O and AIO routines if large innodb_log_block_size value is used in the combination with changed page tracking. Bug xed #1114612 (Laurynas Biveinis). Optimizer_fix patch has been removed from Percona Server. Bug xed #986247 (Stewart Smith). InnoDB monitor was prefetching the data pages for printing lock information even if no lock information was going to be printed. Bug xed #1100643 (Laurynas Biveinis). InnoDB and the query plan information were being logged even if they werent enabled for the slow query log. Bug xed #730173 (Laurynas Biveinis). Fixed the incorrect help text for slow_query_log_timestamp_precision. Bug xed #1090965 (Laurynas Biveinis). Other bug xes: bug xed #909376 (Laurynas Biveinis), bug xed #1082437 (Laurynas Biveinis), bug xed #1083669 (Laurynas Biveinis), bug xed #1096904 (Laurynas Biveinis), bug xed #1091712 (Laurynas Biveinis), bug xed #1096899 (Laurynas Biveinis), bug xed #1088954 (Laurynas Biveinis), bug xed #1096895 (Laurynas Biveinis), bug xed #1092142 (Laurynas Biveinis), bug xed #1090874 (Laurynas Biveinis), bug xed #1089961 (Laurynas Biveinis), bug xed #1088867 (Laurynas Biveinis), bug xed #1089031 (Laurynas Biveinis), bug xed #1108874 (Laurynas Biveinis).
166
167
Upstream bug #67606 would cause Percona Server to crash with segmentation fault when disk quota was reached. Bug xed #1079596 (George Ormond Lorch III ). In cases where indexes with AUTO_INCREMENT columns where correctly detected, mysqldump prevented all such keys from optimization, even though it is sufcient to skip just one (e.g. the rst one). Bug xed #1081003 (Alexey Kopytov). Other bug xes: bug xed #1071986 (Alexey Kopytov), bug xed #901060 (Laurynas Biveinis), bug xed #1090596 (Stewart Smith), bug xed #1087202 (Vladislav Vaintroub, Laurynas Biveinis) and bug xed #1087218 (Vladislav Vaintroub, Laurynas Biveinis).
168
Fake changes were increasing the changed row and userstat counters. Bug xed #1064333 (Laurynas Biveinis). Log tracking was initialized too late during the InnoDB startup. Bug xed #1076892 (Laurynas Biveinis). Debuginfo Debian packages have been added for Percona Server. Bugs xed #711062 and #1043873 (Ignacio Nin). There is no need to scan buffer pool for AHI entries after the B-trees for the tablespace have been dropped, as that will already clean them. Bug xed #1076215 (Laurynas Biveinis). Slow Query Log code did not handle the case of individual statements in stored procedures correctly. This caused Query_time to increase for every query stored procedure logged to the slow query log. Bug xed #719386 (Alexey Kopytov). Other bug xes: bug xed #890404 (Laurynas Biveinis), bug xed #1071877 (Laurynas Biveinis), bug xed #1050466 (Laurynas Biveinis).
Based on MySQL 5.5.27, including all the bug xes in it, Percona Server 5.5.27-29.0 is now the current stable release in the 5.5 series. All of Perconas software is open-source and free, all the details of the release can be found in the 5.5.27-29.0 milestone at Launchpad. New Features Percona Server now supports XtraDB changed page tracking. This feature will be used for implementing faster incremental backups that use this information to avoid full data scans. Number of binlog les can be restricted when using Percona Server with the new max_binlog_files option. Bug Fixes Fixed server assertion error related to buffer pool, only visible in debug builds. Bug xed #905334 (Stewart Smith). Fix for bug #978036 introduced the innodb_sys_stats_root_page debugging option (only present in debug builds), rendering the previously-existing innodb_sys_stats option its prex. As such, it became unsettable from command line. Fixed by renaming innodb_sys_stats_root_page to innodb_persistent_stats_root_page. Bug xed #1013644 (Laurynas Biveinis). Multiple adaptive hash index partitions would cause overly large hash index. Fixed by changing the way partition sizes are calculated initially. Bug xed #1018264 (George Ormond Lorch III ). Postx would crash on CentOS/RHEL 6.x when using shared dependency (libmysqlclient.so). Fixed by building packages with OpenSSL support rather than the bundled YaSSL library. Bug xed #1028240 (Ignacio Nin). Fixed the issue where LRU dump would hold LRU_list_mutex during the entire dump process. Now the mutex is periodically released in order not to block server while the dump is in progress. Bug xed #686534 (George Ormond Lorch III ). Option expire_logs_days was broken by group_commit patch introduced in Percona Server 5.5.18-23.0. Bug xed #1006214 (Stewart Smith). Fixed issue where innodb_blocking_lru_restore did not take an optional bool argument similar to other bool options. Bug xed #881001 (George Ormond Lorch III ). The binlog shouldnt be rotated while it contains XA transactions in the PREPARED state. Bug xed #1036040 (Stewart Smith). Flashcache support resulted in confusing messages in the error log on Percona Server startup even when ashcache was not used. This was xed by adding new boolean option flashcache. When set to 0 (default), ashcache checks are disabled and when set to 1 checks are enabled. Error message has been made more verbose including error number and system error message as well. Bug xed #747032 (Sergei Glushchenko). Custom server builds would crash when compiled with a non-default maximum number of indexes per table. Upstream MySQL bugs: #54127, #61178, #61179 and #61180. Bug xed #1042517 (Sergei Glushchenko).
170
Based on MySQL 5.5.27, including all the bug xes in it, Percona Server 5.5.27-28.1 is now the current stable release in the 5.5 series. All of Perconas software is open-source and free, all the details of the release can be found in the 5.5.27-28.1 milestone at Launchpad. Bug Fixes Percona Server 5.5.27-28.0 would crash or deadlock in XtraDB buffer pool code. This was caused by incorrect mutex handling in porting of the recently introduced InnoDB code to XtraDB. Bug xed #1038225 (Laurynas Biveinis). Variables innodb_adaptive_flushing_method and innodb_flush_neighbor_pages would not correctly translate some values internally. Bug xed #1039384 (Laurynas Biveinis).
171
as a result, lost data due to some rows being updated rather than inserted) with the default value of innodb_autoinc_lock_mode=1. Bug xed #1035225 (Alexey Kopytov). Removed error log warnings that occured after enabling innodb_use_sys_stats_table and before ANALYZE TABLE is run for each table. Bug xed #890623 (Alexey Kopytov). Removed the unneeded lrusort.py script. The server now does this sorting automatically and has done for some time. Bug xed #882653 (Stewart Smith). Fixed the malformed CHANGE MASTER query in the output of --include-master-host-port option. Bug xed #1013432 (Stewart Smith). mysqldump with
172
Fixed upstream mysql bug #60743, typo in cmake/dtrace.cmake that was making dtrace unusable. Bug xed #1013455 (Stewart Smith). Other bugxes: bug #1022481 (Ignacio Nin) and bug #987348 (Ignacio Nin).
173
Bug Fixes Percona Server would crash on a DDL statement if an XtraDB internal SYS_STATS table was corrupted or overwritten. This is now xed by detecting the corruption and creating a new SYS_STATS table. Bug xed #978036 (Laurynas Biveinis).
174
New Features Slow query logging features have been expanded by adding new variable log_slow_rate_type. It now provides option to specify the query sampling being taken. If the variable is set up to query, sampling is done on per query basics instead of session, which is the default (Oleg Tsarev). Bug Fixes Fixed MySQL bug #49336, mysqlbinlog couldnt handle stdin when | used. Bug xed: #933969 (Sergei Glushchenko). Fixed MySQL bugs: #64432 and #54330, broken fast index creation. Bug xed: #939485 (Laurynas Biveinis).
175
Bug Fixes Minor MEMORY engine test suite x: #849921 (Laurynas Biveinis) A x for testsuite integration into Jenkins: #911237 (Oleg Tsarev)
176
Based on MySQL 5.5.17, including all the bug xes in it, Percona Server 5.5.17-22.1 is now the current stable release in the 5.5 series. All of Percona s software is open-source and free, all the details of the release can be found in the 5.5.17-22.1 milestone at Launchpad. Bug Fixes MyISAM repair-by-sort buffer could not be greater than 4GB even on 64bit architectures. Bug Fixed: #878404 (Alexey Kopytov). The kill idle transactions feature in XtraDB (if enabled) could sometimes cause the server to crash. Bug Fixed: #871722 (Yasufumi Kinoshita). In a master-master setup when using SET user variables it was possible to have SHOW SLAVE STATUS give incorrect output due to a corrupted relay log. Bug Fixed: #860910 (Alexey Kopytov).
177
Behavior changes The Fast Index Creation Feature has been disabled by default to align the behavior with upstream. The boolean variable innodb_expand_fast_index_creation has been introduced for enabling or disabling this feature. Bug Fixed: #858945 (Alexey Kopytov).
Bug Fixes
XtraDB requires a full table rebuild for foreign key changes. This unnecessarily delays their creation in a mysqldump output, so --innodb-optimize-keys should ignore foreign key constrains. Bug Fixed: #859078 (Alexey Kopytov). After adding an index using the Fast Index Creation Feature, statistics for that index provided by XtraDB were left in a bogus state until an explicit ANALYZE TABLE is executed. Bug Fixed: #857590 (Alexey Kopytov). QUERY_RESPONSE_TIME did not respect QUERY_RESPONSE_TIME_STATS. Bug Fixed: #855312 (Oleg Tsarev). The mysqldump option --innodb-optimize-keys did not work correctly with tables where the rst UNIQUE key on non-nullable columns was picked as the clustered index by XtraDB in the absence of a PRIMARY KEY. Bug Fixed: #851674 (Alexey Kopytov). The Slow Query Log did not log the error number correctly. #830199 (Oleg Tsarev). Variable log-slow-admin-statements was not listed with SHOW VARIABLES. Bug Fixed: #830199 (Oleg Tsarev). Fixed assertion failure in XtraDB. Bug Fixed: #814404 (Yasufumi Kinoshita). Since AUTO_INCREMENT columns must be dened as keys, omitting key specications and then adding them back in ALTER TABLE doesnt work for them. mysqldump innodb-optimize-keys has been xed to take this into account. Bug Fixed: #812179 (Alexey Kopytov).
Other Changes
Improvements and xes on general distribution: #845019, #702376, #795747 (Alexey Kopytov, Ignacio Nin, Yasufumi Kinoshita). Improvements and xes on the Percona Server Test Suite: #760085, #803140, #803137, #803120, #803110, #803100, #803093, #803088, #803076, #803071, #794780, #803072 (Oleg Tsarev, Alexey Kopytov, Valentine Gostev).
178
New features As of MySQL 5.5.15, a Fixed Row Format (FRF) is still being used in the MEMORY storage engine. The xed row format imposes restrictions on the type of columns as it assigns on advance a limited amount of memory per row. This renders a VARCHAR eld in a CHAR eld in practice, making impossible to have a TEXT or BLOB eld with that engine implementation. This feature also xed the upstream #25007. To overcome this limitation, the Improved MEMORY Storage Engine is introduced in this release for supporting true VARCHAR, VARBINARY, TEXT and BLOB elds in MEMORY tables. This implementation is based on the Dynamic Row Format (DFR) introduced by the mysql-heap-dynamic-rows patch. DFR is used to store column values in a variable-length form, thus helping to decrease memory footprint of those columns and making possible BLOB and TEXT elds and real VARCHAR and VARBINARY. For performance reasons, a mixed solution is implemented: the xed format is used at the beginning of the row, while the dynamic one is used for the rest of it. All values for columns used in indexes are stored in xed format at the rst block of the row, then the following columns are handled with DRF.
fsync() has been replaced with fdatasync() to improve perfomance where possible. The former is intended to sync the metadata of the le also (size, name, access time, etc.), but for the transaction log and the doublewrite buffer, such sync of metadata isnt needed. Bug Fixed: #803270 (Yasufumi Kinoshita).
Compatibility Collations
Two new collations, utf8_general50_ci and ucs2_general50_ci, have been to improve compatibility for those upgrading from MySQL 5.0 or 5.1 prior to version 5.1.24. A x for a MySQL bug (#27877) introduced an incompatible change in collations in MySQL 5.1.24. If the following collations were used: utf8_general_ci ucs2_general_ci and any of the indexes contained the German letter U+00DF SHARP S (which became equal to s), when upgrading from 5.0 / 5.1.23 or lower: any indexes on columns in that situation must be rebuilt after the upgrade, and unique constrains may get broken after upgrade due to possible duplicates. This problem is avoided when upgrading to Percona Server by converting the affected tables or columns to the collations introduced: utf8_general_ci to utf8_general50_ci, and 10.9. Percona Server 5.5 Release notes 179
ucs2_general_ci to ucs2_general50_ci. Blueprint: utf8-general50-ci-5.5 (Alexey Kopytov). Bug Fixes When adding a table to the cache, the server may evict and close another if the table cache is full. If the closed table was on the FEDERATED engine and a replication environment, its client connection to the remote server was closed leading to an unappropriated network error and stopping the Slave SQL thread. Bugs Fixed #813587 / #51196 and #61790 in MySQL (Alexey Kopytov). Querying global_temporary_tables caused the server to crash in some scenarios due to insufcient locking. Fixed by introducing a new mutex to protect from race conditions. Bug Fixed: #745241 (Alexey Kopytov). Using the innodb_lazy_drop_table option led to an assertion error when truncating a table in some scenarios. Bug Fixed: #798371 (Yasufumi Kinoshita). Other Changes Improvements and xes on platform-specic distribution: The compilation of the Response Time Distribution patch has been xed on Solaris (supported platform) and Windows (experimental). Bug Fixed: #737947 (Laurynas Biveinis) Improvements and xes on general distribution: #766266, #794837, #806975 (Laurynas Biveinis, Stewart Smith, Alexey Kopytov) Improvements and xes on the Percona Server documentation: #803109, #803106, #803097 (Rodrigo Gadea)
The SHM buffer pool patch, which provided the ability to use a shared memory segment for the buffer pool to enable faster server restarts, has been removed. Instead, we recommend using the LRU Dump/Restore patch which provides similar improvements in restart performance. Replacement is due to SHM buffer pool both being very invasive and not widely used. Improved restart times are better provided by the much safer LRU D/R patch which has the advantage of also persisting across machine restarts. The conguration variables for my.cnf have been kept for compatibility and warnings will be printed for the deprecated options (innodb_buffer_pool_shm_key and innodb_buffer_pool_shm_checksum) if used. Instructions for disabling the SHM buffer pool can be found here. 180 Chapter 10. Reference
Instructions on setting up LRU dump/restore can be found here. Bug Fixes On a high concurrency environment with compressed tables, users may experience crashes due to improper mutex handling in buf_page_get_zip(). Bug Fix: #802348 (Yasufumi Kinoshita). XtraDB crashed when importing big tables (e.g. 350G) using the Expand Table Import feature due to a timeout. Bug Fix: #684829 (Yasufumi Kinoshita). Partitioning adaptive hash index may leave to a hangup of the server in some scenarios. Bug Fix: #791030 (Yasufumi Kinoshita). Statistics gathering for each records update. Bug #791092 (Yasufumi Kinoshita) Other Changes
Improvements and xes on the Percona Server Test Suite
#693415, #794840, #800035, #800559, #782391, #785566, #790199 (Oleg Tsarev, Yasufumi Kinoshita, Stewart Smith).
Improvements and xes on platform-specic distribution:
181
Variable Changes Variable innodb_extra_rsegments was removed because the equivalent, innodb_rollback_segments, has been implemented in MySQL 5.5. (Yasufumi Kinoshita) Bug Fixes Bug #757749 - Using ALTER TABLE to convert an InnoDB table to a MEMORY table could fail due to a bug in the Fast Index Creation patch. (Alexey Kopytov) Bug #764395 - InnoDB crashed with an assertion failure when receiving a signal on pwrite(). The problem was that InnoDB I/O code was not fully conforming to the standard on POSIX systems. Calls to fsync(), pread(), and pwrite() can be interrupted by a signal. In such cases, InnoDB would crash with an assertion failure, rather than just restarting the interrupted call. (Alexey Kopytov) Bug #766236 - A crash was occurring in some cases when innodb_lazy_drop_table was enabled with very large buffer pools. (Yasufumi Kinoshita) Bug #733317 - SYS_STATS internal table of XtraDB has innodb_stats_method from InnoDB -plugin. (Yasufumi Kinoshita) Known Bugs The version of Percona XtraDB shown in logs is not correct. The actual version is 1.1.6-20.2 (instead of 1.1.6-20.1). been expanded for supporting
Old system variable slow_query_log_microseconds_timestamp slow_query_log_timestamp_precision. (Oleg Tsarev) Old system variable use_global_log_slow_control slow_query_log_use_global_control. (Oleg Tsarev) 182 was
Old system variable userstat_running was renamed to userstat. (Oleg Tsarev) Old system variable innodb_expand_import was renamed to innodb_import_table_from_xtrabackup. (Yasufumi Kinoshita) Old system variable innodb_auto_lru_dump was renamed to innodb_buffer_pool_restore_at_startup. (Yasufumi Kinoshita) Old system variable innodb_overwrite_relay_log_info innodb_recovery_update_relay_log. (Yasufumi Kinoshita) Old system variable innodb_pass_corrupt_table innodb_corrupt_table_action. (Yasufumi Kinoshita) Bug Fixes Bug #724674 - Ported an updated version of the original implementation of the Remove Excessive Function Calls (fcntl) feature, which removes some fcntl calls to improve performance. (Oleg Tsarev) Bug #727704 - When using the Expand Table Import feature, importing .ibd les created on MySQL 5.0 or Percona Server versions prior to 5.1.7 could crash the server. (Yasufumi Kinoshita) MySQL bugs 56433 and 51325 - These MySQL bugs have been xed in Percona Server. (Yasufumi Kinoshita) was was renamed renamed to to
183
Old variable enable_query_response_time_stats was renamed to query_response_time_stats. (Oleg Tsarev) Existing variable log_slow_verbosity had profiling_use_getrusage. (Oleg Tsarev) two new values added: profiling and
Existing variables profiling_server and profiling_use_getrusage were merged into the Slow Query Log page. (Oleg Tsarev) Other Changes Additional information was added to the LOG section of the SHOW STATUS command. Bug xed: #693269. (Yasufumi Kinoshita) The SHOW PATCHES command was removed. (Vadim Tkachenko) The INFORMATION_SCHEMA table XTRADB_ENHANCEMENTS was removed. (Yasufumi Kinoshita) Several elds in the INFORMATION_SCHEMA table INNODB_INDEX_STATS were renamed. Bug xed: #691777. (Yasufumi Kinoshita) The XtraDB version was set to 20.0. (Aleksandr Kuzminsky) Many InnoDB compilation warnings were xed. Bug xed: #695273. (Yasufumi Kinoshita) An Amazon OS repository was created. Bug xed: #691996. (Aleksandr Kuzminsky)
10.10 Glossary
ACID Set of properties that guarantee database transactions are processed reliably. Stands for Atomicity, Consistency, Isolation, Durability. Atomicity Atomicity means that database operations are applied following a all or nothing rule. A transaction is either fully applied or not at all. Consistency Consistency means that each transaction that modies the database takes it from one consistent state to another. Drizzle Drizzle: a database for the cloud. Drizzle is a community-driven open source project that is forked from the popular MySQL database. The Drizzle team has removed non-essential code, re-factored the remaining code into a plugin-based architecture and modernized the code base moving to C++. Drizzle Charter A database optimized for Cloud infrastructure and Web applications. Design for massive concurrency on modern multi-cpu architecture Optimize memory for increased performance and parallelism Open source, open community, open design Scope Re-designed modular architecture providing plugins with dened APIs Simple design for ease of use and administration Reliable, ACID transactional Durability Once a transaction is committed, it will remain so.
184
Foreign Key A referential constraint between two tables. Example: A purchase order in the purchase_orders table must have been made by a customer that exists in the customers table. Isolation The Isolation requirement means that no transaction can interfere with another. InnoDB A Storage Engine for MySQL and derivatives (Percona Server, MariaDB, Drizzle) originally written by Innobase Oy, since acquired by Oracle. It provides ACID compliant storage engine with foreign key support. As of MySQL version 5.5, InnoDB became the default storage engine on all platforms. Jenkins Jenkins is a continuous integration system that we use to help ensure the continued quality of the software we produce. It helps us achieve the aims of: no failed tests in trunk on any platform, aid developers in ensuring merge requests build and test on all platforms, no known performance regressions (without a damn good explanation). LSN Log Serial Number. A term used in relation to the InnoDB or XtraDB storage engines. MariaDB A fork of MySQL that is maintained primarily by Monty Program AB. It aims to add features, x bugs while maintaining 100% backwards compatibility with MySQL. my.cnf The le name of the default MySQL conguration le. MyISAM A MySQL Storage Engine that was the default until MySQL 5.5. MySQL An open source database that has spawned several distributions and forks. MySQL AB was the primary maintainer and distributor until bought by Sun Microsystems, which was then acquired by Oracle. As Oracle owns the MySQL trademark, the term MySQL is often used for the Oracle distribution of MySQL as distinct from the drop-in replacements such as MariaDB and Percona Server. NUMA Non-Uniform Memory Access (NUMA) is a computer memory design used in multiprocessing, where the memory access time depends on the memory location relative to a processor. Under NUMA, a processor can access its own local memory faster than non-local memory, that is, memory local to another processor or memory shared between processors. The whole system may still operate as one unit, and all memory is basically accessible from everywhere, but at a potentially higher latency and lower performance. Percona Server Perconas branch of MySQL with performance and management improvements. Storage Engine A Storage Engine is a piece of software that implements the details of data storage and retrieval for a database system. This term is primarily used within the MySQL ecosystem due to it being the rst widely used relational database to have an abstraction layer around storage. It is analogous to a Virtual File System layer in an Operating System. A VFS layer allows an operating system to read and write multiple le systems (e.g. FAT, NTFS, XFS, ext3) and a Storage Engine layer allows a database server to access tables stored in different engines (e.g. MyISAM , InnoDB). XtraDB Perconas improved version of InnoDB providing performance, features and reliability above what is shipped by Oracle in InnoDB. genindex modindex search
10.10. Glossary
185
186
INDEX
Symbols
5.5.10-20.1 (release notes), 182 5.5.11-20.2 (release notes), 181 5.5.12-20.3 (release notes), 181 5.5.13-20.4 (release notes), 180 5.5.14-20.5 (release notes), 179 5.5.15-21.0 (release notes), 178 5.5.16-22.0 (release notes), 177 5.5.17-22.1 (release notes), 176 5.5.18-23.0 (release notes), 176 5.5.19-24.0 (release notes), 175 5.5.20-24.1 (release notes), 175 5.5.21-25.0 (release notes), 174 5.5.21-25.1 (release notes), 174 5.5.22-25.2 (release notes), 174 5.5.23-25.3 (release notes), 173 5.5.24-26.0 (release notes), 173 5.5.25a-27.1 (release notes), 172 5.5.27-28.0 (release notes), 171 5.5.27-28.1 (release notes), 170 5.5.27-29.0 (release notes), 169 5.5.28-29.1 (release notes), 169 5.5.28-29.2 (release notes), 168 5.5.28-29.3 (release notes), 167 5.5.29-29.4 (release notes), 166 5.5.29-30.0 (release notes), 165 5.5.30-30.1 (release notes), 164 5.5.30-30.2 (release notes), 162 5.5.31-30.3 (release notes), 161 5.5.32-31.0 (release notes), 160 5.5.33-31.1 (release notes), 159 5.5.34-32.0 (release notes), 158 5.5.8-20.0 (release notes), 183
C
CLIENT_STATISTICS (table), 99 Consistency, 184
D
Drizzle, 184 Drizzle Charter, 184 Durability, 184
E
enforce_storage_engine (variable), 82 expand_fast_index_creation (variable), 77 extra_max_connections (variable), 46 extra_port (variable), 45
F
fast_index_creation (variable), 75 Flashcache_enabled (variable), 78 ush_caches (variable), 40 Foreign Key, 185
G
GLOBAL_TEMPORARY_TABLES (table), 131
H
have_ashcache (variable), 78 have_response_time_distribution (variable), 127
I
INDEX_STATISTICS (table), 100 InnoDB, 185 innodb_adaptive_ushing (variable), 26 innodb_adaptive_ushing_method (variable), 26 Innodb_adaptive_hash_cells (variable), 117 Innodb_adaptive_hash_hash_searches (variable), 117 Innodb_adaptive_hash_heap_buffers (variable), 117 innodb_adaptive_hash_index_partitions (variable), 31 Innodb_adaptive_hash_non_hash_searches (variable), 117 innodb_auto_lru_dump (variable), 73 Innodb_background_log_sync (variable), 114 187
A
ACID, 184 Atomicity, 184
B
binlog_commits (variable), 47 binlog_group_commits (variable), 47
innodb_blocking_buffer_pool_restore (variable), 73 INNODB_BUFFER_POOL_PAGES (table), 132 INNODB_BUFFER_POOL_PAGES_BLOB (table), 133 INNODB_BUFFER_POOL_PAGES_INDEX (table), 133 Innodb_buffer_pool_pages_LRU_ushed (variable), 120 Innodb_buffer_pool_pages_made_not_young (variable), 120 Innodb_buffer_pool_pages_made_young (variable), 120 Innodb_buffer_pool_pages_old (variable), 120 innodb_buffer_pool_populate (variable), 40 innodb_buffer_pool_restore_at_startup (variable), 74 innodb_buffer_pool_shm_checksum (variable), 137 innodb_buffer_pool_shm_key (variable), 137 INNODB_CHANGED_PAGES (table), 89 Innodb_checkpoint_age (variable), 118 innodb_checkpoint_age_target (variable), 27 Innodb_checkpoint_max_age (variable), 118 Innodb_checkpoint_target_age (variable), 118 innodb_corrupt_table_action (variable), 63 Innodb_current_row_locks (variable), 122 Innodb_deadlocks (variable), 123 Innodb_descriptors_memory (variable), 120 innodb_dict_size_limit (variable), 67 Innodb_dict_tables (variable), 67 innodb_doublewrite_le (variable), 36 innodb_expand_import (variable), 70 innodb_fake_changes (variable), 80 innodb_fast_checksum (variable), 38 innodb_ush_method (variable), 27 innodb_ush_neighbor_pages (variable), 28 Innodb_history_list_length (variable), 121 innodb_ibuf_accel_rate (variable), 24 innodb_ibuf_active_contract (variable), 24 Innodb_ibuf_discarded_delete_marks (variable), 115 Innodb_ibuf_discarded_deletes (variable), 116 Innodb_ibuf_discarded_inserts (variable), 116 Innodb_ibuf_free_list (variable), 116 innodb_ibuf_max_size (variable), 25 Innodb_ibuf_merged_delete_marks (variable), 116 Innodb_ibuf_merged_deletes (variable), 116 Innodb_ibuf_merged_inserts (variable), 116 Innodb_ibuf_merges (variable), 116 Innodb_ibuf_segment_size (variable), 117 Innodb_ibuf_size (variable), 117 innodb_import_table_from_xtrabackup (variable), 70 INNODB_INDEX_STATS (table), 96 innodb_kill_idle_transaction (variable), 81 innodb_lazy_drop_table (variable), 34 innodb_locking_fake_changes (variable), 80 innodb_log_block_size (variable), 29 innodb_log_le_size (variable), 29 Innodb_lsn_current (variable), 118 Innodb_lsn_ushed (variable), 118
Innodb_lsn_last_checkpoint (variable), 118 Innodb_master_thread_10_second_loops (variable), 113 Innodb_master_thread_1_second_loops (variable), 113 Innodb_master_thread_background_loops (variable), 113 Innodb_master_thread_main_ush_loops (variable), 113 Innodb_master_thread_sleeps (variable), 113 innodb_max_bitmap_le_size (variable), 90 innodb_max_changed_pages (variable), 89 Innodb_max_trx_id (variable), 121 Innodb_mem_adaptive_hash (variable), 119 Innodb_mem_dictionary (variable), 119 Innodb_mem_total (variable), 119 innodb_merge_sort_block_size (variable), 75 Innodb_mutex_os_waits (variable), 114 Innodb_mutex_spin_rounds (variable), 114 Innodb_mutex_spin_waits (variable), 114 Innodb_oldest_view_low_limit_trx_id (variable), 121 innodb_overwrite_relay_log_info (variable), 60 innodb_page_size (variable), 49 innodb_pass_corrupt_table (variable), 62 innodb_purge_threads (variable), 30 Innodb_purge_trx_id (variable), 122 Innodb_purge_undo_no (variable), 122 innodb_read_ahead (variable), 28 Innodb_read_views_memory (variable), 120 innodb_recovery_stats (variable), 66 innodb_recovery_update_relay_log (variable), 60 INNODB_RSEG (table), 32 Innodb_s_lock_os_waits (variable), 114 Innodb_s_lock_spin_rounds (variable), 115 Innodb_s_lock_spin_waits (variable), 115 innodb_show_locks_held (variable), 112 innodb_show_verbose_locks (variable), 112 innodb_stats_auto_update (variable), 93 innodb_stats_method (variable), 93 innodb_stats_update_need_lock (variable), 93 INNODB_SYS_COLUMNS (table), 95 INNODB_SYS_FIELDS (table), 95 INNODB_SYS_FOREIGN (table), 95 INNODB_SYS_FOREIGN_COLS (table), 96 INNODB_SYS_INDEXES (table), 95 INNODB_SYS_STATS (table), 94 INNODB_SYS_TABLES (table), 94 INNODB_SYS_TABLESTATS (table), 94 INNODB_TABLE_STATS (table), 96 innodb_thread_concurrency_timer_based (variable), 39 innodb_track_changed_pages (variable), 89 INNODB_UNDO_LOGS (table), 134 innodb_use_atomic_writes (variable), 33 innodb_use_global_ush_log_at_trx_commit (variable), 29 innodb_use_sys_stats_table (variable), 94 Innodb_x_lock_os_waits (variable), 115 Innodb_x_lock_spin_rounds (variable), 115
188
Index
J
Jenkins, 185
L
log_slow_admin_statements (variable), 105 log_slow_lter (variable), 105 log_slow_rate_limit (variable), 106 log_slow_rate_type (variable), 105 log_slow_slave_statements (variable), 106 log_slow_sp_statements (variable), 107 log_slow_verbosity (variable), 107 log_warnings_suppress (variable), 50 LSN, 185
thread_pool_max_threads (variable), 44 thread_pool_oversubscribe (variable), 44 thread_pool_size (variable), 45 thread_pool_stall_limit (variable), 45 THREAD_STATISTICS (table), 101 thread_statistics (variable), 98 Threadpool_idle_threads (variable), 46 Threadpool_threads (variable), 46
U
USER_STATISTICS (table), 102 userstat (variable), 98 utility_user (variable), 84 utility_user_password (variable), 84 utility_user_privileges (variable), 85 utility_user_schema_access (variable), 84
M
MariaDB, 185 max_binlog_les (variable), 56 my.cnf, 185 MyISAM, 185 MySQL, 185
X
XtraDB, 185 XTRADB_ADMIN_COMMAND (table), 74
N
no-remove-eol-carret (variable), 51 NUMA, 185 numa_interleave (variable), 40
P
Percona Server, 185 PROCESSLIST (table), 130
Q
query_cache_strip_comments (variable), 37 QUERY_RESPONSE_TIME (table), 128 query_response_time_range_base (variable), 128 query_response_time_stats (variable), 128
S
secure-le-priv (variable), 85 slow_query_log_always_write_time (variable), 109 slow_query_log_timestamp_always (variable), 107 slow_query_log_timestamp_precision (variable), 108 slow_query_log_use_global_control (variable), 108 Storage Engine, 185 syslog (variable), 124
T
TABLE_STATISTICS (table), 101 TEMPORARY_TABLES (table), 131 thread_pool_high_prio_tickets (variable), 44 thread_pool_idle_timeout (variable), 44 Index 189