All Products
Search
Document Center

AnalyticDB:Query-level diagnosis results

Last Updated:Mar 28, 2026

AnalyticDB for MySQL SQL diagnostics collects execution statistics at the query, stage, and operator levels to identify performance issues and surface optimization suggestions. This topic describes the four query-level diagnosis types and how to resolve each one.

Note To view query-level diagnosis results for a specific query, see View diagnosis results.

Diagnosis types

Diagnosis typeImpact
Large amounts of data returned to the clientSlows queries and consumes frontend network bandwidth
Large amounts of memory resources consumed by a queryMay cause other queries to fail and reduce overall cluster stability
Large number of stages generated for a queryConsumes network resources and increases system complexity
Large amount of data read by a queryConsumes disk I/O resources and affects other queries and data writes

Large amounts of data returned to the client

Problem: When a query returns large amounts of data to the client, it occupies frontend network resources and causes slow query execution. Check Returned Data in the Query Properties section of the query details page to confirm the volume. For more information, see View query properties.

Fix: Reduce the amount of data returned to the client:

Large amounts of memory resources consumed by a query

Problem: A query is consuming a large amount of memory resources. This can cause execution failures in other queries, reduce execution speeds, and affect the overall stability of your AnalyticDB for MySQL cluster. Check Peak Memory in the Query Properties section of the query details page to confirm the memory usage. For more information, see View query properties.

Fix: Use execution plans in SQL diagnostics to locate the stage or operator consuming excessive memory, then apply the appropriate optimization:

Large number of stages generated for a query

Problem: A query is generating a large number of stages, which consumes network resources, increases system processing complexity, and poses risks to overall cluster stability. The greater the number of joins in SQL statements, the greater the number of stages generated. For background on what affects stage count, see Factors that affect query performance.

Fix: Reduce the number of stages generated:

  • Join tables before writing data into AnalyticDB for MySQL to reduce the total number of tables in the cluster.

  • Reduce the number of joins in SQL statements. Fewer joins produce fewer stages.

  • Use materialized views. AnalyticDB for MySQL reuses stages when executing queries against materialized views, which lowers the total stage count. For more information, see Overview.

Large amount of data read by a query

Problem: A query is scanning a large amount of data, consuming disk I/O resources and affecting the performance of other queries and data writes. Check Scanned Data in the Query Properties section of the query details page to confirm the scan volume. For more information, see View query properties.

Fix: First, identify the stage and TableScan operator responsible for the large scan. In the Statistics section of the execution plan (stage level), check Scanned Rows and Scan Size. In the Statistics section at the operator level, check Input Rows and Amount of Input Data for the TableScan operator. For reference, see State statistics and Operator statistics.

After identifying the TableScan operator with the large scan, use one of the following approaches to reduce the scan volume:

  • Add an AND filter condition to the query.

  • Adjust existing filter conditions to reduce the amount of data filtered at the scan stage.

  • Check whether any filter conditions are not pushed down to the scan. If so, follow the optimization suggestions in Filter conditions are not pushed down.