In MySQL 8.0, the engineers have added useful meta-data to the table
SETUP_INSTRUMENT. This table lists the classes of instrumented objects for which events can be collected.
TIMED columns, were added
Let’s have a quick look at these new columns:
PROPERTIES can have the following values
memory/performance_schema/metadata_locks thatreturn the memory used for table
statement/abstract/relay_logthat returns the new event just read from the relay log.
stage/sql/copy to tmp table
wait/synch/mutex/sql/LOCK_error_log, like most global mutex locks this lock on error log is a singleton.
This define the life or creation occurrence of the instrument. The possible values from low to high are:
wait/synch/mutex/sql/THD::LOCK_thd_query as a volatility of 5, which means this mutex is created each time a session connects and destroyed when the session disconnects.
There is no point then to enable an instrument for an object already created.
Finally, now there is a documentation column describing the purpose of the instrument. Currently there are 80 instruments documented with the help of that column.
This is an example:
NAME: memory/performance_schema/prepared_statements_instances ENABLED: YES TIMED: NULL PROPERTIES: global_statistics VOLATILITY: 1 DOCUMENTATION: Memory used for table performance_schema.prepared_statements_instances
All this is explained in details in the MySQL’s manual.
Enjoy MySQL 8.0 and I wish you a pleasant discovery of all the new features !