Using the sys.format_path() Function to Dynamically Replace a Subpath with its Equivalent System Variable in MySQL

In MySQL, the sys.format_path() function is a stored function in the sys schema. It accepts a path name, and returns the modified path name after replacing subpaths that match the values of certain system variables.

So we can use the function to dynamically replace part or all of our path with a system variable that matches that path segment.

Continue reading

Understanding the sys.ps_is_thread_instrumented() Function in MySQL

In MySQL, we can use the sys.ps_is_thread_instrumented() function to check whether Performance Schema instrumentation for a given connection ID is enabled.

The function returns YES or NO, depending on whether the instrumentation is enabled for the given connection. It can also return UNKNOWN if the connection ID is unknown, and NULL if the connection ID is NULL.

Continue reading