Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report