Skip to content

Latest commit

 

History

History
158 lines (87 loc) · 6.19 KB

File metadata and controls

158 lines (87 loc) · 6.19 KB
title summary aliases
Analyze and Tune Performance
Learn how to analyze and tune performance in TiDB Cloud.
/tidbcloud/index-insight

Analyze and Tune Performance

TiDB Cloud provides Slow Query, Statement Analysis, and Key Visualizer to analyze performance.

TiDB Cloud provides Slow Query and SQL Statement to analyze performance.

  • Slow Query lets you search and view all slow queries in your TiDB clusterinstance, and explore the bottlenecks of each slow query by viewing its execution plan, SQL execution information, and other details.

  • Statement AnalysisSQL Statement enables you to directly observe the SQL execution on the page, and easily locate performance problems without querying the system tables.

  • Key Visualizer helps you observe TiDB's data access patterns and data hotspots.

Note:

Currently, Key Visualizer is only available on TiDB Cloud Dedicated clusters.

View the Diagnosis page

  1. On the Clusters page of your project, click the name of your target cluster to go to its overview page.

    Tip:

    You can use the combo box in the upper-left corner to switch between organizations, projects, and clusters.

  2. In the left navigation pane, click Monitoring > Diagnosis.

  1. On the TiDB Instances page of your organization, click the name of your target instance to go to its overview page.

    Tip:

    You can use the combo box in the upper-left corner to switch between organizations and instances.

  2. In the left navigation pane, click Monitoring.

Slow Query

By default, SQL queries that take more than 300 milliseconds are considered as slow queries.

To view slow queries in a TiDB clusterinstance, perform the following steps:

  1. Navigate to the Diagnosis page of a cluster.

  2. Click the Slow Query tab.

  3. Click any slow query in the list to display its detailed execution information.

  4. (Optional) You can filter slow queries based on the target time range, the related databases, and SQL keywords. You can also limit the number of slow queries to be displayed.

  1. Navigate to the overview page of the TiDB instance, and then click Monitoring > Slow Query in the left navigation pane.

  2. Select a slow query from the list to view its detailed execution information.

  3. (Optional) You can filter slow queries based on the target time range and SQL keywords. You can also limit the number of slow queries to be displayed.

The results are displayed in the form of a table, and you can sort the results by different columns.

Note:

To improve traffic visibility, {{{ .starter }}} and {{{ .essential }}} now display the real client IP address for connections via AWS PrivateLink in detailed execution information. Currently, this feature is in beta and is available only in the AWS region Frankfurt (eu-central-1).

For more information, see Slow Queries in TiDB Dashboard.

Statement Analysis

To use the statement analysis, perform the following steps:

  1. Navigate to the Diagnosis page of a cluster.

  2. Click the SQL Statement tab.

  3. Select the time period to be analyzed in the time interval box. Then you can get the execution statistics of SQL statements of all databases in this period.

  4. (Optional) If you only care about certain databases, you can select the corresponding schema(s) in the next box to filter the results.

SQL Statement

To use the SQL Statement page, perform the following steps:

  1. Navigate to the overview page of the TiDB instance, and then click Monitoring > SQL Statement in the left navigation pane.

  2. Click a SQL statement in the list to view its detailed execution information.

  3. In the time interval box, select the time period to be analyzed. Then you can get the execution statistics for SQL statements across all databases in this period.

  4. (Optional) If you only care about certain databases, you can select the corresponding schema(s) in the next box to filter the results.

The results are displayed in the form of a table, and you can sort the results by different columns.

For more information, see Statement Execution Details in TiDB Dashboard.

Key Visualizer

Note:

Key Visualizer is only available for TiDB Cloud Dedicated clusters.

To view the key analytics, perform the following steps:

  1. Navigate to the Diagnosis page of a cluster.

  2. Click the Key Visualizer tab.

On the Key Visualizer page, a large heat map shows how access traffic changes over time. The average values along each axis of the heat map are shown below and on the right side. The left side displays the table name, index name, and other related information.

For more information, see Key Visualizer.