Query performance analysis

Updated at: 2025-03-25 06:08

In ApsaraDB for SelectDB, the EXPLAIN statements and the query profile feature are essential for analyzing and optimizing the query performance. The EXPLAIN statements and the query profile feature help you understand the query process, identify performance bottlenecks, and obtain optimization guidelines from different perspectives.

  • The EXPLAIN statements serve as a performance analysis tool based on execution plans. It helps you understand the execution plans of queries, identifies potential issues, and provides optimization guidelines.

  • The query profile feature is a performance analysis tool based on statistical metrics used during the query. It provides actual performance data during the query to locate bottlenecks and verify the optimization effectiveness.

The EXPLAIN statements and the query profile feature complement each other. You can combine the tools to fully understand the query process and performance of an ApsaraDB for SelectDB. This helps achieve efficient query optimization.

Tool

EXPLAIN statement

Query profile

Tool

EXPLAIN statement

Query profile

Positioning

A performance analysis tool based on execution plans.

A performance analysis tool based on quantitative statistical metrics.

Functionality

  • Checks whether the execution plan generated by the optimizer is reasonable.

  • Identifies potential performance issues.

  • Verifies the optimization effectiveness.

  • Monitors the query performance during the query execution.

  • Locates performance bottlenecks.

  • Verifies the optimization effectiveness.

Scenario

  • You want to analyze the execution plan before the optimization.

  • You want to design indexes and materialized views or adjust the SQL logic.

  • You want to verify the performance after the optimization.

  • You want to analyze performance bottlenecks during the query.

    Feedback