content_image/769574.jpg
Given a numeric Performance Schema latency or wait time in picoseconds, converts it to human- readable format and returns a string consisting of a value and a units indicator. The string contains the decimal time rounded to 2 decimal places and a minimum of 3 significant digits. Times under 1 nanosecond are represented as whole numbers and are not rounded. 

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

mysql> SELECT FORMAT_PICO_TIME(3501), FORMAT_PICO_TIME(188732396662000); +------------------------+-----------------------------------+ | FORMAT_PICO_TIME(3501) | FORMAT_PICO_TIME(188732396662000) | +------------------------+-----------------------------------+ | 3.50 ns | 3.15 min | +------------------------+-----------------------------------+ 

FORMAT_PICO_TIME()  was added in MySQL 8.0.16. It may be used instead of the sys  schema format_time()  function, keeping in mind these differences: 

•To indicate minutes, sys.format_time()  uses the m  units indicator, whereas FORMAT_PICO_TIME()  uses min . 

• sys.format_time()  uses the w  (weeks) units indicator. FORMAT_PICO_TIME()  does not. 

• PS_CURRENT_THREAD_ID() 

Returns a BIGINT UNSIGNED  value representing the Performance Schema thread ID assigned to the current connection. 

The thread ID return value is a value of the type given in the THREAD_ID  column of Performance Schema tables. 

Performance Schema configuration affects PS_CURRENT_THREAD_ID()  the same way as for PS_THREAD_ID() . For details, see the description of that function. 

mysql> SELECT PS_CURRENT_THREAD_ID(); +------------------------+ | PS_CURRENT_THREAD_ID() | +------------------------+ | 52 | +------------------------+ mysql> SELECT PS_THREAD_ID(CONNECTION_ID()); +-------------------------------+ | PS_THREAD_ID(CONNECTION_ID()) | +-------------------------------+ | 52 | +-------------------------------+ 

