Documentation Home
MySQL 5.5 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 27.2Mb
PDF (A4) - 27.2Mb
PDF (RPM) - 25.8Mb
HTML Download (TGZ) - 6.5Mb
HTML Download (Zip) - 6.6Mb
HTML Download (RPM) - 5.6Mb
Man Pages (TGZ) - 158.6Kb
Man Pages (Zip) - 262.2Kb
Info (Gzip) - 2.6Mb
Info (Zip) - 2.6Mb
Excerpts from this Manual

22.4.3 Event Pre-Filtering

Pre-filtering is done by modifying Performance Schema configuration so that only certain types of events are collected from producers, and collected events update only certain consumers. This type of filtering is done by the Performance Schema and has a global effect that applies to all users.

Pre-filtering can be applied to either the producer or consumer stage of event processing:

  • To affect pre-filtering at the producer stage, modify the setup_instruments table. An instrument can be enabled or disabled by setting its ENABLED value to YES or NO. An instrument can be configured whether to collect timing information by setting its TIMED value to YES or NO.

  • To affect pre-filtering at the consumer stage, modify the setup_consumers table. A consumer can be enabled or disabled by setting its ENABLED value to YES or NO.

Here are some examples that show the types of pre-filtering operations available:

  • Disable all instruments:

    UPDATE performance_schema.setup_instruments

    Now no events will be collected. This change, like other pre-filtering operations, affects other users as well, even if they want to see event information.

  • Disable all file instruments, adding them to the current set of disabled instruments:

    UPDATE performance_schema.setup_instruments
    WHERE NAME LIKE 'wait/io/file/%';
  • Disable only file instruments, enable all other instruments:

    UPDATE performance_schema.setup_instruments
    SET ENABLED = IF(NAME LIKE 'wait/io/file/%', 'NO', 'YES');

    The preceding queries use the LIKE operator and the pattern 'wait/io/file/%' to match all instrument names that begin with 'wait/io/file/. For additional information about specifying patterns to select instruments, see Section 22.4.4, “Naming Instruments or Consumers for Filtering Operations”.

  • Enable all but those instruments in the mysys library:

    UPDATE performance_schema.setup_instruments
  • Disable a specific instrument:

    UPDATE performance_schema.setup_instruments
    WHERE NAME = 'wait/synch/mutex/mysys/TMPDIR_mutex';
  • To toggle the state of an instrument, flip its ENABLED value:

    UPDATE performance_schema.setup_instruments
    WHERE NAME = 'wait/synch/mutex/mysys/TMPDIR_mutex';
  • Disable timing for all events:

    UPDATE performance_schema.setup_instruments
    SET TIMED = 'NO';

Setting the TIMED column for instruments affects Performance Schema table contents as described in Section 22.4.1, “Performance Schema Event Timing”.

When you change the monitoring configuration, the Performance Schema does not flush the history tables. Events already collected remain in the current-events and history tables until displaced by newer events. If you disable instruments, you might need to wait a while before events for them are displaced by newer events of interest. Alternatively, use TRUNCATE TABLE to empty the history tables.

After making instrumentation changes, you might want to truncate the summary tables to clear aggregate information for previously collected events. The effect of TRUNCATE TABLE for summary tables is to reset the summary columns to 0 or NULL, not to remove rows.

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
WHERE NAME LIKE '%history%';

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.