MySQL :: MySQL 8.0 Reference Manual :: 29.4.7 Pre-Filtering by Consumer (original) (raw)

29.4.7 Pre-Filtering by Consumer

The setup_consumers table lists the available consumer types and which are enabled:

mysql> SELECT * FROM performance_schema.setup_consumers;
+----------------------------------+---------+
| NAME                             | ENABLED |
+----------------------------------+---------+
| events_stages_current            | NO      |
| events_stages_history            | NO      |
| events_stages_history_long       | NO      |
| events_statements_cpu            | NO      |
| events_statements_current        | YES     |
| events_statements_history        | YES     |
| events_statements_history_long   | NO      |
| events_transactions_current      | YES     |
| events_transactions_history      | YES     |
| events_transactions_history_long | NO      |
| events_waits_current             | NO      |
| events_waits_history             | NO      |
| events_waits_history_long        | NO      |
| global_instrumentation           | YES     |
| thread_instrumentation           | YES     |
| statements_digest                | YES     |
+----------------------------------+---------+

Modify the setup_consumers table to affect pre-filtering at the consumer stage and determine the destinations to which events are sent. To enable or disable a consumer, set its ENABLED value toYES or NO.

Modifications to thesetup_consumers table affect monitoring immediately.

If you disable a consumer, the server does not spend time maintaining destinations for that consumer. For example, if you do not care about historical event information, disable the history consumers:

UPDATE performance_schema.setup_consumers
SET ENABLED = 'NO'
WHERE NAME LIKE '%history%';

The consumer settings in thesetup_consumers table form a hierarchy from higher levels to lower. The following principles apply:

The following lists describe the available consumer values. For discussion of several representative consumer configurations and their effect on instrumentation, seeSection 29.4.8, “Example Consumer Configurations”.

Global and Thread Consumers

Wait Event Consumers

These consumers require bothglobal_instrumentation andthread_instrumentation to beYES or they are not checked. If checked, they act as follows:

Stage Event Consumers

These consumers require bothglobal_instrumentation andthread_instrumentation to beYES or they are not checked. If checked, they act as follows:

Statement Event Consumers

These consumers require bothglobal_instrumentation andthread_instrumentation to beYES or they are not checked. If checked, they act as follows:

Transaction Event Consumers

These consumers require bothglobal_instrumentation andthread_instrumentation to beYES or they are not checked. If checked, they act as follows:

Statement Digest Consumer

The statements_digest consumer requiresglobal_instrumentation to beYES or it is not checked. There is no dependency on the statement event consumers, so you can obtain statistics per digest without having to collect statistics inevents_statements_current, which is advantageous in terms of overhead. Conversely, you can get detailed statements inevents_statements_current without digests (the DIGEST andDIGEST_TEXT columns areNULL in this case).

For more information about statement digesting, seeSection 29.10, “Performance Schema Statement Digests and Sampling”.