Day 14 MySQL sys Schema

MySQL 5.7.7 and higher includes the sys schema,

This has View, Stored Procedures and Functions to gather the performance related information, as it works on Performance Schema the Performance Schema must be enabled for the sys database.

Following some of the important tables:

sys_config: Contains information about configurations (variables).

We can enabled the performance related events as follows:

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


It is recommended to enable only default instruments and consumers so that if you like you can restore it quick instead to make customized and having problem for restore/resetup.

CALL sys.ps_setup_reset_to_default(TRUE);

Sys schema is introduced MySQL 5.7.7 so still DBA has to explore it more as most of the environments are still earlier then this



This entry was posted in MySQL, Others, Performance Tuning, What I learned today and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.