Spec-Zone .ru
спецификации, руководства, описания, API

21.9.8.3. Statement Summary Tables

The statement summary tables aggregate information about statement events:

For example:

mysql> SELECT * FROM
        events_statements_summary_global_by_event_name\G*************************** 1. row ***************************                 EVENT_NAME: statement/sql/select                 COUNT_STAR: 25             SUM_TIMER_WAIT: 1535983999000             MIN_TIMER_WAIT: 209823000             AVG_TIMER_WAIT: 61439359000             MAX_TIMER_WAIT: 1363397650000              SUM_LOCK_TIME: 20186000000                 SUM_ERRORS: 0               SUM_WARNINGS: 0          SUM_ROWS_AFFECTED: 0              SUM_ROWS_SENT: 388          SUM_ROWS_EXAMINED: 370SUM_CREATED_TMP_DISK_TABLES: 0     SUM_CREATED_TMP_TABLES: 0       SUM_SELECT_FULL_JOIN: 0 SUM_SELECT_FULL_RANGE_JOIN: 0           SUM_SELECT_RANGE: 0     SUM_SELECT_RANGE_CHECK: 0            SUM_SELECT_SCAN: 6      SUM_SORT_MERGE_PASSES: 0             SUM_SORT_RANGE: 0              SUM_SORT_ROWS: 0              SUM_SORT_SCAN: 0          SUM_NO_INDEX_USED: 6     SUM_NO_GOOD_INDEX_USED: 0...

TRUNCATE TABLE is permitted for statement summary tables. For events_statements_summary_by_digest, it empties the table. For the other statement summary tables, it resets the counters to zero rather than removing rows.

The statement summary tables have these grouping columns to indicate how events are aggregated:

The statement summary tables have these summary columns containing aggregated values:

The events_statements_summary_by_digest table has these additional summary columns:

These tables were added in MySQL 5.6.3, except that events_statements_summary_by_digest was added in 5.6.5.

Statement Digest Aggregation Rules

If the statement_digest consumer is enabled, aggregation into events_statements_summary_by_digest occurs as follows when a statement completes. Aggregation is based on the DIGEST value computed for the statement.

The row with DIGEST = NULL is maintained because Performance Schema tables have a maximum size due to memory constraints. The DIGEST = NULL row permits digests that do not match other rows to be counted even if the summary table is full, using a common "other" bucket. This row helps you estimate whether the digest summary is representative: