The setup tables provide information about the current
instrumentation and enable the monitoring configuration to be
changed. For this reason, some columns in these tables can be
changed if you have the UPDATE
privilege.
The use of tables rather than individual variables for setup information provides a high degree of flexibility in modifying Performance Schema configuration. For example, you can use a single statement with standard SQL syntax to make multiple simultaneous configuration changes.
This group contains tables with names that match the pattern
'setup%':
mysql>SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES->WHERE TABLE_SCHEMA = 'performance_schema'->AND TABLE_NAME LIKE 'setup%';+-------------------+ | TABLE_NAME | +-------------------+ | setup_consumers | | setup_instruments | | setup_timers | +-------------------+
The setup_consumers table lists destination
tables for event information:
mysql> SELECT * FROM setup_consumers;
+----------------------------------------------+---------+
| NAME | ENABLED |
+----------------------------------------------+---------+
| events_waits_current | YES |
| events_waits_history | YES |
| events_waits_history_long | YES |
| events_waits_summary_by_thread_by_event_name | YES |
| events_waits_summary_by_event_name | YES |
| events_waits_summary_by_instance | YES |
| file_summary_by_event_name | YES |
| file_summary_by_instance | YES |
+----------------------------------------------+---------+
The setup_consumers table has these columns:
NAMEThe consumer name. This is the name of a table in the
performance_schemadatabase.ENABLEDWhether the consumer is enabled. This column can be modified. If you disable a consumer, the server does not spend time adding event information to it.
Disabling the events_waits_current consumer
disables everything else that depends on waits, such as the
events_waits_history and
events_waits_history_long tables, and all
summary tables.
The setup_instruments table lists classes of
instrumented objects for which events can be collected:
mysql> SELECT * FROM setup_instruments;
+------------------------------------------------------------+---------+-------+
| NAME | ENABLED | TIMED |
+------------------------------------------------------------+---------+-------+
| wait/synch/mutex/sql/PAGE::lock | YES | YES |
| wait/synch/mutex/sql/TC_LOG_MMAP::LOCK_sync | YES | YES |
| wait/synch/mutex/sql/TC_LOG_MMAP::LOCK_active | YES | YES |
| wait/synch/mutex/sql/TC_LOG_MMAP::LOCK_pool | YES | YES |
| wait/synch/mutex/sql/LOCK_des_key_file | YES | YES |
| wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index | YES | YES |
...
Each instrument added to the source code provides a row for this
table, even when the instrumented code is not executed. When an
instrument is enabled and executed, instrumented instances are
created, which are visible in the *_INSTANCES
tables.
The setup_instruments table has these
columns:
NAMEThe instrument name. Instrument names have multiple parts and form a hierarchy, as discussed in Section 21.5, “Performance Schema Event Instrument Naming Conventions”. Events produced from execution of an instrument have an
EVENT_NAMEvalue that is taken from the instrumentNAMEvalue. (Events do not really have a “name,” but this provides a way to associate events with instruments.)ENABLEDWhether the instrument is enabled. This column can be modified. A disabled instrument produces no events.
TIMEDWhether the instrument is timed. This column can be modified.
If an enabled instrument is not timed, the instrument code is enabled, but the timer is not. Events produced by the instrument have
NULLfor theTIMER_START,TIMER_END, andTIMER_WAITtimer values. This in turn causes those values to be ignored when calculating the sum, minimum, maximum, and average time values in summary tables.
The setup_timers table shows the currently
selected event timer:
mysql> SELECT * FROM setup_timers;
+------+------------+
| NAME | TIMER_NAME |
+------+------------+
| wait | CYCLE |
+------+------------+
The setup_timers.TIMER_NAME value can be
changed to select a different timer. The value can be any of the
performance_timers.TIMER_NAME values. For an
explanation of how event timing occurs, see
Section 21.4, “Performance Schema Event Timing”.
The setup_timers table has these columns:
NAMEThe type of instrument the timer is used for.
TIMER_NAMEThe timer that applies to the instrument type.