When analyzing query performance, it is crucial to access the full SQL text of the top 100 slowest and most resource-intensive SELECT queries. However, the query text stored in the performance_schema tables is subject to length limitations defined by the performance_schema_digests_size variable. As a result, truncated queries hinder the ability to perform detailed analysis and optimization.
To resolve this, incrementally increase the following variables to allow for longer query text storage:
- max_digest_length
- performance_schema_max_sql_text_length
- performance_schema_max_digest_length
Increment these values in the following steps: 1024, 2048, 3072, 4096, 8192, 16384, 32768, and 65536. After each adjustment, recheck the Query Truncation Status to determine if truncation persists. Keep in mind that changes may take up to 24 hours to reflect in the performance_schema data.
By ensuring queries are fully captured, you enable more precise query analysis and optimization, ultimately improving overall database performance.