Rechercher dans le manuel MySQL
27.4.4.22 The ps_trace_statement_digest() Procedure
Traces all Performance Schema instrumentation for a specific statement digest.
If you find a statement of interest within the Performance
Schema
events_statements_summary_by_digest
table, specify its DIGEST
column MD5 value
to this procedure and indicate the polling duration and
interval. The result is a report of all statistics tracked
within Performance Schema for that digest for the interval.
The procedure also attempts to execute
EXPLAIN
for the longest running
example of the digest during the interval. This attempt might
fail because the Performance Schema truncates long
SQL_TEXT
values. Consequently,
EXPLAIN
will fail due to parse
errors.
This procedure disables binary logging during its execution by
manipulating the session value of the
sql_log_bin
system variable.
That is a restricted operation, so the procedure requires
privileges sufficient to set restricted session variables. See
Section 5.1.9.1, “System Variable Privileges”.
Parameters
in_digest VARCHAR(32)
: The statement digest identifier to analyze.in_runtime INT
: How long to run the analysis in seconds.in_interval DECIMAL(2,2)
: The analysis interval in seconds (which can be fractional) at which to try to take snapshots.in_start_fresh BOOLEAN
: Whether to truncate the Performance Schemaevents_statements_history_long
andevents_stages_history_long
tables before starting.in_auto_enable BOOLEAN
: Whether to automatically enable required consumers.
- +--------------------+
- | SUMMARY STATISTICS |
- +--------------------+
- | SUMMARY STATISTICS |
- +--------------------+
- +------------+-----------+-----------+-----------+---------------+------------+------------+
- | executions | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scans |
- +------------+-----------+-----------+-----------+---------------+------------+------------+
- | 21 | 4.11 ms | 2.00 ms | 0 | 21 | 0 | 0 |
- +------------+-----------+-----------+-----------+---------------+------------+------------+
- +------------------------------------------+-------+-----------+
- +------------------------------------------+-------+-----------+
- | stage/sql/statistics | 16 | 546.92 us |
- | stage/sql/freeing items | 18 | 520.11 us |
- | stage/sql/init | 51 | 466.80 us |
- ...
- | stage/sql/cleaning up | 18 | 11.92 us |
- | stage/sql/executing | 16 | 6.95 us |
- +------------------------------------------+-------+-----------+
- +---------------------------+
- | LONGEST RUNNING STATEMENT |
- +---------------------------+
- | LONGEST RUNNING STATEMENT |
- +---------------------------+
- +-----------+-----------+-----------+-----------+---------------+------------+-----------+
- | thread_id | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scan |
- +-----------+-----------+-----------+-----------+---------------+------------+-----------+
- | 166646 | 618.43 us | 1.00 ms | 0 | 1 | 0 | 0 |
- +-----------+-----------+-----------+-----------+---------------+------------+-----------+
- # Truncated for clarity...
- +-----------------------------------------------------------------+
- | sql_text |
- +-----------------------------------------------------------------+
- +-----------------------------------------------------------------+
- +------------------------------------------+-----------+
- | event_name | latency |
- +------------------------------------------+-----------+
- | stage/sql/init | 8.61 us |
- | stage/sql/init | 331.07 ns |
- ...
- | stage/sql/freeing items | 30.46 us |
- | stage/sql/cleaning up | 662.13 ns |
- +------------------------------------------+-----------+
- +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
- +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
- +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
- Query OK, 0 rows affected (9.28 sec)
Traduction non disponible
Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-sys-ps-trace-statement-digest.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.