MySQL 8.0.40
Source Code Documentation
|
The Performance Schema Resource Group service provides methods to:
Once assigned, the resource group name is visible in the PERFORMANCE_SCHEMA.THREADS table.
A group name can be assigned to the current thread or to another thread identified by either a thread id or a pointer to thread instrumentation.
User-defined data can also be assigned to the thread.
To assign a group name to the current thread, use:
where
group_name
is the resource group name stringgroup_name_len
is the length of resource group name stringuser_data
is an optional user-defined contextTo assign a group name and user data to another thread, use:
where
psi_thread
is the target thread instrumentation. Ignored if NULL.thread_id
is the thread id of the target thread (THREADS.THREAD_ID). Only used if thread is NULL.group_name
is the resource group name stringgroup_name_len
is the length of resource group name stringuser_data
is the optional user-defined contextBoth functions return 0 if successful, or 1 otherwise.
The group name is limited to 64 characters, UTF8. Names longer than 64 characters will be truncated. user_data is an optional user-defined context associated with thread_id that will be returned to the callback function in the thread attributes structure.
To get the system and security attributes for the current thread, use:
where
thread_attrs
is a pointer to a thread attribute structure PSI_thread_attrsTo get the system and security attributes for another thread identified either by a thread id or by the thread instrumentation, use:
where psi_thread
is the target thread instrumentation. Ignored if NULL. thread_id
is the thread id of the target thread (THREADS.THREAD_ID). Only used if psi_thread is NULL. thread_attrs
is a pointer to thread attribute structure, PSI_thread_attrs
Both function return 0 if successful or 1 otherwise.