This section describes tables that do not fall into the table categories discussed in the preceding sections:
performance_timers
: Which event timers are available.threads
: Information about server threads.
The performance_timers
table shows which
event timers are available:
mysql> SELECT * FROM performance_timers;
+-------------+-----------------+------------------+----------------+
| TIMER_NAME | TIMER_FREQUENCY | TIMER_RESOLUTION | TIMER_OVERHEAD |
+-------------+-----------------+------------------+----------------+
| CYCLE | 2389029850 | 1 | 72 |
| NANOSECOND | NULL | NULL | NULL |
| MICROSECOND | 1000000 | 1 | 585 |
| MILLISECOND | 1035 | 1 | 738 |
| TICK | 101 | 1 | 630 |
+-------------+-----------------+------------------+----------------+
If the values associated with a given timer name are
NULL
, that timer is not supported on your
platform. The rows that do not contain NULL
indicate which timers you can use.
The performance_timers
table has these
columns:
TIMER_NAME
The name by which to refer to the timer when configuring the
setup_timers
table.TIMER_FREQUENCY
The number of timer units per second. For a cycle timer, the frequency is generally related to the CPU speed. For example, on a system with a 2.4GHz processor, the
CYCLE
may be close to 2400000000.TIMER_RESOLUTION
Indicates the number of timer units by which timer values increase. If a timer has a resolution of 10, its value increases by 10 each time.
TIMER_OVERHEAD
The minimal number of cycles of overhead to obtain one timing with the given timer. Performance Schema determines this value by invoking the timer 20 times during initialization and picking the smallest value. The total overhead really is twice this amount because the instrumentation invokes the timer at the start and end of each event. The timer code is called only for timed events, so this overhead does not apply for nontimed events.
The threads
table contains a row for each
server thread:
mysql> SELECT * FROM threads;
+-----------+----------------+----------------------------------------+
| THREAD_ID | PROCESSLIST_ID | NAME |
+-----------+----------------+----------------------------------------+
| 0 | 0 | thread/sql/main |
| 1 | 0 | thread/innodb/io_handler_thread |
| 16 | 0 | thread/sql/signal_handler |
| 23 | 7 | thread/sql/one_connection |
| 5 | 0 | thread/innodb/io_handler_thread |
| 12 | 0 | thread/innodb/srv_lock_timeout_thread |
| 22 | 6 | thread/sql/one_connection |
...
The threads
table has these columns:
THREAD_ID
This is the unique identifier of an instrumented thread.
PROCESSLIST_ID
For threads that are displayed in
INFORMATION_SCHEMA.PROCESSLIST
, this is theINFORMATION_SCHEMA.ID
value, which is also the value thatCONNECTION_ID()
would return within that thread. For background threads (threads not associated with a user connection),PROCESSLIST_ID
is 0, so the values are not unique.This column was named
ID
before MySQL 5.5.8.NAME
NAME
is the name associated with the instrumentation of the code in the server. For example,thread/sql/one_connection
corresponds to the thread function in the code responsible for handling a user connection, andthread/sql/main
stands for themain()
function of the server.
The threads
table was named
PROCESSLIST
before MySQL 5.5.6.