Rechercher dans le manuel MySQL

15.15 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 26, MySQL Performance Schema.

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 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 26.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'.

    1. mysql> SELECT *
    2.        FROM performance_schema.setup_instruments
    3.        WHERE NAME LIKE '%innodb%';
    4. +-------------------------------------------------------+---------+-------+
    5. | NAME                                                  | ENABLED | TIMED |
    6. +-------------------------------------------------------+---------+-------+
    7. | wait/synch/mutex/innodb/commit_cond_mutex             | NO      | NO    |
    8. | wait/synch/mutex/innodb/innobase_share_mutex          | NO      | NO    |
    9. | wait/synch/mutex/innodb/autoinc_mutex                 | NO      | NO    |
    10. | wait/synch/mutex/innodb/buf_pool_mutex                | NO      | NO    |
    11. | wait/synch/mutex/innodb/buf_pool_zip_mutex            | NO      | NO    |
    12. | wait/synch/mutex/innodb/cache_last_read_mutex         | NO      | NO    |
    13. | wait/synch/mutex/innodb/dict_foreign_err_mutex        | NO      | NO    |
    14. | wait/synch/mutex/innodb/dict_sys_mutex                | NO      | NO    |
    15. | wait/synch/mutex/innodb/recalc_pool_mutex             | NO      | NO    |
    16. ...
    17. | wait/io/file/innodb/innodb_data_file                  | YES     | YES   |
    18. | wait/io/file/innodb/innodb_log_file                   | YES     | YES   |
    19. | wait/io/file/innodb/innodb_temp_file                  | YES     | YES   |
    20. | stage/innodb/alter table (end)                        | YES     | YES   |
    21. | stage/innodb/alter table (flush)                      | YES     | YES   |
    22. | stage/innodb/alter table (insert)                     | YES     | YES   |
    23. | stage/innodb/alter table (log apply index)            | YES     | YES   |
    24. | stage/innodb/alter table (log apply table)            | YES     | YES   |
    25. | stage/innodb/alter table (merge sort)                 | YES     | YES   |
    26. | stage/innodb/alter table (read PK and internal sort)  | YES     | YES   |
    27. | stage/innodb/buffer pool load                         | YES     | YES   |
    28. | memory/innodb/buf_buf_pool                            | NO      | NO    |
    29. | memory/innodb/dict_stats_bg_recalc_pool_t             | NO      | NO    |
    30. | memory/innodb/dict_stats_index_map_t                  | NO      | NO    |
    31. | memory/innodb/dict_stats_n_diff_on_level              | NO      | NO    |
    32. | memory/innodb/other                                   | NO      | NO    |
    33. | memory/innodb/row_log_buf                             | NO      | NO    |
    34. | memory/innodb/row_merge_sort                          | NO      | NO    |
    35. | memory/innodb/std                                     | NO      | NO    |
    36. | memory/innodb/sync_debug_latches                      | NO      | NO    |
    37. | memory/innodb/trx_sys_t::rw_trx_ids                   | NO      | NO    |
    38. ...
    39. +-------------------------------------------------------+---------+-------+
    40. 155 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:

    Note

    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:

    1. mysql> SELECT *
    2.        FROM performance_schema.file_instances
    3.        WHERE EVENT_NAME LIKE '%innodb%'\G
    4. *************************** 1. row ***************************
    5.  FILE_NAME: /path/to/mysql-8.0/data/ibdata1
    6. EVENT_NAME: wait/io/file/innodb/innodb_data_file
    7. OPEN_COUNT: 3
    8. *************************** 2. row ***************************
    9.  FILE_NAME: /path/to/mysql-8.0/data/ib_logfile0
    10. EVENT_NAME: wait/io/file/innodb/innodb_log_file
    11. OPEN_COUNT: 2
    12. *************************** 3. row ***************************
    13.  FILE_NAME: /path/to/mysql-8.0/data/ib_logfile1
    14. EVENT_NAME: wait/io/file/innodb/innodb_log_file
    15. OPEN_COUNT: 2
    16. *************************** 4. row ***************************
    17.  FILE_NAME: /path/to/mysql-8.0/data/mysql/engine_cost.ibd
    18. EVENT_NAME: wait/io/file/innodb/innodb_data_file
    19. OPEN_COUNT: 3
    20. ...
  • You should be familiar with performance_schema tables that store InnoDB event data. Tables relevant to InnoDB-related events include:

    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.


Find a PHP function

Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-innodb-performance-schema.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:en Manuel MySQL : https://dev.mysql.com/

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut