From ee628c775b29cee84f55f80701a5937a13813fff Mon Sep 17 00:00:00 2001 From: Lux Date: Wed, 31 May 2023 23:19:18 +0800 Subject: [PATCH 01/22] Update tune-performance.md --- tidb-cloud/tune-performance.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index d649e0518d0da..5025c7d0a9b50 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -72,3 +72,25 @@ To view the key analytics, perform the following steps: On the **Key Visualizer** page, a large heat map shows changes on access traffic over time. The average values ​​along each axis of the heat map are shown below and on the right side. The left side is the table name, index name and other information. For more information, see [Key Visualizer](https://docs.pingcap.com/tidb/stable/dashboard-key-visualizer). + +## Index Insight (Beta) + +> **Note:** +> +> Index Insight is only available for [Dedicated Tier clusters](/tidb-cloud/select-cluster-tier.md#dedicated-tier). + +To obtain the index recommendations, perform the following steps: + +1. Navigate to the **Diagnosis** page of a cluster. + +2. Click the **Index Insight (Beta)** tab. + +![Index Insight](/media/tidb-cloud/Index-Insight.png) + +3. Create a new SQL user dedicated to utilizing the Index Insight feature. + +4. Configure the necessary permissions and access for the dedicated SQL user. + +5. Manually trigger the Index Insight capability to receive index recommendations for slow queries without proper index usage. + +For more information, see [Index Insight](/tidb-cloud/index-insight). From 6062525a0600b5a0f376ed3ef425e1b7fad86ea4 Mon Sep 17 00:00:00 2001 From: Lux Date: Thu, 1 Jun 2023 00:00:37 +0800 Subject: [PATCH 02/22] Create index-insight.md --- tidb-cloud/index-insight.md | 99 +++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 tidb-cloud/index-insight.md diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md new file mode 100644 index 0000000000000..07b4b5200bc2a --- /dev/null +++ b/tidb-cloud/index-insight.md @@ -0,0 +1,99 @@ +--- +title: Index Insight +summary: Learn how to obtain the index recommendations for your slow queries. +--- + +# Index Insight + +## Introduction + +The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering index recommendations for slow queries that are not utilizing indexes effectively. This user guide will walk you through the steps to enable and utilize the Index Insight feature effectively. + +> **Note:** +> +> Index Insight is currently available as a Beta version, offering this feature for free to all users. +> This feature is only available for [Dedicated Tier clusters](/tidb-cloud/select-cluster-tier.md#dedicated-tier). + +## Value to Users: + +The Index Insight feature in TiDB Cloud brings several significant benefits to users: + +- Enhanced Query Performance: By identifying and recommending appropriate indexes for slow queries, users can significantly improve query execution time, leading to faster response times and a better user experience. + +- Cost Savings: Optimized query performance reduces the need for additional computing resources, allowing users to achieve more with their existing infrastructure and potentially saving on operational costs. + +- Simplified Optimization Process: Index Insight simplifies the process of identifying and implementing index improvements, eliminating the need for manual analysis and guesswork. Users can rely on the feature to provide accurate recommendations, saving time and effort. + +- Improved Application Efficiency: By optimizing database performance, applications running on TiDB Cloud can handle larger workloads and serve more concurrent users, enabling businesses to scale their operations effectively. + +## Enabling Index Insight + +To enable the Index Insight feature in TiDB Cloud, follow these steps: + +### Create a Dedicated SQL User + +Create a new SQL user dedicated to utilizing the Index Insight feature. This dedicated user will be used to trigger the capability and receive index recommendations. Ensure the user has the necessary permissions and access to query the relevant tables. + +Index insight requires read access to database information_schema and mysql. You can create a new SQL user on your SQL client to activate this feature. Please replace your user name and password in the 'yourusername' and 'yourpassword' field. + +CREATE user 'yourusername'@'%' IDENTIFIED by 'yourpassword'; +GRANT SELECT ON information_schema.* TO 'yourusername'@'%'; +GRANT SELECT ON mysql.* TO 'yourusername'@'%'; +GRANT PROCESS, REFERENCES ON *.* TO 'yourusername'@'%'; +FLUSH PRIVILEGES; + +## Activate the feature + +Enter the SQL user created specifically for Index Insight in the designated input field. Click on the "Activate" button to initiate the activation process. + +Note: Ensure that the SQL user you enter has the necessary permissions and access to query the relevant tables. If you haven't created a dedicated SQL user for Index Insight yet, please refer to the user documentation for instructions on creating one. + +## Trigger insight manually + +To manually trigger the index recommendation capability and obtain index suggestions, you should locate the "Check Up" button and click on it. + +After you triggered this insight, the functionality will initiate a scan of slow queries from the past 3 hours. Once the scan is complete, index recommendations will be provided based on the analysis. + +## Utilizing Index Recommendations + +Once the Index Insight feature has provided index recommendations, follow these guidelines to utilize them effectively: + +### Review Index Recommendations + +Review the index recommendations generated by the Index Insight. Each recommendation includes details such as the query, tables involved, and the suggested index. Evaluate the recommendations based on their potential impact on query performance. + +### Implementing Indexes + +To implement the recommended indexes, follow these steps: + +- Evaluate the impact of the proposed index on existing queries and workload. + +- Consider the storage requirements and potential trade-offs associated with the index implementation. + +- Use appropriate database management tools to create the recommended indexes on the relevant tables. + +- Monitor the performance after implementing the indexes to assess the improvements. + +## Best Practices + +Consider the following best practices when using the Index Insight feature: + +### Regularly Trigger Index Insight + +To keep your indexes optimized, it is recommended to trigger the Index Insight capability periodically or whenever there are significant changes to your queries or database schema. + +### Analyze Impact Before Implementing Indexes + +Before implementing the recommended indexes, analyze the potential impact on query execution plans, disk space, and any trade-offs involved. Prioritize implementing indexes that provide the most significant performance improvements. + +### Monitor Performance + +Continuously monitor query performance after implementing the recommended indexes to validate the improvements and make further adjustments if necessary. + +## Feedback and Support + +We value your feedback and are dedicated to improving the Index Insight feature. If you encounter any issues, have suggestions for enhancements, or need assistance, please reach out to our support team at [support email/URL]. + +## Conclusion + +By leveraging the Index Insight feature in TiDB Cloud, you can optimize query performance and enhance overall application efficiency. Follow the steps outlined in this user guide to enable the feature, review index recommendations, and implement them effectively. Regularly utilizing the Index Insight feature will help you maintain optimal query performance in your TiDB Cloud environment. From 716b4d73985d406d99ed898c782ce704a8cd2fae Mon Sep 17 00:00:00 2001 From: Lux Date: Thu, 1 Jun 2023 00:16:23 +0800 Subject: [PATCH 03/22] Update index-insight.md --- tidb-cloud/index-insight.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index 07b4b5200bc2a..9189bcd22c2ca 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -42,18 +42,30 @@ GRANT SELECT ON mysql.* TO 'yourusername'@'%'; GRANT PROCESS, REFERENCES ON *.* TO 'yourusername'@'%'; FLUSH PRIVILEGES; -## Activate the feature +### Activate the feature Enter the SQL user created specifically for Index Insight in the designated input field. Click on the "Activate" button to initiate the activation process. Note: Ensure that the SQL user you enter has the necessary permissions and access to query the relevant tables. If you haven't created a dedicated SQL user for Index Insight yet, please refer to the user documentation for instructions on creating one. -## Trigger insight manually +### Trigger insight manually To manually trigger the index recommendation capability and obtain index suggestions, you should locate the "Check Up" button and click on it. After you triggered this insight, the functionality will initiate a scan of slow queries from the past 3 hours. Once the scan is complete, index recommendations will be provided based on the analysis. +### Check the insight detail + +To view specific index commands and access detailed information about related slow queries, you need to click a insight on the list and enter the insight detail page. + +On the insight detail page, you will find the index commands corresponding to the recommended indexes. + +You can copy the index command(s) provided, open your TiDB instance or database management tool, and execute the copied index command(s) to create the recommended index(es) on the relevant table(s). + +Please note that executing the index command(s) may require appropriate permissions and access. Ensure that you have the necessary privileges to create indexes on the desired table(s). + +Additionally, on the Index Insight Detail Page, you can access detailed information about the slow queries associated with the index recommendations. This information may include the query text, execution plan, and other relevant metrics. Analyzing this information can help you better understand the performance issues and evaluate the impact of implementing the recommended indexes. + ## Utilizing Index Recommendations Once the Index Insight feature has provided index recommendations, follow these guidelines to utilize them effectively: @@ -90,10 +102,6 @@ Before implementing the recommended indexes, analyze the potential impact on que Continuously monitor query performance after implementing the recommended indexes to validate the improvements and make further adjustments if necessary. -## Feedback and Support - -We value your feedback and are dedicated to improving the Index Insight feature. If you encounter any issues, have suggestions for enhancements, or need assistance, please reach out to our support team at [support email/URL]. - ## Conclusion By leveraging the Index Insight feature in TiDB Cloud, you can optimize query performance and enhance overall application efficiency. Follow the steps outlined in this user guide to enable the feature, review index recommendations, and implement them effectively. Regularly utilizing the Index Insight feature will help you maintain optimal query performance in your TiDB Cloud environment. From 4f725fc5ee71db4f4e03404fa5a077a03ae7af23 Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 16:57:35 +0800 Subject: [PATCH 04/22] Apply suggestions from code review Co-authored-by: Aolin --- tidb-cloud/index-insight.md | 97 +++++++++++++++------------------- tidb-cloud/tune-performance.md | 21 ++------ 2 files changed, 47 insertions(+), 71 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index 9189bcd22c2ca..37434589e6168 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -1,90 +1,77 @@ --- -title: Index Insight -summary: Learn how to obtain the index recommendations for your slow queries. +title: Index Insight (Beta) +summary: Learn how to use the Index Insight feature in TiDB Cloud and obtain index recommendations for your slow queries. --- -# Index Insight +# Index Insight (Beta) -## Introduction - -The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering index recommendations for slow queries that are not utilizing indexes effectively. This user guide will walk you through the steps to enable and utilize the Index Insight feature effectively. +The Index Insight (beta) feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering index recommendations for slow queries that are not using indexes effectively. This document walks you through the steps to enable and utilize the Index Insight feature effectively. > **Note:** > -> Index Insight is currently available as a Beta version, offering this feature for free to all users. -> This feature is only available for [Dedicated Tier clusters](/tidb-cloud/select-cluster-tier.md#dedicated-tier). - -## Value to Users: - -The Index Insight feature in TiDB Cloud brings several significant benefits to users: - -- Enhanced Query Performance: By identifying and recommending appropriate indexes for slow queries, users can significantly improve query execution time, leading to faster response times and a better user experience. - -- Cost Savings: Optimized query performance reduces the need for additional computing resources, allowing users to achieve more with their existing infrastructure and potentially saving on operational costs. - -- Simplified Optimization Process: Index Insight simplifies the process of identifying and implementing index improvements, eliminating the need for manual analysis and guesswork. Users can rely on the feature to provide accurate recommendations, saving time and effort. +> Index Insight is currently in beta and this feature is only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters. -- Improved Application Efficiency: By optimizing database performance, applications running on TiDB Cloud can handle larger workloads and serve more concurrent users, enabling businesses to scale their operations effectively. - -## Enabling Index Insight - -To enable the Index Insight feature in TiDB Cloud, follow these steps: +## Introduction -### Create a Dedicated SQL User +The Index Insight feature provides you with the following benefits: -Create a new SQL user dedicated to utilizing the Index Insight feature. This dedicated user will be used to trigger the capability and receive index recommendations. Ensure the user has the necessary permissions and access to query the relevant tables. +- Enhanced query performance: By identifying and suggesting appropriate indexes for slow queries, you can significantly enhance query execution speed, resulting in quicker response times and a better user experience. +- Cost efficiency: Optimized query performance reduces the need for extra computing resources, enabling you to achieve more with existing infrastructure and potentially leading to operational cost savings. +- Simplified optimization process: Index Insight simplifies the process of identifying and implementing index improvements, eliminating the need for manual analysis and guesswork. You can get accurate recommendations using this feature, which saves time and effort. +- Improved application efficiency: By optimizing database performance, applications running on TiDB Cloud can handle larger workloads and serve more concurrent users, which enables businesses to scale operations effectively. -Index insight requires read access to database information_schema and mysql. You can create a new SQL user on your SQL client to activate this feature. Please replace your user name and password in the 'yourusername' and 'yourpassword' field. +## Usage -CREATE user 'yourusername'@'%' IDENTIFIED by 'yourpassword'; -GRANT SELECT ON information_schema.* TO 'yourusername'@'%'; -GRANT SELECT ON mysql.* TO 'yourusername'@'%'; -GRANT PROCESS, REFERENCES ON *.* TO 'yourusername'@'%'; -FLUSH PRIVILEGES; +This section introduces how to enable the Index Insight feature and obtain index recommendations for your slow queries. -### Activate the feature +### Before you begin -Enter the SQL user created specifically for Index Insight in the designated input field. Click on the "Activate" button to initiate the activation process. +Before enabling the Index Insight feature, make sure that you have created a TiDB Dedicated cluster. If you do not have one, follow the steps in [Create a cluster](/tidb-cloud/create-tidb-cluster.md) to create one. -Note: Ensure that the SQL user you enter has the necessary permissions and access to query the relevant tables. If you haven't created a dedicated SQL user for Index Insight yet, please refer to the user documentation for instructions on creating one. +### Step 1: Enable Index Insight -### Trigger insight manually +1. In the [TiDB Cloud console](https://tidbcloud.com), navigate to the cluster overview page of your TiDB Dedicated cluster, and then click **Diagnosis** in the left navigation pane. -To manually trigger the index recommendation capability and obtain index suggestions, you should locate the "Check Up" button and click on it. +2. Click the **Index Insight BETA** tab. The Index Insight overview page is displayed. -After you triggered this insight, the functionality will initiate a scan of slow queries from the past 3 hours. Once the scan is complete, index recommendations will be provided based on the analysis. +3. To use the Index Insight feature, you need to create a dedicated SQL user, which is used to trigger the feature and receive index recommendations. The following SQL statements create a new SQL user with required privileges, including read privilege for `information_schema` and `mysql`. Replace `'index_insight_user'` and `'your_password'` with your values. -### Check the insight detail + ```sql + CREATE user 'index_insight_user'@'%' IDENTIFIED by 'your_password'; + GRANT SELECT ON information_schema.* TO 'index_insight_user'@'%'; + GRANT SELECT ON mysql.* TO 'index_insight_user'@'%'; + GRANT PROCESS, REFERENCES ON *.* TO 'index_insight_user'@'%'; + FLUSH PRIVILEGES; + ``` -To view specific index commands and access detailed information about related slow queries, you need to click a insight on the list and enter the insight detail page. + > **Note:** + > + > To connect to your TiDB Dedicated cluster, see [Connect to a TiDB cluster](/tidb-cloud/connect-to-tidb-cluster.md). -On the insight detail page, you will find the index commands corresponding to the recommended indexes. +4. Enter the username and password of the SQL user created in the preceding step. Then, click **Activate** to initiate the activation process. -You can copy the index command(s) provided, open your TiDB instance or database management tool, and execute the copied index command(s) to create the recommended index(es) on the relevant table(s). +### Step 2: Manually trigger Index Insight -Please note that executing the index command(s) may require appropriate permissions and access. Ensure that you have the necessary privileges to create indexes on the desired table(s). +To obtain index recommendations for your slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the Index Insight overview page. -Additionally, on the Index Insight Detail Page, you can access detailed information about the slow queries associated with the index recommendations. This information may include the query text, execution plan, and other relevant metrics. Analyzing this information can help you better understand the performance issues and evaluate the impact of implementing the recommended indexes. +Then, the feature begins scanning your slow queries from the past three hours. After the scan finishes, it provides a list of index recommendations based on its analysis. -## Utilizing Index Recommendations +### Step 3: View index recommendations -Once the Index Insight feature has provided index recommendations, follow these guidelines to utilize them effectively: +To view the details of a specific index recommendation, click the insight from the list. The **Index Insight Detail** page is displayed. -### Review Index Recommendations +On this page, you can find the recommended indexes, related slow queries, execution plans, and relevant metrics. This information helps you better understand the performance issues and evaluate the potential impact of implementing the recommended indexes. -Review the index recommendations generated by the Index Insight. Each recommendation includes details such as the query, tables involved, and the suggested index. Evaluate the recommendations based on their potential impact on query performance. +### Step 4: Implement index recommendations -### Implementing Indexes +Before implementing the recommended indexes, you need to first review and evaluate the recommendations from the **Index Insight Detail** page. To implement the recommended indexes, follow these steps: -- Evaluate the impact of the proposed index on existing queries and workload. - -- Consider the storage requirements and potential trade-offs associated with the index implementation. - -- Use appropriate database management tools to create the recommended indexes on the relevant tables. - -- Monitor the performance after implementing the indexes to assess the improvements. +1. Evaluate the impact of the proposed index on existing queries and workload. +2. Consider the storage requirements and potential trade-offs associated with the index implementation. +3. Use appropriate database management tools to create the recommended indexes on the relevant tables. +4. Monitor the performance after implementing the indexes to assess the improvements. ## Best Practices diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index 5025c7d0a9b50..98ce3acbe71b1 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -75,22 +75,11 @@ For more information, see [Key Visualizer](https://docs.pingcap.com/tidb/stable/ ## Index Insight (Beta) -> **Note:** -> -> Index Insight is only available for [Dedicated Tier clusters](/tidb-cloud/select-cluster-tier.md#dedicated-tier). - -To obtain the index recommendations, perform the following steps: - -1. Navigate to the **Diagnosis** page of a cluster. -2. Click the **Index Insight (Beta)** tab. +The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering index recommendations for slow queries that are not utilizing indexes effectively. -![Index Insight](/media/tidb-cloud/Index-Insight.png) - -3. Create a new SQL user dedicated to utilizing the Index Insight feature. - -4. Configure the necessary permissions and access for the dedicated SQL user. - -5. Manually trigger the Index Insight capability to receive index recommendations for slow queries without proper index usage. +> **Note:** +> +> Index Insight is currently in beta and this feature is only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters. -For more information, see [Index Insight](/tidb-cloud/index-insight). +For more information, see [Index Insight](/tidb-cloud/index-insight.md). From e44c3bc8f611ecb4a8ce6f9e7c51eeac9eb9b4d3 Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 17:14:57 +0800 Subject: [PATCH 05/22] Update TOC-tidb-cloud.md --- TOC-tidb-cloud.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 8038a878f3265..7de47881187d4 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -160,6 +160,7 @@ - [Overview](/tidb-cloud/tidb-cloud-tune-performance-overview.md) - Analyze Performance - [Use the Diagnosis Tab](/tidb-cloud/tune-performance.md) + - [Use Index Insight](/tidb-cloud/index-insight.md) - [Use Statement Summary Tables](/statement-summary-tables.md) - SQL Tuning - [Overview](/tidb-cloud/tidb-cloud-sql-tuning-overview.md) From 9bc1ae15861713d61717af1f3b8fe978d9202c0c Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 17:26:24 +0800 Subject: [PATCH 06/22] Update TOC-tidb-cloud.md --- TOC-tidb-cloud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 7de47881187d4..aba48e0d67656 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -160,7 +160,7 @@ - [Overview](/tidb-cloud/tidb-cloud-tune-performance-overview.md) - Analyze Performance - [Use the Diagnosis Tab](/tidb-cloud/tune-performance.md) - - [Use Index Insight](/tidb-cloud/index-insight.md) + - [Use Index Insight (Beta)](/tidb-cloud/index-insight.md) - [Use Statement Summary Tables](/statement-summary-tables.md) - SQL Tuning - [Overview](/tidb-cloud/tidb-cloud-sql-tuning-overview.md) From 25fa5a122a24728fbcb3c3a2d47396883cdf7868 Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 17:27:39 +0800 Subject: [PATCH 07/22] Apply suggestions from code review Co-authored-by: Aolin --- tidb-cloud/index-insight.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index 37434589e6168..5022a67f3d845 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -73,22 +73,18 @@ To implement the recommended indexes, follow these steps: 3. Use appropriate database management tools to create the recommended indexes on the relevant tables. 4. Monitor the performance after implementing the indexes to assess the improvements. -## Best Practices +## Best practices -Consider the following best practices when using the Index Insight feature: +This section introduces some best practices for using the Index Insight feature. -### Regularly Trigger Index Insight +### Regularly trigger Index Insight -To keep your indexes optimized, it is recommended to trigger the Index Insight capability periodically or whenever there are significant changes to your queries or database schema. +To maintain optimized indexes, it is recommended to trigger the Index Insight feature periodically or whenever substantial changes occur in your queries or database schema. -### Analyze Impact Before Implementing Indexes +### Analyze impact before implementing indexes Before implementing the recommended indexes, analyze the potential impact on query execution plans, disk space, and any trade-offs involved. Prioritize implementing indexes that provide the most significant performance improvements. -### Monitor Performance +### Monitor performance -Continuously monitor query performance after implementing the recommended indexes to validate the improvements and make further adjustments if necessary. - -## Conclusion - -By leveraging the Index Insight feature in TiDB Cloud, you can optimize query performance and enhance overall application efficiency. Follow the steps outlined in this user guide to enable the feature, review index recommendations, and implement them effectively. Regularly utilizing the Index Insight feature will help you maintain optimal query performance in your TiDB Cloud environment. +Regularly monitor query performance after implementing the recommended indexes. This helps you confirm the improvements and make further adjustments if necessary. From 8e245d16389c6fa0e1c573ed8e1bf60af47c61f8 Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 17:42:49 +0800 Subject: [PATCH 08/22] Update tune-performance.md --- tidb-cloud/tune-performance.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index 98ce3acbe71b1..9686a61549b20 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -5,7 +5,7 @@ summary: Learn how to analyze and tune performance of your TiDB Cloud cluster. # Analyze and Tune Performance -TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-analysis), and [Key Visualizer](#key-visualizer) to analyze performance. +TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-analysis), [Key Visualizer](#key-visualizer), and [Index Insight (Beta)](#Index-Insight-(Beta)) to analyze performance. - Slow Query lets you search and view all slow queries in your TiDB cluster, and explore the bottlenecks of each slow query by viewing its execution plan, SQL execution information, and other details. @@ -13,6 +13,8 @@ TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-a - Key Visualizer helps you observe TiDB's data access patterns and data hotspots. +- Index Insight provides you with meaningful and actionable index recommendations. + > **Note:** > > Currently, **Key Visualizer** is unavailable for [Serverless Tier clusters](/tidb-cloud/select-cluster-tier.md#serverless-tier-beta). From 2e02384c4fe844f17a6222485bf51af5e5df7773 Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 17:55:28 +0800 Subject: [PATCH 09/22] Update tune-performance.md --- tidb-cloud/tune-performance.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index 9686a61549b20..9f1572ce754d5 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -5,7 +5,7 @@ summary: Learn how to analyze and tune performance of your TiDB Cloud cluster. # Analyze and Tune Performance -TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-analysis), [Key Visualizer](#key-visualizer), and [Index Insight (Beta)](#Index-Insight-(Beta)) to analyze performance. +TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-analysis), [Key Visualizer](#key-visualizer), and [Index Insight (Beta)](#index-insight-(beta)) to analyze performance. - Slow Query lets you search and view all slow queries in your TiDB cluster, and explore the bottlenecks of each slow query by viewing its execution plan, SQL execution information, and other details. @@ -77,7 +77,6 @@ For more information, see [Key Visualizer](https://docs.pingcap.com/tidb/stable/ ## Index Insight (Beta) - The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering index recommendations for slow queries that are not utilizing indexes effectively. > **Note:** From 0fa87c68c85f41433d7db17c34cd10915ecd7c97 Mon Sep 17 00:00:00 2001 From: Lux Date: Mon, 5 Jun 2023 17:59:49 +0800 Subject: [PATCH 10/22] Update tune-performance.md --- tidb-cloud/tune-performance.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index 9f1572ce754d5..9aef1799b6637 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -17,7 +17,7 @@ TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-a > **Note:** > -> Currently, **Key Visualizer** is unavailable for [Serverless Tier clusters](/tidb-cloud/select-cluster-tier.md#serverless-tier-beta). +> Currently, **Key Visualizer** and **Index Insight (Beta)** are unavailable for [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#serverless-tier-beta). ## Slow Query @@ -61,7 +61,7 @@ For more information, see [Statement Execution Details in TiDB Dashboard](https: > **Note:** > -> Key Visualizer is only available for [Dedicated Tier clusters](/tidb-cloud/select-cluster-tier.md#dedicated-tier). +> Key Visualizer is only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#dedicated-tier). To view the key analytics, perform the following steps: From 002f372954d799759d7e4f5713989509f4a29706 Mon Sep 17 00:00:00 2001 From: Aolin Date: Mon, 5 Jun 2023 19:14:39 +0800 Subject: [PATCH 11/22] Apply suggestions from code review Co-authored-by: xixirangrang --- tidb-cloud/index-insight.md | 22 +++++++++++----------- tidb-cloud/tune-performance.md | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index 5022a67f3d845..ff12dce8cb988 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -9,7 +9,7 @@ The Index Insight (beta) feature in TiDB Cloud provides powerful capabilities to > **Note:** > -> Index Insight is currently in beta and this feature is only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters. +> Index Insight is currently in beta and only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters. ## Introduction @@ -18,11 +18,11 @@ The Index Insight feature provides you with the following benefits: - Enhanced query performance: By identifying and suggesting appropriate indexes for slow queries, you can significantly enhance query execution speed, resulting in quicker response times and a better user experience. - Cost efficiency: Optimized query performance reduces the need for extra computing resources, enabling you to achieve more with existing infrastructure and potentially leading to operational cost savings. - Simplified optimization process: Index Insight simplifies the process of identifying and implementing index improvements, eliminating the need for manual analysis and guesswork. You can get accurate recommendations using this feature, which saves time and effort. -- Improved application efficiency: By optimizing database performance, applications running on TiDB Cloud can handle larger workloads and serve more concurrent users, which enables businesses to scale operations effectively. +- Improved application efficiency: By optimizing database performance, applications running on TiDB Cloud can handle larger workloads and serve more users concurrently, which enables businesses to scale operations effectively. ## Usage -This section introduces how to enable the Index Insight feature and obtain index recommendations for your slow queries. +This section introduces how to enable the Index Insight feature and obtain recommended indexes for your slow queries. ### Before you begin @@ -32,7 +32,7 @@ Before enabling the Index Insight feature, make sure that you have created a TiD 1. In the [TiDB Cloud console](https://tidbcloud.com), navigate to the cluster overview page of your TiDB Dedicated cluster, and then click **Diagnosis** in the left navigation pane. -2. Click the **Index Insight BETA** tab. The Index Insight overview page is displayed. +2. Click the **Index Insight BETA** tab. The **Index Insight overview** page is displayed. 3. To use the Index Insight feature, you need to create a dedicated SQL user, which is used to trigger the feature and receive index recommendations. The following SQL statements create a new SQL user with required privileges, including read privilege for `information_schema` and `mysql`. Replace `'index_insight_user'` and `'your_password'` with your values. @@ -52,7 +52,7 @@ Before enabling the Index Insight feature, make sure that you have created a TiD ### Step 2: Manually trigger Index Insight -To obtain index recommendations for your slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the Index Insight overview page. +To obtain index recommendations for your slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the **Index Insight overview** page. Then, the feature begins scanning your slow queries from the past three hours. After the scan finishes, it provides a list of index recommendations based on its analysis. @@ -60,17 +60,17 @@ Then, the feature begins scanning your slow queries from the past three hours. A To view the details of a specific index recommendation, click the insight from the list. The **Index Insight Detail** page is displayed. -On this page, you can find the recommended indexes, related slow queries, execution plans, and relevant metrics. This information helps you better understand the performance issues and evaluate the potential impact of implementing the recommended indexes. +On this page, you can find the index recommendations, related slow queries, execution plans, and relevant metrics. This information helps you better understand the performance issues and evaluate the potential impact of implementing the index recommendations. ### Step 4: Implement index recommendations -Before implementing the recommended indexes, you need to first review and evaluate the recommendations from the **Index Insight Detail** page. +Before implementing the index recommendations, you need to first review and evaluate the recommendations from the **Index Insight Detail** page. -To implement the recommended indexes, follow these steps: +To implement the index recommendations, follow these steps: 1. Evaluate the impact of the proposed index on existing queries and workload. 2. Consider the storage requirements and potential trade-offs associated with the index implementation. -3. Use appropriate database management tools to create the recommended indexes on the relevant tables. +3. Use appropriate database management tools to create the index recommendations on the relevant tables. 4. Monitor the performance after implementing the indexes to assess the improvements. ## Best practices @@ -83,8 +83,8 @@ To maintain optimized indexes, it is recommended to trigger the Index Insight fe ### Analyze impact before implementing indexes -Before implementing the recommended indexes, analyze the potential impact on query execution plans, disk space, and any trade-offs involved. Prioritize implementing indexes that provide the most significant performance improvements. +Before implementing the index recommendations, analyze the potential impact on query execution plans, disk space, and any trade-offs involved. Prioritize implementing indexes that provide the most significant performance improvements. ### Monitor performance -Regularly monitor query performance after implementing the recommended indexes. This helps you confirm the improvements and make further adjustments if necessary. +Regularly monitor query performance after implementing the index recommendations. This helps you confirm the improvements and make further adjustments if necessary. diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index 7a767e4097877..d9a860b751346 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -77,10 +77,10 @@ For more information, see [Key Visualizer](https://docs.pingcap.com/tidb/stable/ ## Index Insight (Beta) -The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering index recommendations for slow queries that are not utilizing indexes effectively. +The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering recommended indexes for slow queries that are not utilizing indexes effectively. > **Note:** > -> Index Insight is currently in beta and this feature is only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters. +> Index Insight is currently in beta and only available for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters. For more information, see [Index Insight](/tidb-cloud/index-insight.md). From e1f5449f5697dc19616b41058b6ac2ddd3124742 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 09:45:32 +0800 Subject: [PATCH 12/22] Update index-insight.md --- tidb-cloud/index-insight.md | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index ff12dce8cb988..bc5760332d980 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -44,6 +44,8 @@ Before enabling the Index Insight feature, make sure that you have created a TiD FLUSH PRIVILEGES; ``` +![Activate Feature]() + > **Note:** > > To connect to your TiDB Dedicated cluster, see [Connect to a TiDB cluster](/tidb-cloud/connect-to-tidb-cluster.md). @@ -54,14 +56,20 @@ Before enabling the Index Insight feature, make sure that you have created a TiD To obtain index recommendations for your slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the **Index Insight overview** page. +![Manually Trigger]() + Then, the feature begins scanning your slow queries from the past three hours. After the scan finishes, it provides a list of index recommendations based on its analysis. +![Results list]() + ### Step 3: View index recommendations To view the details of a specific index recommendation, click the insight from the list. The **Index Insight Detail** page is displayed. On this page, you can find the index recommendations, related slow queries, execution plans, and relevant metrics. This information helps you better understand the performance issues and evaluate the potential impact of implementing the index recommendations. +![Insight Details]() + ### Step 4: Implement index recommendations Before implementing the index recommendations, you need to first review and evaluate the recommendations from the **Index Insight Detail** page. @@ -88,3 +96,33 @@ Before implementing the index recommendations, analyze the potential impact on q ### Monitor performance Regularly monitor query performance after implementing the index recommendations. This helps you confirm the improvements and make further adjustments if necessary. + +## FAQ + +### How to delete user after deactivate index insight? + +Once index insight is deactivated, you can proceed to delete the SQL user. You can use the DROP USER statement. For example: `DROP USER 'username'@'host';`. Replace 'username' with the name of the user you want to delete and 'host' with the specific host associated with the user. If the user is associated with multiple hosts, you may need to execute the DROP USER statement for each host separately. + +### Why am I getting the 'invalid user or password' system message when I try to activate or perform a check-up? + +The "invalid user or password" system prompt typically indicates that the credentials you provided for authentication are incorrect or not recognized by the system. This issue can occur for various reasons, including: + +- Incorrect username or password: Double-check that you are entering the correct username and password combination. Ensure that there are no typos or case sensitivity issues. +- Expired or locked account: If your user account has an expiration date or is locked due to multiple failed login attempts, you may encounter authentication issues. Contact the system administrator or the appropriate support channel to verify the status of your account and address any lockouts or expired credentials. + +To troubleshoot and resolve the "invalid user or password" prompt, consider the following steps: + +- Verify your credentials: Double-check that you are using the correct username and password combination. Pay attention to any case sensitivity requirements. +- Confirm account status: Ensure that your user account is active and not expired or locked. Contact the system administrator or the relevant support channel to confirm your account status. +- create a new SQL user: + +If you have gone through the above steps and are still unable to resolve the issue, it's recommended to seek assistance from the support for further troubleshooting and guidance. + +### Why am I getting the 'no sufficient privileges' system message when I try to activate or perform a check-up? + + +### Why am I getting the 'internal error' + + + +### 操作过于频繁在 activate 和 deactivate From 4ba83eccb6237f1f38becf3bb453ff9855ee5582 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 11:09:52 +0800 Subject: [PATCH 13/22] Update index-insight.md --- tidb-cloud/index-insight.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index bc5760332d980..cbbf109dd0f0d 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -103,23 +103,26 @@ Regularly monitor query performance after implementing the index recommendations Once index insight is deactivated, you can proceed to delete the SQL user. You can use the DROP USER statement. For example: `DROP USER 'username'@'host';`. Replace 'username' with the name of the user you want to delete and 'host' with the specific host associated with the user. If the user is associated with multiple hosts, you may need to execute the DROP USER statement for each host separately. -### Why am I getting the 'invalid user or password' system message when I try to activate or perform a check-up? +### Why am I getting the 'invalid user or password' system message when I try to activate or perform a check-up on index insight? -The "invalid user or password" system prompt typically indicates that the credentials you provided for authentication are incorrect or not recognized by the system. This issue can occur for various reasons, including: - -- Incorrect username or password: Double-check that you are entering the correct username and password combination. Ensure that there are no typos or case sensitivity issues. -- Expired or locked account: If your user account has an expiration date or is locked due to multiple failed login attempts, you may encounter authentication issues. Contact the system administrator or the appropriate support channel to verify the status of your account and address any lockouts or expired credentials. +The "invalid user or password" system message typically indicates that the credentials you provided for authentication are incorrect or not recognized by the system. This issue can occur for various reasons, such as: incorrect username or password, expired or locked account. To troubleshoot and resolve the "invalid user or password" prompt, consider the following steps: - Verify your credentials: Double-check that you are using the correct username and password combination. Pay attention to any case sensitivity requirements. - Confirm account status: Ensure that your user account is active and not expired or locked. Contact the system administrator or the relevant support channel to confirm your account status. -- create a new SQL user: +- Create a new SQL user: If none of the above steps work, you can try creating a new SQL user. If you have gone through the above steps and are still unable to resolve the issue, it's recommended to seek assistance from the support for further troubleshooting and guidance. -### Why am I getting the 'no sufficient privileges' system message when I try to activate or perform a check-up? +### Why am I getting the 'no sufficient privileges' system message when I try to activate or perform a check-up on index insight? + +The "no sufficient privileges" system message typically indicates that the user account you are using does not have the necessary permissions or privileges to perform the requested action on Index Insight. To troubleshoot and resolve the "no sufficient privileges" issue, consider the following steps: +- Check your user privileges: Verify if your user account has been granted the necessary privileges for activating or performing check-ups on Index Insight. +- Create a new SQL user: If none of the above steps work, you can try creating a new SQL user. + +If you have gone through the above steps and are still unable to resolve the issue, it's recommended to seek assistance from the support for further troubleshooting and guidance. ### Why am I getting the 'internal error' From 5646e9d1b18b23c7ec7bd24701b041bd446fbf20 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 11:19:05 +0800 Subject: [PATCH 14/22] Update index-insight.md --- tidb-cloud/index-insight.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index cbbf109dd0f0d..fea6f7a34ea0d 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -124,8 +124,18 @@ The "no sufficient privileges" system message typically indicates that the user If you have gone through the above steps and are still unable to resolve the issue, it's recommended to seek assistance from the support for further troubleshooting and guidance. -### Why am I getting the 'internal error' +### Why am I getting the 'operations may be too frequent' during using index insight? +The "operations may be too frequent" message typically indicates that you have exceeded the rate limit or usage limits imposed by the Index Insight system. To troubleshoot and resolve the "operations may be too frequent" issue, consider the following steps: +- Slow down operations: If you receive this message, it's an indication that you need to reduce the frequency of your operations on Index Insight. +- Contact support: It's recommended to seek assistance from the support team. Provide them with the specific details of the error message, the actions you were performing when the error occurred, and any other relevant information. The support team will have access to system logs and can provide further troubleshooting and guidance tailored to your situation. + +### Why am I getting the 'internal error' during using index insight? + +The "internal error" message typically indicates that an unexpected error or issue has occurred within the Index Insight system. This error message is generic and doesn't provide specific details about the underlying cause. To troubleshoot and resolve the "internal error" issue, consider the following steps: + +- Retry the action: First, try refreshing the page or performing the action again. Sometimes, the error may be temporary and can be resolved by retrying. +- Contact support: It's recommended to seek assistance from the support team. Provide them with the specific details of the error message, the actions you were performing when the error occurred, and any other relevant information. The support team will have access to system logs and can provide further troubleshooting and guidance tailored to your situation. ### 操作过于频繁在 activate 和 deactivate From 1a57aebbce06c7afa4ad4180d56fa8b783dd21f9 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 11:21:13 +0800 Subject: [PATCH 15/22] Update index-insight.md --- tidb-cloud/index-insight.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index fea6f7a34ea0d..e8579ece532a6 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -137,5 +137,3 @@ The "internal error" message typically indicates that an unexpected error or iss - Retry the action: First, try refreshing the page or performing the action again. Sometimes, the error may be temporary and can be resolved by retrying. - Contact support: It's recommended to seek assistance from the support team. Provide them with the specific details of the error message, the actions you were performing when the error occurred, and any other relevant information. The support team will have access to system logs and can provide further troubleshooting and guidance tailored to your situation. - -### 操作过于频繁在 activate 和 deactivate From c93bb4639bf94926a48a0498e03dae587d9e1550 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 11:23:28 +0800 Subject: [PATCH 16/22] Update index-insight.md --- tidb-cloud/index-insight.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index e8579ece532a6..b7f7d1ce6d8bd 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -44,8 +44,6 @@ Before enabling the Index Insight feature, make sure that you have created a TiD FLUSH PRIVILEGES; ``` -![Activate Feature]() - > **Note:** > > To connect to your TiDB Dedicated cluster, see [Connect to a TiDB cluster](/tidb-cloud/connect-to-tidb-cluster.md). @@ -56,20 +54,14 @@ Before enabling the Index Insight feature, make sure that you have created a TiD To obtain index recommendations for your slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the **Index Insight overview** page. -![Manually Trigger]() - Then, the feature begins scanning your slow queries from the past three hours. After the scan finishes, it provides a list of index recommendations based on its analysis. -![Results list]() - ### Step 3: View index recommendations To view the details of a specific index recommendation, click the insight from the list. The **Index Insight Detail** page is displayed. On this page, you can find the index recommendations, related slow queries, execution plans, and relevant metrics. This information helps you better understand the performance issues and evaluate the potential impact of implementing the index recommendations. -![Insight Details]() - ### Step 4: Implement index recommendations Before implementing the index recommendations, you need to first review and evaluate the recommendations from the **Index Insight Detail** page. From 84295e8473efb8dcaa8fb80b48f36e74971fdcf0 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 11:40:43 +0800 Subject: [PATCH 17/22] Update index-insight.md --- tidb-cloud/index-insight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index b7f7d1ce6d8bd..fb8015a4ab8c0 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -79,7 +79,7 @@ This section introduces some best practices for using the Index Insight feature. ### Regularly trigger Index Insight -To maintain optimized indexes, it is recommended to trigger the Index Insight feature periodically or whenever substantial changes occur in your queries or database schema. +To maintain optimized indexes, it is recommended to trigger the Index Insight feature periodically, such as every day, or whenever substantial changes occur in your queries or database schema. ### Analyze impact before implementing indexes From a52a589d44fdf146bef9418386d310f09873e450 Mon Sep 17 00:00:00 2001 From: Lux Date: Tue, 6 Jun 2023 12:17:07 +0800 Subject: [PATCH 18/22] Update index-insight.md --- tidb-cloud/index-insight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index fb8015a4ab8c0..8d58b6b7b51a1 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -93,7 +93,7 @@ Regularly monitor query performance after implementing the index recommendations ### How to delete user after deactivate index insight? -Once index insight is deactivated, you can proceed to delete the SQL user. You can use the DROP USER statement. For example: `DROP USER 'username'@'host';`. Replace 'username' with the name of the user you want to delete and 'host' with the specific host associated with the user. If the user is associated with multiple hosts, you may need to execute the DROP USER statement for each host separately. +Once index insight is deactivated, you can proceed to delete the SQL user. You can use the DROP USER statement. For example: `DROP USER 'username';`. Replace 'username' with the name of the user you want to delete. ### Why am I getting the 'invalid user or password' system message when I try to activate or perform a check-up on index insight? From 0db2e94eefdcf5caed519e3e75f9c08c745b90e7 Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 6 Jun 2023 14:35:39 +0800 Subject: [PATCH 19/22] refine wording and add release notes Signed-off-by: Aolin --- tidb-cloud/index-insight.md | 107 +++++++++++++++++-------- tidb-cloud/tidb-cloud-release-notes.md | 15 ++++ tidb-cloud/tune-performance.md | 6 +- 3 files changed, 91 insertions(+), 37 deletions(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index 8d58b6b7b51a1..684387d7380f3 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -1,6 +1,6 @@ --- title: Index Insight (Beta) -summary: Learn how to use the Index Insight feature in TiDB Cloud and obtain index recommendations for your slow queries. +summary: Learn how to use the Index Insight feature in TiDB Cloud and obtain index recommendations for slow queries. --- # Index Insight (Beta) @@ -15,14 +15,14 @@ The Index Insight (beta) feature in TiDB Cloud provides powerful capabilities to The Index Insight feature provides you with the following benefits: -- Enhanced query performance: By identifying and suggesting appropriate indexes for slow queries, you can significantly enhance query execution speed, resulting in quicker response times and a better user experience. -- Cost efficiency: Optimized query performance reduces the need for extra computing resources, enabling you to achieve more with existing infrastructure and potentially leading to operational cost savings. -- Simplified optimization process: Index Insight simplifies the process of identifying and implementing index improvements, eliminating the need for manual analysis and guesswork. You can get accurate recommendations using this feature, which saves time and effort. -- Improved application efficiency: By optimizing database performance, applications running on TiDB Cloud can handle larger workloads and serve more users concurrently, which enables businesses to scale operations effectively. +- Enhanced query performance: Index Insight identifies slow queries and suggests appropriate indexes for them, thereby speeding up query execution, reducing response time, and improving user experience. +- Cost efficiency: By using Index Insight to optimize query performance, the need for extra computing resources is reduced, enabling you to use existing infrastructure more effectively. This can potentially lead to operational cost savings. +- Simplified optimization process: Index Insight simplifies the identification and implementation of index improvements, eliminating the need for manual analysis and guesswork. As a result, you can save time and effort with accurate index recommendations. +- Improved application efficiency: By using Index Insight to optimize database performance, applications running on TiDB Cloud can handle larger workloads and serve more users concurrently, which makes scaling operations of applications more efficient. ## Usage -This section introduces how to enable the Index Insight feature and obtain recommended indexes for your slow queries. +This section introduces how to enable the Index Insight feature and obtain recommended indexes for slow queries. ### Before you begin @@ -34,10 +34,10 @@ Before enabling the Index Insight feature, make sure that you have created a TiD 2. Click the **Index Insight BETA** tab. The **Index Insight overview** page is displayed. -3. To use the Index Insight feature, you need to create a dedicated SQL user, which is used to trigger the feature and receive index recommendations. The following SQL statements create a new SQL user with required privileges, including read privilege for `information_schema` and `mysql`. Replace `'index_insight_user'` and `'your_password'` with your values. +3. To use the Index Insight feature, you need to create a dedicated SQL user, which is used to trigger the feature and receive index recommendations. The following SQL statements create a new SQL user with required privileges, including read privilege for `information_schema` and `mysql`, and `PROCESS` and `REFERENCES` privileges for all databases. Replace `'index_insight_user'` and `'random_password'` with your values. ```sql - CREATE user 'index_insight_user'@'%' IDENTIFIED by 'your_password'; + CREATE user 'index_insight_user'@'%' IDENTIFIED by 'random_password'; GRANT SELECT ON information_schema.* TO 'index_insight_user'@'%'; GRANT SELECT ON mysql.* TO 'index_insight_user'@'%'; GRANT PROCESS, REFERENCES ON *.* TO 'index_insight_user'@'%'; @@ -52,19 +52,19 @@ Before enabling the Index Insight feature, make sure that you have created a TiD ### Step 2: Manually trigger Index Insight -To obtain index recommendations for your slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the **Index Insight overview** page. +To obtain index recommendations for slow queries, you can manually trigger the Index Insight feature by clicking **Check Up** in the upper-right corner of the **Index Insight overview** page. -Then, the feature begins scanning your slow queries from the past three hours. After the scan finishes, it provides a list of index recommendations based on its analysis. +Then, the feature begins scanning slow queries from the past three hours. After the scan finishes, it provides a list of index recommendations based on its analysis. ### Step 3: View index recommendations -To view the details of a specific index recommendation, click the insight from the list. The **Index Insight Detail** page is displayed. +To view the details of a specific index recommendation, click the insight from the list. The **Index Insight Details** page is displayed. On this page, you can find the index recommendations, related slow queries, execution plans, and relevant metrics. This information helps you better understand the performance issues and evaluate the potential impact of implementing the index recommendations. ### Step 4: Implement index recommendations -Before implementing the index recommendations, you need to first review and evaluate the recommendations from the **Index Insight Detail** page. +Before implementing the index recommendations, you need to first review and evaluate the recommendations from the **Index Insight Details** page. To implement the index recommendations, follow these steps: @@ -91,41 +91,80 @@ Regularly monitor query performance after implementing the index recommendations ## FAQ -### How to delete user after deactivate index insight? +This section lists some frequently asked questions about the Index Insight feature. -Once index insight is deactivated, you can proceed to delete the SQL user. You can use the DROP USER statement. For example: `DROP USER 'username';`. Replace 'username' with the name of the user you want to delete. +### How to deactivate Index Insight? -### Why am I getting the 'invalid user or password' system message when I try to activate or perform a check-up on index insight? +To deactivate the Index Insight feature, perform the following steps: -The "invalid user or password" system message typically indicates that the credentials you provided for authentication are incorrect or not recognized by the system. This issue can occur for various reasons, such as: incorrect username or password, expired or locked account. +1. In the upper-right corner of the **Index Insight overview** page, click **Settings**. The Index Insight settings page is displayed. +2. Click **Deactivate**. A confirmation dialog box is displayed. +3. Click **OK** to confirm the deactivation. -To troubleshoot and resolve the "invalid user or password" prompt, consider the following steps: + After you deactivate the Index Insight feature, all index recommendations are removed from the **Index Insight overview** page. However, the SQL user created for the feature is not deleted. You can delete the SQL user manually. -- Verify your credentials: Double-check that you are using the correct username and password combination. Pay attention to any case sensitivity requirements. -- Confirm account status: Ensure that your user account is active and not expired or locked. Contact the system administrator or the relevant support channel to confirm your account status. -- Create a new SQL user: If none of the above steps work, you can try creating a new SQL user. +### How to delete the SQL user after deactivating Index Insight? -If you have gone through the above steps and are still unable to resolve the issue, it's recommended to seek assistance from the support for further troubleshooting and guidance. +After you deactivate the Index Insight feature, you can execute the `DROP USER` statement to delete the SQL user created for the feature. The following is an example. Replace `'username'` with your value. -### Why am I getting the 'no sufficient privileges' system message when I try to activate or perform a check-up on index insight? +```sql +DROP USER 'username'; +``` -The "no sufficient privileges" system message typically indicates that the user account you are using does not have the necessary permissions or privileges to perform the requested action on Index Insight. To troubleshoot and resolve the "no sufficient privileges" issue, consider the following steps: +### Why does the `invalid user or password` message show up during activation or check-up? -- Check your user privileges: Verify if your user account has been granted the necessary privileges for activating or performing check-ups on Index Insight. -- Create a new SQL user: If none of the above steps work, you can try creating a new SQL user. +The `invalid user or password` message typically prompts when the system cannot authenticate the credentials you provided. This issue might occur due to various reasons, such as incorrect username or password, or an expired or locked user account. -If you have gone through the above steps and are still unable to resolve the issue, it's recommended to seek assistance from the support for further troubleshooting and guidance. +To resolve this issue, perform the following steps: -### Why am I getting the 'operations may be too frequent' during using index insight? +1. Verify your credentials: Make sure that the username and password you provided are correct. Pay attention to case sensitivity. +2. Check account status: Make sure that your user account is in active status and not expired or locked. You can confirm this by contacting the system administrator or the relevant support channel. +3. Create a new SQL user: If this issue is not resolved by the preceding steps, you can create a new SQL user using the following statements. Replace `'index_insight_user'` and `'random_password'` with your values. -The "operations may be too frequent" message typically indicates that you have exceeded the rate limit or usage limits imposed by the Index Insight system. To troubleshoot and resolve the "operations may be too frequent" issue, consider the following steps: + ```sql + CREATE user 'index_insight_user'@'%' IDENTIFIED by 'random_password'; + GRANT SELECT ON information_schema.* TO 'index_insight_user'@'%'; + GRANT SELECT ON mysql.* TO 'index_insight_user'@'%'; + GRANT PROCESS, REFERENCES ON *.* TO 'index_insight_user'@'%'; + FLUSH PRIVILEGES; + ``` + +If you are still facing the issue after following the preceding steps, it is recommended to contact [PingCAP support team](/tidb-cloud/tidb-cloud-support.md). + +### Why does the `no sufficient privileges` message show up during activation or check-up? + +The `no sufficient privileges` message typically prompts when the SQL user you provided lacks the required privileges to request index recommendations from Index Insight. + +To resolve this issue, perform the following steps: + +1. Check the user privileges: Confirm if your user account has been granted the required privileges, including read privilege for `information_schema` and `mysql`, and `PROCESS` and `REFERENCES` privileges for all databases. + +2. Create a new SQL user: If this issue is not resolved by the preceding steps, you can create a new SQL user using the following statements. Replace `'index_insight_user'` and `'random_password'` with your values. + + ```sql + CREATE user 'index_insight_user'@'%' IDENTIFIED by 'random_password'; + GRANT SELECT ON information_schema.* TO 'index_insight_user'@'%'; + GRANT SELECT ON mysql.* TO 'index_insight_user'@'%'; + GRANT PROCESS, REFERENCES ON *.* TO 'index_insight_user'@'%'; + FLUSH PRIVILEGES; + ``` + +If you are still facing the issue after following the preceding steps, it is recommended to contact [PingCAP support team](/tidb-cloud/tidb-cloud-support.md). + +### Why does the `operations may be too frequent` message show up during using Index Insight? + +The `operations may be too frequent` message typically prompts when you have exceeded the rate or usage limit set by Index Insight. + +To resolve this issue, perform the following steps: + +1. Slow down operations: If you receive this message, you need to decrease your operation frequency on Index Insight. +2. Contact support: If the issue persists, contact [PingCAP support team](/tidb-cloud/tidb-cloud-support.md) and provide details of the error message, your actions, and any other relevant information. -- Slow down operations: If you receive this message, it's an indication that you need to reduce the frequency of your operations on Index Insight. -- Contact support: It's recommended to seek assistance from the support team. Provide them with the specific details of the error message, the actions you were performing when the error occurred, and any other relevant information. The support team will have access to system logs and can provide further troubleshooting and guidance tailored to your situation. +### Why does the `internal error` message show up during using Index Insight? -### Why am I getting the 'internal error' during using index insight? +The `internal error` message typically prompts when the system encounters an unexpected error or issue. This error message is general and does not provide details about the underlying cause. -The "internal error" message typically indicates that an unexpected error or issue has occurred within the Index Insight system. This error message is generic and doesn't provide specific details about the underlying cause. To troubleshoot and resolve the "internal error" issue, consider the following steps: +To resolve this issue, perform the following steps: -- Retry the action: First, try refreshing the page or performing the action again. Sometimes, the error may be temporary and can be resolved by retrying. -- Contact support: It's recommended to seek assistance from the support team. Provide them with the specific details of the error message, the actions you were performing when the error occurred, and any other relevant information. The support team will have access to system logs and can provide further troubleshooting and guidance tailored to your situation. +1. Retry the operation: Refresh the page or try the operation again. The error might be temporary and can be resolved by a simple retry. +2. Contact support: If the issue persists, contact [PingCAP support team](/tidb-cloud/tidb-cloud-support.md) and provide details of the error message, your actions, and any other relevant information. diff --git a/tidb-cloud/tidb-cloud-release-notes.md b/tidb-cloud/tidb-cloud-release-notes.md index db6af0171cf51..931417f59558c 100644 --- a/tidb-cloud/tidb-cloud-release-notes.md +++ b/tidb-cloud/tidb-cloud-release-notes.md @@ -8,6 +8,21 @@ aliases: ['/tidbcloud/supported-tidb-versions','/tidbcloud/release-notes'] This page lists the release notes of [TiDB Cloud](https://www.pingcap.com/tidb-cloud/) in 2023. +## June 6, 2023 + +- Introduce [Index Insight (beta)](/tidb-cloud/index-insight.md) for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters, which optimizes query performance by providing index recommendations for slow queries. + + With Index Insight, you can improve the overall application performance and the efficiency of your database operations in the following ways: + + - Enhanced query performance: Index Insight identifies slow queries and suggests appropriate indexes for them, thereby speeding up query execution, reducing response time, and improving user experience. + - Cost efficiency: By using Index Insight to optimize query performance, the need for extra computing resources is reduced, enabling you to use existing infrastructure more effectively. This can potentially lead to operational cost savings. + - Simplified optimization process: Index Insight simplifies the identification and implementation of index improvements, eliminating the need for manual analysis and guesswork. As a result, you can save time and effort with accurate index recommendations. + - Improved application efficiency: By using Index Insight to optimize database performance, applications running on TiDB Cloud can handle larger workloads and serve more users concurrently, which makes scaling operations of applications more efficient. + + To use Index Insight, navigate to the **Diagnosis** page of your TiDB Dedicated cluster and click the **Index Insight BETA** tab. + + For more information, see [Use Index Insight (beta)](/tidb-cloud/index-insight.md). + ## June 5, 2023 - Support connecting your [Data App](/tidb-cloud/tidb-cloud-glossary.md#data-app) to GitHub. diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md index d9a860b751346..b60fdb17c2788 100644 --- a/tidb-cloud/tune-performance.md +++ b/tidb-cloud/tune-performance.md @@ -5,7 +5,7 @@ summary: Learn how to analyze and tune performance of your TiDB Cloud cluster. # Analyze and Tune Performance -TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-analysis), [Key Visualizer](#key-visualizer), and [Index Insight (Beta)](#index-insight-(beta)) to analyze performance. +TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-analysis), [Key Visualizer](#key-visualizer), and [Index Insight (beta)](#index-insight-beta) to analyze performance. - Slow Query lets you search and view all slow queries in your TiDB cluster, and explore the bottlenecks of each slow query by viewing its execution plan, SQL execution information, and other details. @@ -17,7 +17,7 @@ TiDB Cloud provides [Slow Query](#slow-query), [Statement Analysis](#statement-a > **Note:** > -> Currently, **Key Visualizer** and **Index Insight (Beta)** are unavailable for [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#serverless-tier-beta) clusters. +> Currently, **Key Visualizer** and **Index Insight (beta)** are unavailable for [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless-beta) clusters. ## Slow Query @@ -75,7 +75,7 @@ On the **Key Visualizer** page, a large heat map shows changes on access traffic For more information, see [Key Visualizer](https://docs.pingcap.com/tidb/stable/dashboard-key-visualizer). -## Index Insight (Beta) +## Index Insight (beta) The Index Insight feature in TiDB Cloud provides powerful capabilities to optimize query performance by offering recommended indexes for slow queries that are not utilizing indexes effectively. From daaeb328bc55de8851f7230186e744ac6856e664 Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 6 Jun 2023 15:33:28 +0800 Subject: [PATCH 20/22] cloud release notes: add TiDB Playground Signed-off-by: Aolin --- tidb-cloud/tidb-cloud-release-notes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tidb-cloud/tidb-cloud-release-notes.md b/tidb-cloud/tidb-cloud-release-notes.md index 931417f59558c..d8e79661336e6 100644 --- a/tidb-cloud/tidb-cloud-release-notes.md +++ b/tidb-cloud/tidb-cloud-release-notes.md @@ -23,6 +23,12 @@ This page lists the release notes of [TiDB Cloud](https://www.pingcap.com/tidb-c For more information, see [Use Index Insight (beta)](/tidb-cloud/index-insight.md). +- Introduce [TiDB Playground](https://play.tidbcloud.com/?utm_source=docs&utm_medium=tidb_cloud_release_notes), an interactive platform for experiencing the full capabilities of TiDB, without registration or installation. + + TiDB Playground is an interactive platform designed to provide a one-stop-shop experience for exploring the capabilities of TiDB, such as scalability, MySQL compatibility, and real-time analytics. With TiDB Playground, you can try out TiDB features in a controlled environment free from complex configurations and experiment with features in real-time, making it ideal to understand the features in TiDB. + + To get started with TiDB Playground, go to the [**TiDB Playground**](https://play.tidbcloud.com/?utm_source=docs&utm_medium=tidb_cloud_release_notes) page, select a feature you want to explore, and begin your exploration. + ## June 5, 2023 - Support connecting your [Data App](/tidb-cloud/tidb-cloud-glossary.md#data-app) to GitHub. From 6e57f66c987b51e044ecc79b64dfe690c6986c99 Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 6 Jun 2023 15:51:06 +0800 Subject: [PATCH 21/22] Apply suggestions from code review Co-authored-by: xixirangrang --- tidb-cloud/index-insight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-cloud/index-insight.md b/tidb-cloud/index-insight.md index 684387d7380f3..29197e86100e9 100644 --- a/tidb-cloud/index-insight.md +++ b/tidb-cloud/index-insight.md @@ -97,7 +97,7 @@ This section lists some frequently asked questions about the Index Insight featu To deactivate the Index Insight feature, perform the following steps: -1. In the upper-right corner of the **Index Insight overview** page, click **Settings**. The Index Insight settings page is displayed. +1. In the upper-right corner of the **Index Insight overview** page, click **Settings**. The **Index Insight settings** page is displayed. 2. Click **Deactivate**. A confirmation dialog box is displayed. 3. Click **OK** to confirm the deactivation. From 6a8bb34b9807bb319e6dd12412d66c24c332cfa0 Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 6 Jun 2023 16:12:07 +0800 Subject: [PATCH 22/22] Apply suggestions from code review Co-authored-by: Grace Cai --- tidb-cloud/tidb-cloud-release-notes.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tidb-cloud/tidb-cloud-release-notes.md b/tidb-cloud/tidb-cloud-release-notes.md index d8e79661336e6..742ee60610a51 100644 --- a/tidb-cloud/tidb-cloud-release-notes.md +++ b/tidb-cloud/tidb-cloud-release-notes.md @@ -12,7 +12,7 @@ This page lists the release notes of [TiDB Cloud](https://www.pingcap.com/tidb-c - Introduce [Index Insight (beta)](/tidb-cloud/index-insight.md) for [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) clusters, which optimizes query performance by providing index recommendations for slow queries. - With Index Insight, you can improve the overall application performance and the efficiency of your database operations in the following ways: + With Index Insight, you can improve the overall application performance and efficiency of your database operations in the following ways: - Enhanced query performance: Index Insight identifies slow queries and suggests appropriate indexes for them, thereby speeding up query execution, reducing response time, and improving user experience. - Cost efficiency: By using Index Insight to optimize query performance, the need for extra computing resources is reduced, enabling you to use existing infrastructure more effectively. This can potentially lead to operational cost savings. @@ -25,7 +25,9 @@ This page lists the release notes of [TiDB Cloud](https://www.pingcap.com/tidb-c - Introduce [TiDB Playground](https://play.tidbcloud.com/?utm_source=docs&utm_medium=tidb_cloud_release_notes), an interactive platform for experiencing the full capabilities of TiDB, without registration or installation. - TiDB Playground is an interactive platform designed to provide a one-stop-shop experience for exploring the capabilities of TiDB, such as scalability, MySQL compatibility, and real-time analytics. With TiDB Playground, you can try out TiDB features in a controlled environment free from complex configurations and experiment with features in real-time, making it ideal to understand the features in TiDB. + TiDB Playground is an interactive platform designed to provide a one-stop-shop experience for exploring the capabilities of TiDB, such as scalability, MySQL compatibility, and real-time analytics. + + With TiDB Playground, you can try out TiDB features in a controlled environment free from complex configurations in real-time, making it ideal to understand the features in TiDB. To get started with TiDB Playground, go to the [**TiDB Playground**](https://play.tidbcloud.com/?utm_source=docs&utm_medium=tidb_cloud_release_notes) page, select a feature you want to explore, and begin your exploration.