Before using the *note 'sys': sys-schema. schema, the prerequisites described in this section must be satisfied.
Because the note 'sys': sys-schema. schema provides an alternative means of accessing the Performance Schema, the Performance Schema must be enabled for the note 'sys': sys-schema. schema to work. See *note performance-schema-startup-configuration::.
For full access to the *note 'sys': sys-schema. schema, a user must have these privileges:
'SELECT' on all *note 'sys': sys-schema. tables and views
'EXECUTE' on all *note 'sys': sys-schema. stored procedures and functions
'INSERT' and 'UPDATE' for the *note 'sys_config': sys-sys-config. table, if changes are to be made to it
Additional privileges for certain note 'sys': sys-schema. schema stored procedures and functions, as noted in their descriptions (for example, the note 'ps_setup_save()': sys-ps-setup-save. procedure)
It is also necessary to have privileges for the objects underlying the *note 'sys': sys-schema. schema objects:
'SELECT' on any Performance Schema tables accessed by note 'sys': sys-schema. schema objects, and 'UPDATE' for any tables to be updated using note 'sys': sys-schema. schema objects
'PROCESS' for the 'INFORMATION_SCHEMA' *note 'INNODB_BUFFER_PAGE': information-schema-innodb-buffer-page-table. table
Certain Performance Schema instruments and consumers must be enabled and (for instruments) timed to take full advantage of *note 'sys': sys-schema. schema capabilities:
All 'wait' instruments
All 'stage' instruments
All 'statement' instruments
'XXX_current' and 'XXX_history_long' consumers for all events
You can use the *note 'sys': sys-schema. schema itself to enable all of the additional instruments and consumers:
CALL sys.ps_setup_enable_instrument('wait');
CALL sys.ps_setup_enable_instrument('stage');
CALL sys.ps_setup_enable_instrument('statement');
CALL sys.ps_setup_enable_consumer('current');
CALL sys.ps_setup_enable_consumer('history_long');
Note:
For many uses of the 'sys' schema, the default Performance Schema is sufficient for data collection. Enabling all the instruments and consumers just mentioned has a performance impact, so it is preferable to enable only the additional configuration you need. Also, remember that if you enable additional configuration, you can easily restore the default configuration like this:
CALL sys.ps_setup_reset_to_default(TRUE);
File: manual.info.tmp, Node: sys-schema-usage, Next: sys-schema-progress-reporting, Prev: sys-schema-prerequisites, Up: sys-schema