Statement Digest General Concepts •Statement Digests in the Performance Schema •Statement Digest Memory Use •Statement Sampling •Performance Schema digest instrumentation is enabled •MySQL Enterprise Firewall is enabled •A Query Rewrite Plugin is enabled •If MySQL Enterprise Firewall is enabled, it is called and the digest as computed is available to it. •If any Query Rewrite Plugin is enabled, it is called and the statement digest and digest value are available to it. •If the Performance Schema has digest instrumentation enabled, it makes a copy of the normalized statement digest, allocating a maximum of  performance_schema_max_digest_length  bytes for it. Consequently, if  performance_schema_max_digest_length  is less than  max_digest_length , the copy is truncated relative to the original. The copy of the normalized statement digest is stored in the appropriate Performance Schema tables, along with the SHA-256 hash value computed from the original normalized statement. (If the Performance Schema truncates its copy of the normalized statement digest relative to the original, it does not recompute the SHA-256 hash value.) •Object identifiers such as database and table names are preserved. •Literal values are converted to parameter markers. A normalized statement does not retain information such as names, passwords, dates, and so forth. •Comments are removed and whitespace is adjusted. 4934 Statement normalization transforms the statement text to a more standardized digest string representation that preserves the general statement structure while removing information not essential to the structure: After the normalized statement has been computed, a SHA-256 hash value is computed from it. In addition: Setting the  max_digest_length  system variable to zero disables digest production, which also disables server functionality that requires digests. The  max_digest_length  system variable value determines the maximum number of bytes available per session for computation of normalized statement digests. Once that amount of space is used during digest computation, truncation occurs: no further tokens from a parsed statement are collected or figure into its digest value. Statements that differ only after that many bytes of parsed tokens produce the same normalized statement digest and are considered identical if compared or if aggregated for digest statistics. The parser is also used by the  STATEMENT_DIGEST_TEXT()  and  STATEMENT_DIGEST()  functions, which applications can call to compute a normalized statement digest and a digest hash value, respectively, from an SQL statement. When the parser receives an SQL statement, it computes a statement digest if that digest is needed, which is true if any of the following conditions are true: Statement Digest General Concepts Warning