We’ve recently added the ability to monitor MySQL query
performance statistics from MySQL’s
PERFORMANCE_SCHEMA, and there were a number of
lessons learned. There are definitely right and wrong ways to do
it. If you are looking to the P_S tables for monitoring MySQL
query performance, this blog post might save you some time and
mistakes.
What Is The Performance Schema?
First, a quick introduction. The Performance Schema includes a set of tables that give information on how statements are performing. Most of the P_S tables follow a set of predictable conventions: there’s a set of tables with a limited set of full-granularity current and/or historical data, which is aggregated into tables that accumulate over time. In the case of statements, there’s a table of current statements, which feeds into a statement history, that accumulates into statement summary statistics. The tables are named as follows:
…[Read more]