content_image/699988.jpg
It is also necessary to have privileges for the objects underlying the sys  schema objects: 

• SELECT  on any Performance Schema tables accessed by sys  schema objects, and UPDATE  for any tables to be updated using sys  schema objects 

• PROCESS  for the INFORMATION_SCHEMA INNODB_BUFFER_PAGE  table 

Certain Performance Schema instruments and consumers must be enabled and (for instruments) timed to take full advantage of sys  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 sys  schema itself to enable all of the additional instruments and consumers: 

## 28.2 Using the sys Schema 

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’); 

<img src='content_image/699988.jpg'>

## 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); 

You can make the sys  schema the default schema so that references to its objects need not be qualified with the schema name: 

mysql> USE sys; Database changed mysql> SELECT * FROM version; +-------------+---------------+ | sys_version | mysql_version | +-------------+---------------+ | 2.0.0 | 8.0.13-debug | +-------------+---------------+ 

(The version  view shows the sys  schema and MySQL server versions.) 

To access sys  schema objects while a different schema is the default (or simply to be explicit), qualify object references with the schema name: 

mysql> SELECT * FROM sys.version; +-------------+---------------+ | sys_version | mysql_version | +-------------+---------------+ | 2.0.0 | 8.0.13-debug | +-------------+---------------+ 

