content_image/702139.jpg content_image/702142.jpg
The sys  schema contains many views that summarize Performance Schema tables in various ways. Most of these views come in pairs, such that one member of the pair has the same name as the other member, plus a x$  prefix. For example, the host_summary_by_file_io  view summarizes file I/O grouped by host and displays latencies converted from picoseconds to more readable values (with units); 

mysql> SELECT * FROM sys.host_summary_by_file_io; 

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

The x$host_summary_by_file_io  view summarizes the same data but displays unformatted picosecond latencies: 

mysql> SELECT * FROM sys.x$host_summary_by_file_io; 

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

The view without the x$  prefix is intended to provide output that is more user friendly and easier for humans to read. The view with the x$  prefix that displays the same values in raw form is intended more for use with other tools that perform their own processing on the data. For additional information about the differences between non- x$  and x$  views, see Section 28.4.3, “sys Schema Views” . 

To examine sys  schema object definitions, use the appropriate SHOW  statement or INFORMATION_SCHEMA  query. For example, to examine the definitions of the session  view and format_bytes()  function, use these statements: 

mysql> SHOW CREATE VIEW sys.session; mysql> SHOW CREATE FUNCTION sys.format_bytes; 

However, those statements display the definitions in relatively unformatted form. To view object definitions with more readable formatting, access the individual .sql  files found under the scripts/sys_schema  in MySQL source distributions. Prior to MySQL 8.0.18, the sources are maintained in a separate distribution available from the sys  schema development website at https://github.com/mysql/mysql-sys. 

Neither mysqldump  nor mysqlpump  dump the sys  schema by default. To generate a dump file, name the sys  schema explicitly on the command line using either of these commands: 

## 28.3 sys Schema Progress Reporting 

mysqldump --databases --routines sys > sys_dump.sql mysqlpump sys > sys_dump.sql 

To reinstall the schema from the dump file, use this command: 

mysql < sys_dump.sql 

The following sys  schema views provide progress reporting for long-running transactions: 

processlist session x$processlist x$session 

Assuming that the required instruments and consumers are enabled, the progress  column of these views shows the percentage of work completed for stages that support progress reporting. 

