PreFNtering byThread
The threads table contains a rowfor each server thread. Each row contains information about a
thread and indicates whether monitoring is enabled for it. For the Performance
Sc hem a to monitor a
thread, these things must be true:
•The thread_instrumentationconsumer inthe setup_consumerstable must be YES.
• The thread. INSTRUMENTEDcolumn must be YES.
• Monitoring occurs only for those thread events produced from instruments that are enabled, as
specified in the setup_instrument.?table.
The INSTRUMENTED column in the threads table indicates the monitoring State for each thread. For
foreground threads (resulting from Client connections), the initial INSTRUMENTED value is determined
by whether the user account associated with the thread matches any row in the
setup_actorstable.
For background threads, INSTRUMENTED is YES by default. setup_actorsis not consulted because
there is no associated user for background threads. For any thread, its
INSTRUMENTED value can be changed during the life of the thread.
The initial setup_actorscontents look likethis: mysql>SELECT * FROM setup_actors;
+------+------+------+
| HOST | USER | ROLE |
I % I % I % I
The Performance Schema uses the HOST and USER columns to match each new foreground thread.
(ROLE is unused.) The INSTRUMENTED value for the thread becomes YES if any row matches. This
enables instrumenting to be applied selectively per host, user, or combination of host and user.
The HOST and USER columns should contain a literał host or user name, or ' % ' to match any name.
By default, monitoring is enabled for all new foreground threads because the
setup_actorstable
initially contains a row with • % • for both HOST and USER. To perform morę limited matching such as to
enable monitoring only for some foreground threads, you must delete this row
because it matches any
connection.