Rechercher dans le manuel MySQL
8.14.1 Accessing the Process List
The following discussion enumerates the sources of process information, the privileges required to see process information, and describes the content of process list entries.
Sources of Process Information
Process information is available from these sources:
The
SHOW PROCESSLIST
statement: Section 13.7.7.29, “SHOW PROCESSLIST Statement”The mysqladmin processlist command: Section 4.5.2, “mysqladmin — A MySQL Server Administration Program”
The
INFORMATION_SCHEMA
PROCESSLIST
table: Section 26.23, “The INFORMATION_SCHEMA PROCESSLIST Table”The Performance Schema
processlist
table: Section 27.12.19.9, “The processlist Table”The Performance Schema
threads
table columns with names having a prefix ofPROCESSLIST_
: Section 27.12.19.10, “The threads Table”The
sys
schemaprocesslist
andsession
views: Section 28.4.3.22, “The processlist and x$processlist Views”, and Section 28.4.3.33, “The session and x$session Views”
The threads
table compares to
SHOW PROCESSLIST
,
INFORMATION_SCHEMA
PROCESSLIST
, and
mysqladmin processlist as follows:
Access to the
threads
table does not require a mutex and has minimal impact on server performance. The other sources have negative performance consequences because they require a mutex.NoteAs of MySQL 8.0.22, an alternative implementation for
SHOW PROCESSLIST
is available based on the Performance Schemaprocesslist
table, which, like thethreads
table, does not require a mutex and has better performance characteristics. For details, see Section 27.12.19.9, “The processlist Table”.The
threads
table displays background threads, which the other sources do not. It also provides additional information for each thread that the other sources do not, such as whether the thread is a foreground or background thread, and the location within the server associated with the thread. This means that thethreads
table can be used to monitor thread activity the other sources cannot.You can enable or disable Performance Schema thread monitoring, as described in Section 27.12.19.10, “The threads Table”.
For these reasons, DBAs who perform server monitoring using
one of the other thread information sources may wish to
monitor using the threads
table
instead.
The sys
schema
processlist
view presents
information from the Performance Schema
threads
table in a more
accessible format. The sys
schema
session
view presents
information about user sessions like the
sys
schema
processlist
view, but with
background processes filtered out.
For most sources of process information, if you have the
PROCESS
privilege, you can see
all threads, even those belonging to other users. Otherwise
(without the PROCESS
privilege), nonanonymous users have access to information
about their own threads but not threads for other users, and
anonymous users have no access to thread information.
The Performance Schema threads
table also provides thread information, but table access uses
a different privilege model. See
Section 27.12.19.10, “The threads Table”.
Each process list entry contains several pieces of
information. The following list describes them using the
labels from SHOW PROCESSLIST
output. Other process information sources use similar labels.
Id
is the connection identifier for the client associated with the thread.User
andHost
indicate the account associated with the thread.db
is the default database for the thread, orNULL
if none has been selected.Command
andState
indicate what the thread is doing.Most states correspond to very quick operations. If a thread stays in a given state for many seconds, there might be a problem that needs to be investigated.
The following sections list the possible
Command
values, andState
values grouped by category. The meaning for some of these values is self-evident. For others, additional description is provided.NoteApplications that examine process list information should be aware that the commands and states are subject to change.
Time
indicates how long the thread has been in its current state. The thread's notion of the current time may be altered in some cases: The thread can change the time withSET TIMESTAMP =
. For a replica SQL thread, the value is the number of seconds between the timestamp of the last replicated event and the real time of the replica host. See Section 17.2.3, “Replication Threads”.value
Info
indicates the statement the thread is executing, orNULL
if it is executing no statement. ForSHOW PROCESSLIST
, this value contains only the first 100 characters of the statement. To see complete statements, useSHOW FULL PROCESSLIST
(or query a diffferent process information source).
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-processlist-access.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.