MySQL 8.0 Reference Manual Including MySQL NDB Cluster 8.0

14.21 Performance Schema Functions

As of MySQL 8.0.16, MySQL includes built-in SQL functions that format or retrieve Performance Schema data, and that may be used as equivalents for the corresponding sys schema stored functions. The built-in functions can be invoked in any schema and require no qualifier, unlike the sys functions, which require either a sys. schema qualifier or that sys be the current schema.

Table 14.31 Performance Schema Functions

Name Description Introduced
FORMAT_BYTES() Convert byte count to value with units 8.0.16
FORMAT_PICO_TIME() Convert time in picoseconds to value with units 8.0.16
PS_CURRENT_THREAD_ID() Performance Schema thread ID for current thread 8.0.16
PS_THREAD_ID() Performance Schema thread ID for given thread 8.0.16

The built-in functions supersede the corresponding sys functions, which are deprecated; expect them to be removed in a future version of MySQL. Applications that use the sys functions should be adjusted to use the built-in functions instead, keeping in mind some minor differences between the sys functions and the built-in functions. For details about these differences, see the function descriptions in this section.