Menu

MySQL Performance Schema: Instrumentation Exceptions

The setup_actors table in MySQL Performance Schema can be used to specify what users and hosts one wants to have instrumentation enabled for. By default, connections from all users and hosts are instrumented:

Default Configuration

MySQL

1

2

3

4

5

6

7

mysql>select*fromperformance_schema.setup_actors;

+------+------+------+

|HOST|USER|ROLE|

+------+------+------+

|%|%|%|

+------+------+------+

1rowinset(0.00sec)

You can then use standard SQL against this setup_actors table in order to specify what users and hosts you want to have instrumentation enabled for.

But what about the case where you want to enable instrumentation for everyone except the ‘mayank’ user?

In the MySQL 5.7.6 DMR, a new ENABLED column has been added to the setup_actors table. So now the default configuration looks like this:

New Default Configuration

MySQL

1

2

3

4

5

6

7

mysql>select*fromperformance_schema.setup_actors;

+------+------+------+---------+

|HOST|USER|ROLE|ENABLED|

+------+------+------+---------+

|%|%|%|YES|

+------+------+------+---------+

1rowinset(0.00sec)

This new column now allows us to easily specify that we want to enable instrumentation for all users except ‘mayank’:

So with the above configuration, instrumentation is enabled for all user/host combinations except for the ‘mayank’ user (from any host) and any user from ‘localhost’.

We hope that you find this new feature useful! If you have any questions please feel free to post them here on the blog post or in a support ticket. If you feel that you have encountered any related bugs, please let us know via a comment here, a bug report, or a support ticket.