Statement Digests in the Performance Schema Consider these statements: To normalize these statements, the parser replaces data values by  ?  and adjusts whitespace. Both statements yield the same normalized form and thus are considered “the same” : The normalized statement contains less information but is still representative of the original statement. Other similar statements that have different data values have the same normalized form. Now consider these statements: SELECT * FROM orders WHERE customer_id=10 AND quantity>20 SELECT * FROM orders WHERE customer_id = 20 AND quantity > 100 SELECT * FROM orders WHERE customer_id = ? AND quantity > ? SELECT * FROM customers WHERE customer_id = 1000 SELECT * FROM orders WHERE customer_id = 1000 In this case, the normalized statements differ because the object identifiers differ: SELECT * FROM customers WHERE customer_id = ? SELECT * FROM orders WHERE customer_id = ? If normalization produces a statement that exceeds the space available in the digest buffer (as determined by  max_digest_length ), truncation occurs and the text ends with “...” . Long normalized statements that differ only in the part that occurs following the “...”  are considered the same. Consider these statements: SELECT * FROM mytable WHERE cola = 10 AND colb = 20 SELECT * FROM mytable WHERE cola = 10 AND colc = 20 If the cutoff happens to be right after the  AND , both statements have this normalized form: SELECT * FROM mytable WHERE cola = ? AND ... In this case, the difference in the second column name is lost and both statements are considered the same. In the Performance Schema, statement digesting involves these elements: Statement Digests in the Performance Schema •A  statements_digest  consumer in the  setup_consumers  table controls whether the Performance Schema maintains digest information. See Statement Digest Consumer. •The statement event tables ( events_statements_current ,  events_statements_history , and events_statements_history_long ) have columns for storing normalized statement digests and the corresponding digest SHA-256 hash values: • DIGEST_TEXT  is the text of the normalized statement digest. This is a copy of the original normalized statement that was computed to a maximum of  max_digest_length  bytes, further truncated as necessary to  performance_schema_max_digest_length  bytes. • DIGEST  is the digest SHA-256 hash value computed from the original normalized statement. •The  events_statements_summary_by_digest  summary table provides aggregated statement digest information. This table aggregates information for statements per  SCHEMA_NAME  and  DIGEST combination. The Performance Schema uses SHA-256 hash values for aggregation because See Section 27.12.6, “Performance Schema Statement Event Tables” . 4935