8.14.1 Accessing the Process List
Sources of Process Information
Process information is available from these sources:
1.The SHOW PROCESSLIST statement: Section 13.7.7.29, “SHOW PROCESSLIST Statement”
2.The INFORMATION_SCHEMA PROCESSLIST table: Section 26.3.23, “The INFORMATION_SCHEMA PROCESSLIST Table”
3.The Performance Schema processlist table: Section 27.12.21.5, “The processlist Table”
4.The Performance Schema threads table columns with names having a prefix of PROCESSLIST_: Section 27.12.21.6, “The threads Table”
5.The sys schema processlist and session views: Section 28.4.3.22, “The processlist and x$processlist Views”, and Section 28.4.3.33, “The session and x$session Views”
上文中 第二点提到 INFORMATION_SCHEMA PROCESSLIST table 和第三点提到 The Performance Schema processlist table 两种有什么区别?
INFORMATION_SCHEMA.PROCESSLIST是mysql的所有会话
PERFORMANCE_SCHEMA.THREAD是mysql的所有线程,除了会话之外还包括mysql本身的一些线程,比如主线程,刷脏页线程等等
PROCESSLIST可以用ID与THREAD的PROCESSLIST_ID关联