Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 43.3Mb
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.2Kb
Man Pages (Zip) - 402.4Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
Excerpts from this Manual

29.12.2.4 The setup_objects Table

Thesetup_objects table controls whether the Performance Schema monitors particular objects. This table has a maximum size of 100 rows by default. To change the table size, modify theperformance_schema_setup_objects_size system variable at server startup.

The initialsetup_objects contents look like this:

mysql> SELECT * FROM performance_schema.setup_objects;+-------------+--------------------+-------------+---------+-------+| OBJECT_TYPE | OBJECT_SCHEMA      | OBJECT_NAME | ENABLED | TIMED |+-------------+--------------------+-------------+---------+-------+| EVENT       | mysql              | %           | NO      | NO    || EVENT       | performance_schema | %           | NO      | NO    || EVENT       | information_schema | %           | NO      | NO    || EVENT       | %                  | %           | YES     | YES   || FUNCTION    | mysql              | %           | NO      | NO    || FUNCTION    | performance_schema | %           | NO      | NO    || FUNCTION    | information_schema | %           | NO      | NO    || FUNCTION    | %                  | %           | YES     | YES   || PROCEDURE   | mysql              | %           | NO      | NO    || PROCEDURE   | performance_schema | %           | NO      | NO    || PROCEDURE   | information_schema | %           | NO      | NO    || PROCEDURE   | %                  | %           | YES     | YES   || TABLE       | mysql              | %           | NO      | NO    || TABLE       | performance_schema | %           | NO      | NO    || TABLE       | information_schema | %           | NO      | NO    || TABLE       | %                  | %           | YES     | YES   || TRIGGER     | mysql              | %           | NO      | NO    || TRIGGER     | performance_schema | %           | NO      | NO    || TRIGGER     | information_schema | %           | NO      | NO    || TRIGGER     | %                  | %           | YES     | YES   |+-------------+--------------------+-------------+---------+-------+

Modifications to thesetup_objects table affect object monitoring immediately.

For object types listed insetup_objects, the Performance Schema uses the table to how to monitor them. Object matching is based on theOBJECT_SCHEMA andOBJECT_NAME columns. Objects for which there is no match are not monitored.

The effect of the default object configuration is to instrument all tables except those in themysql,INFORMATION_SCHEMA, andperformance_schema databases. (Tables in theINFORMATION_SCHEMA database are not instrumented regardless of the contents ofsetup_objects; the row forinformation_schema.% simply makes this default explicit.)

When the Performance Schema checks for a match insetup_objects, it tries to find more specific matches first. For example, with a tabledb1.t1, it looks for a match for'db1' and't1', then for'db1' and'%', then for'%' and'%'. The order in which matching occurs matters because different matchingsetup_objects rows can have differentENABLED andTIMED values.

Rows can be inserted into or deleted fromsetup_objects by users with theINSERT orDELETE privilege on the table. For existing rows, only theENABLED andTIMED columns can be modified, by users with theUPDATE privilege on the table.

For more information about the role of thesetup_objects table in event filtering, seeSection 29.4.3, “Event Pre-Filtering”.

Thesetup_objects table has these columns:

  • OBJECT_TYPE

    The type of object to instrument. The value is one of'EVENT' (Event Scheduler event),'FUNCTION' (stored function),'PROCEDURE' (stored procedure),'TABLE' (base table), or'TRIGGER' (trigger).

    TABLE filtering affects table I/O events (wait/io/table/sql/handler instrument) and table lock events (wait/lock/table/sql/handler instrument).

  • OBJECT_SCHEMA

    The schema that contains the object. This should be a literal name, or'%' to meanany schema.

  • OBJECT_NAME

    The name of the instrumented object. This should be a literal name, or'%' to meanany object.

  • ENABLED

    Whether events for the object are instrumented. The value isYES orNO. This column can be modified.

  • TIMED

    Whether events for the object are timed. This column can be modified.

Thesetup_objects table has these indexes:

  • Index on (OBJECT_TYPE,OBJECT_SCHEMA,OBJECT_NAME)

TRUNCATE TABLE is permitted for thesetup_objects table. It removes the rows.