Documentation Home
MySQL 5.5 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 27.1Mb
PDF (A4) - 27.1Mb
PDF (RPM) - 26.1Mb
HTML Download (TGZ) - 6.6Mb
HTML Download (Zip) - 6.6Mb
HTML Download (RPM) - 5.6Mb
Man Pages (TGZ) - 168.7Kb
Man Pages (Zip) - 277.2Kb
Info (Gzip) - 2.5Mb
Info (Zip) - 2.5Mb
Excerpts from this Manual

MySQL 5.5 Reference Manual  /  The InnoDB Storage Engine  /  InnoDB Integration with MySQL Performance Schema

14.19 InnoDB Integration with MySQL Performance Schema

This section provides a brief introduction to InnoDB integration with Performance Schema. For comprehensive Performance Schema documentation, see Chapter 22, MySQL Performance Schema.

Starting with InnoDB 1.1 with MySQL 5.5, you can profile certain internal InnoDB operations using the MySQL Performance Schema feature. This type of tuning is primarily for expert users who evaluate optimization strategies to overcome performance bottlenecks. DBAs can also use this feature for capacity planning, to see whether their typical workload encounters any performance bottlenecks with a particular combination of CPU, RAM, and disk storage; and if so, to judge whether performance can be improved by increasing the capacity of some part of the system.

To use this feature to examine InnoDB performance:

  • You must be running MySQL 5.5 or higher with the Performance Schema feature available and enabled, as described in Section 22.2, “Performance Schema Build Configuration”, and Section 22.3, “Performance Schema Startup Configuration”. Since the Performance Schema feature introduces some performance overhead, you should use it on a test or development system rather than on a production system.

  • You must be running InnoDB 1.1 or higher.

  • You must be generally familiar with how to use the Performance Schema feature. For example, you should know how enable instruments and consumers, and how to query performance_schema tables to retrieve data. For an introductory overview, see Section 22.1, “Performance Schema Quick Start”.

  • You should be familiar with Performance Schema instruments that are available for InnoDB. To view InnoDB-related instruments, you can query the setup_instruments table for instrument names that contain 'innodb'.

    mysql> SELECT * FROM setup_instruments WHERE NAME LIKE '%innodb%';
    | NAME                                                  | ENABLED | TIMED |
    | wait/synch/mutex/innodb/commit_cond_mutex             | YES     | YES   |
    | wait/synch/mutex/innodb/innobase_share_mutex          | YES     | YES   |
    | wait/synch/mutex/innodb/prepare_commit_mutex          | YES     | YES   |
    | wait/synch/mutex/innodb/autoinc_mutex                 | YES     | YES   |
    | wait/synch/mutex/innodb/btr_search_enabled_mutex      | YES     | YES   |
    | wait/synch/mutex/innodb/buf_pool_mutex                | YES     | YES   |
    | wait/synch/mutex/innodb/buf_pool_zip_mutex            | YES     | YES   |
    | wait/synch/mutex/innodb/cache_last_read_mutex         | YES     | YES   |
    | wait/synch/mutex/innodb/dict_foreign_err_mutex        | YES     | YES   |
    | wait/synch/mutex/innodb/dict_sys_mutex                | YES     | YES   |
    | wait/synch/mutex/innodb/file_format_max_mutex         | YES     | YES   |
    | wait/synch/rwlock/innodb/btr_search_latch             | YES     | YES   |
    | wait/synch/rwlock/innodb/dict_operation_lock          | YES     | YES   |
    | wait/synch/rwlock/innodb/fil_space_latch              | YES     | YES   |
    | wait/synch/rwlock/innodb/checkpoint_lock              | YES     | YES   |
    | wait/synch/rwlock/innodb/trx_i_s_cache_lock           | YES     | YES   |
    | wait/synch/rwlock/innodb/trx_purge_latch              | YES     | YES   |
    | wait/synch/rwlock/innodb/index_tree_rw_lock           | YES     | YES   |
    | wait/synch/rwlock/innodb/dict_table_stats             | YES     | YES   |
    | wait/synch/cond/innodb/commit_cond                    | YES     | YES   |
    | wait/io/file/innodb/innodb_data_file                  | YES     | YES   |
    | wait/io/file/innodb/innodb_log_file                   | YES     | YES   |
    | wait/io/file/innodb/innodb_temp_file                  | YES     | YES   |
    46 rows in set (0.00 sec)

    For additional information about the instrumented InnoDB objects, you can query Performance Schema instances tables, which provide additional information about instrumented objects. Instance tables relevant to InnoDB include:


    Mutexes and RW-locks related to the InnoDB buffer pool are not included in this coverage; the same applies to the output of the SHOW ENGINE INNODB MUTEX command.

    For example, to view information about instrumented InnoDB file objects seen by the Performance Schema when executing file I/O instrumentation, you might issue the following query:

    mysql> SELECT * FROM file_instances WHERE EVENT_NAME LIKE '%innodb%'\G
    *************************** 1. row ***************************
     FILE_NAME: /path/to/mysql-5.5/data/ibdata1
    EVENT_NAME: wait/io/file/innodb/innodb_data_file
    *************************** 2. row ***************************
     FILE_NAME: /path/to/mysql-5.5/data/ib_logfile0
    EVENT_NAME: wait/io/file/innodb/innodb_log_file
    *************************** 3. row ***************************
     FILE_NAME: /path/to/mysql-5.5/data/ib_logfile1
    EVENT_NAME: wait/io/file/innodb/innodb_log_file
  • You should be familiar with performance_schema tables that store InnoDB event data. Tables relevant to InnoDB-related events include:

    • The Wait Event tables, which store wait events.

    • The Summary tables, which provide aggregated information for terminated events over time. Summary tables include file I/O summary tables, which aggregate information about I/O operations.

    If you are only interested in InnoDB-related objects, use the clause WHERE EVENT_NAME LIKE '%innodb%' or WHERE NAME LIKE '%innodb%' (as required) when querying these tables.

User Comments
Sign Up Login You must be logged in to post a comment.