Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the meaning of thread ID of performance_schema.threads in MySQL

Shulou Source: shulou.com Published: 2022-05-31 15:24:57 11月15日 Update

This article mainly introduces "what is the meaning of thread ID of performance_schema.threads in MySQL". In daily operation, I believe that many people have doubts about the meaning of thread ID of performance_schema.threads in MySQL. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the question of "what is the meaning of thread ID in MySQL?" Next, please follow the editor to study!

Simple record

I have never looked at the meaning of the following three kinds of ID:

(root@localhost) [05:47:31] [performance_schema;] > select THREAD_ID,PROCESSLIST_ID,THREAD_OS_ID from performance_schema.threads +-+ | THREAD_ID | PROCESSLIST_ID | THREAD_OS_ID | +-+ | 1 | NULL | 17721 | | 2 | NULL | 17728 | | 3 | NULL | 17729 | | 4 | NULL | 17730 | | 5 | NULL | 17731 | 6 | NULL | 17732 | | 7 | NULL | 17733 | | 8 | NULL | 17734 | 9 | NULL | 17735 | 10 | NULL | 17736 | 11 | NULL | 17737 | 12 | NULL | 17738 | 13 | NULL | 17739 | 15 | NULL | 17743 | | 16 | NULL | 17744 | 17 | NULL | 17745 | 18 | NULL | 17746 | 19 | NULL | 17747 | 20 | NULL | 17749 | 21 | NULL | 17748 | | 22 | NULL | 17750 | | 23 | NULL | | 17751 | | 24 | NULL | 17752 | | 25 | NULL | 17763 | | 26 | 1 | 17764 | 27 | 2 | 17969 | | 44 | 19 | 31424 | +-- | -- +

A counter in THREAD_ID:performance_schema is as follows:

PFS_thread* create_thread (PFS_thread_class * klass, const void * identity, ulonglong processlist_id) {PFS_thread* pfs; pfs_dirty_state dirty_state; pfs= global_thread_container.allocate (& dirty_state); if (pfs! = NULL) {pfs- > PFS_atomic::add_u64 (& thread, 1) Pfs- > massiparentthread readreadable processlist_id = 0; pfs- > mmixprocessListroomid= static_cast (processlist_id)

The thread_internal_id_counter counter keeps increasing. You can see that this is used internally by performance_schema.

PROCESSLIST_ID

The parameter processlist_id is passed in, which is what we usually show processlist. It is generally used by the MySQL layer.

THREAD_OS_ID

OS-level thread ID, from the function

Pfs- > m _ thread _ thread _ ID = my_thread_os_id (); at this point, the study of "what is the meaning of thread ID in MySQL" is over, hoping to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Threads meaning learning more counters questions help utility and then that is functions parameters meaning articles methods theories knowledge articles levels websites Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei Redmi Xiaomi vpn