Collections:
PS_THREAD_ID() - PS Thread ID of Given Connect
How to obtain the performance schema thread id of a given connection using the PS_THREAD_ID() function?
✍: FYIcenter.com
PS_THREAD_ID(con) is a MySQL built-in function that
returns the performance schema thread id of a given connection.
For example:
SELECT CONNECTION_ID(); -- +-----------------+ -- | CONNECTION_ID() | -- +-----------------+ -- | 307 | -- +-----------------+ SELECT PS_THREAD_ID(307); -- +-------------------+ -- | PS_THREAD_ID(307) | -- +-------------------+ -- | 348 | -- +-------------------+ SELECT PS_CURRENT_THREAD_ID(); -- +------------------------+ -- | PS_CURRENT_THREAD_ID() | -- +------------------------+ -- | 348 | -- +------------------------+
Reference information of the PS_THREAD_ID() function:
PS_THREAD_ID(con): id Returns the performance schema thread id of a given connection. Arguments, return value and availability: con: Required. The connection id. id: Return value. The performance schema thread id of the given connection. Available since MySQL 8.0.
Related MySQL functions:
⇒ ROLES_GRAPHML() - User Role Graph in GraphML Format
⇐ PS_CURRENT_THREAD_ID() - PS Thread ID of Current Connect
2025-02-16, 2327🔥, 0💬
Popular Posts:
How To Replace Given Values with NULL using NULLIF() in SQL Server Transact-SQL? Sometime you want t...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time valu...