[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Troubleshoot high database load with AI assistance\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/troubleshoot-high-database-load \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/troubleshoot-high-database-load \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document describes how you can use AI assistance in Cloud SQL\nto troubleshoot high database load in Cloud SQL.\nYou can use the AI assistance capabilities\nof Cloud SQL\nand Gemini Cloud Assist to investigate, analyze, obtain recommendations,\nand finally implement those recommendations to optimize your queries in\nCloud SQL.\n\nBy accessing the **Query insights** dashboard in the Google Cloud console, you can\nanalyze your database and troubleshoot events when your system experiences a\nhigher database load than average. Cloud SQL uses\nthe 24 hours of data that occurs prior to your selected time range to calculate\nthe expected load of your database. You can look into the reasons for the higher\nload events and analyze the evidence behind reduced performance.\nFinally, Cloud SQL provides recommendations for optimizing your\ndatabase to improve performance.\n\nBefore you begin\n----------------\n\nTo troubleshoot high database load with AI assistance, do the following:\n\n1. [Review limitations with AI-assisted troubleshooting](/sql/docs/sqlserver/observe-troubleshoot-with-ai#limitations).\n2. [Enable AI-assisted troubleshooting](/sql/docs/sqlserver/observe-troubleshoot-with-ai#enable-ai-assisted-ts).\n\n### Required roles and permissions\n\nFor the roles and permissions required to troubleshoot high database load with AI assistance,\nsee\n\n[Observe and troubleshoot with AI](/sql/docs/sqlserver/observe-troubleshoot-with-ai#required-roles-permissions).\n\n\nUse AI assistance\n-----------------\n\nTo use AI assistance with troubleshooting high database load,\ngo to the **Instance Overview** page or the **Query insights** dashboard in\nthe Google Cloud console.\n\n### Instance overview page\n\nTroubleshoot high database load with AI assistance\nin the **Instance overview** page by using the following steps:\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. To open the **Overview** page of an instance, click the instance name.\n3. In the **Overview** page, from the **Chart** menu, select a metric for the database. You can select any metric.\n4. Optional: To select a specific analysis time period, use the **Time range** filter to select either 1 hour, 6 hours, 1 day, 7 days, 30 days or a custom range .\n5. You can zoom in to specific sections of the chart where you notice areas of high load that you want to analyze. For example, an area of high load might display CPU utilization levels closer to 100%. To zoom in, click and select a portion of the chart.\n6. Click **Analyze instance performance** to start troubleshooting high database load with AI assistance. This generates the [**Analyzing database load**](#analyze-high-database-load) page.\n\n### Query insights dashboard\n\nTroubleshoot high database load with AI assistance\nin the **Query insights** dashboard using the following steps:\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. To open the **Overview** page of an instance, click the instance name.\n3. Click **Query insights** to open the **Query insights** dashboard.\n4. Optional: Use the **Time range** filter to select either 1 hour, 6 hours, 1 day, 7 days, 30 days or a custom range.\n5. You can zoom in to specific sections of the chart where you notice areas of higher database load by query execution time. To zoom in, click and select a portion of the chart.\n6. In the **Database load chart** , click **Analyze instance performance** to start troubleshooting high database load with AI assistance. This generates the [**Analyzing database load**](#analyze-high-database-load) page.\n\nAnalyze high database load\n--------------------------\n\nUsing AI assistance, you can analyze and troubleshoot the details of your\ndatabase load.\n\nIn the **Analyzing database load** page, you can view following details for\nyour Cloud SQL instance:\n\n- **Analysis time period**\n- **CPU utilization (p99)**\n- **Memory utilization (p99)**\n\nCloud SQL displays a **Data Transfer In/Out bytes** chart\nwhere you can look at data transfer activity for the selected time\nperiod. You can check for sudden spikes in data transfer activity for a\nparticular time period.\n\n### Analysis time period\n\nCloud SQL analyzes your database for the time period that\nyou select in your database load chart from the **Query insights** dashboard\nor the **Instance overview** page. If you select a time period of less\nthan 24 hours, then Cloud SQL analyzes the entire time period.\nIf you select a time period greater than 24 hours, then\nCloud SQL selects only the last 24 hours of the time period\nfor analysis.\n\nTo calculate the baseline performance analysis of your database, Cloud SQL\nincludes 24 hours of a baseline time period in its analysis time period.\nIf your selected time period occurs on a\nday other than Monday, then Cloud SQL\nuses a baseline time period of the *24 hours previous* to your selected time period.\nIf your selected time period occurs on a Monday, then Cloud SQL\nuses a baseline time period of the *7th day previous* to your selected time period.\n\n### Situation\n\nWhen Cloud SQL starts the analysis, Cloud SQL\nchecks for significant changes in the following key metrics:\n\n- Queries per second (QPS)\n- CPU\n- Memory\n- Disk I/O\n\nCloud SQL compares the baseline aggregated data for your database\nwithin the performance data of your analysis time window. If\nCloud SQL detects a significant change in threshold for a key\nmetric, then Cloud SQL indicates a possible situation\nwith your database. The identified situation might explain a root cause\nfor the high load on your database over the selected time period.\n\nFor example, you might see multiple situations identified for why your\ndatabase is experiencing high load such as:\n\n- **Change in database load**\n- **Hardware resource contention**\n- **TempDB contention**\n\n### Evidence\n\nFor each situation, Cloud SQL provides a list of evidence\nto support the finding. Cloud SQL bases evidence on\nmetrics gathered from the instance.\n\nEach situation has supporting evidence that's used to detect anomalies in\nsystem performance. Cloud SQL detects an anomaly when system\nperformance surpasses certain thresholds or meets specific time-bound criteria.\nCloud SQL defines these thresholds or criteria for each situation.\n\nTo support the situation of **Hardware resource contention**, you might see\nthe following evidence:\n\n- **CPU utilization**: Consistently high CPU utilization detected.\n- **Server level waits**: High CPU server waits exists.\n\nTo view the evidence retrieved during analysis, click each situation.\nThe evidence appears in the pane next to its corresponding situation.\n\n### Recommendations\n\nBased on all of the situations analyzed, Cloud SQL provides you with\none or more actionable recommendations to help remediate the problems of your high\ndatabase load. Cloud SQL presents the recommendations with a\ncost-benefit analysis so you can make an informed decision on whether to implement\nthe recommendation.\n\nFor some situations, based on the analysis, there might not a recommendation.\n\nFor example, you might receive the following recommendations:\n\n- **Query and workload tuning**: Tune your workload and query, and adjust maximum worker threads based on best practices.\n- **Database maintenance**: Ensure that statistics are being updated regularly as part of any database maintenance. Along with this, regularly tune top queries by CPU or add more CPU if needed.\n\nFor some recommendations, you can click the **Learn more** link to read\nsupporting documentation for the recommendation.\n\nIf you want to continue troubleshooting or get more assistance with system performance,\nthen you can also open [Gemini Cloud Assist](/gemini/docs/cloud-assist/overview).\n\n\nWhat's next\n-----------\n\n- [Monitor active queries](/sql/docs/sqlserver/monitor-active-queries)\n- [Optimize high CPU usage](/sql/docs/sqlserver/optimize-cpu-usage)\n- [Optimize high memory usage](/sql/docs/sqlserver/optimize-high-memory-usage)\n- [Use system insights to improve system performance](/sql/docs/sqlserver/use-system-insights)"]]