Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
MySQL | PostgreSQL | SQL Server
Auf dieser Seite wird beschrieben, wie Sie Empfehlungen des Recommenders für die Migration von Cloud SQL zu AlloyDB for PostgreSQL aufrufen und umsetzen. Mit diesem Recommender können Sie Instanzen mit den folgenden Merkmalen erkennen:
Die Instanz ist kritisch.
Die Cache-Trefferrate ist niedrig, was sich auf die Leistung auswirken kann.
Dieser Recommender analysiert täglich proaktiv Instanzmetadaten und Messwerte zur Cache-Trefferquote und bietet Statistiken und Empfehlungen zur Verbesserung der Instanzleistung. Sie können diese Statistiken und Empfehlungen in der Google Cloud Console, mit der gcloud CLI oder mit der Recommender API aufrufen.
Wenn Ihre Instanz eine Produktionsinstanz ist und ihre Cache-Trefferquote niedrig ist, empfehlen wir, zu AlloyDB for PostgreSQL zu migrieren, um die Leistung zu verbessern.
Empfehlungen werden täglich generiert.
Preise
Die auf dieser Seite beschriebenen Recommender befinden sich alle in der standardmäßigen Recommender-Preisstufe.
Hinweise
Bevor Sie Empfehlungen und Informationen aufrufen können, müssen Sie Folgendes tun:
Prüfen Sie, ob Sie die erforderlichen Rollen haben, um die Berechtigungen zum Aufrufen und Verwenden von Informationen und Empfehlungen zu erhalten.
Aufgaben
Rollen
Empfehlungen aufrufen
Eine der folgenden Rollen: recommender.cloudsqlViewer oder cloudsql.viewer.
Empfehlungen übernehmen
Eine der folgenden Rollen: recommender.cloudsqlAdmin, cloudsql.editor oder cloudsql.admin.
Leistungsempfehlungen für die Migration zu AlloyDB for PostgreSQL auflisten
Sie können Empfehlungen zur Migration zu AlloyDB for PostgreSQL zur Verbesserung der Leistung mit der Google Cloud Console, gcloud CLI oder der Recommender API auflisten.
Console
So listen Sie Empfehlungen für das Upgrade auf AlloyDB for PostgreSQL auf:
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations
Ersetzen Sie Folgendes:
PROJECT_ID: Ihre Projekt-ID.
LOCATION: Eine Region, in der sich Ihre Instanzen befinden, z. B. us-central1.
Wenn der Recommender Instanzen erkennt, die auf AlloyDB for PostgreSQL aktualisiert werden können, werden diese Instanzen in einer Tabelle angezeigt. Jede Zeile enthält einen Instanznamen, eine kurze Empfehlung, den Standort und das Datum der letzten Aktualisierung.
Informationen und detaillierte Empfehlungen anzeigen
Mit der Google Cloud Console, gcloud CLI oder der Recommender API können Sie Statistiken und detaillierte Empfehlungen zu Instanzen aufrufen, die auf AlloyDB for PostgreSQL aktualisiert werden können.
Console
Führen Sie einen der folgenden Schritte aus:
Klicken Sie auf der Seite Leistungsempfehlungen auf die Karte Leistungsempfehlungen und dann auf Zu AlloyDB migrieren.
Der Bereich „Empfehlung“ wird angezeigt. Dieser enthält Informationen und detaillierte Empfehlungen für die Instanz.
Klicken Sie auf der Seite Instanzen auf Zu AlloyDB migrieren. In der Liste der Instanzen werden nur die Instanzen angezeigt, für die die Empfehlung gilt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Improve performance with AlloyDB for PostgreSQL\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| 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 page describes how to view and implement recommendations about the Cloud SQL Migrate to AlloyDB for PostgreSQL [recommender](/recommender/docs/overview). This recommender helps you detect instances with the following characteristics:\n\n- The instance is critical.\n- The cache hit rate is low, which can affect performance.\n\nEvery day, this recommender proactively analyzes instance metadata and metrics about cache hit rate and provides insights and recommendations\nto improve your instance performance. You can view these insights and recommendations using the Google Cloud console,\n[gcloud CLI](/sdk/gcloud), or the [Recommender API](/recommender/docs/using-api).\n\nIf your instance is a production instance and its cache hit rate is low, then we recommended that you migrate to AlloyDB for PostgreSQL to improve performance.\nRecommendations are generated daily.\n\nPricing\n-------\n\nThe recommenders described on this page are all in the standard [Recommender pricing tier](/recommender/pricing).\n\nBefore you begin\n----------------\n\nBefore you can view recommendations and insights, do the following:\n\n- To get the permissions to view and work with insights and recommendations, ensure that you have the required [roles](/sql/docs/postgres/project-access-control#roles).\n\n For more information about roles, see [understanding roles](/iam/docs/understanding-roles) and [granting Identity and Access Management (IAM) permissions](/iam/docs/granting-changing-revoking-access).\n-\n\n\n Enable the Recommender API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com)\n\n### List performance recommendations for migrating to AlloyDB for PostgreSQL\n\nYou can list migrate to AlloyDB for PostgreSQL recommendations for improving performance\nusing the Google Cloud console, [gcloud CLI](/sdk/gcloud), or the Recommender API. \n\n### Console\n\nTo list upgrade to AlloyDB for PostgreSQL recommendations, follow these steps:\n\n1. Go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql/instances)\n2. In the **Improve instance health by investigating issues and acting on\n recommendations** banner, click **Expand Details**.\n\nAlternatively, follow these steps:\n\n1. Go to the **Recommendation Hub**.\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n\n For more information, see [Getting started with the Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n2. In the **All recommendations** card, click **Performance**.\n\n### gcloud\n\nRun the [`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list) command as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.PerformanceRecommender \\\n--filter=recommenderSubtype=MIGRATE_TO_ALLOYDB\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\n### API\n\nCall the [`insights.list`](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/list) method as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\nIf the recommender detects instances that can be upgraded to AlloyDB for PostgreSQL, then those instances appear in a table. Each row shows the instance name, a brief recommendation, the location, and the last refresh date.\n\n### View insights and detailed recommendations\n\nYou can view insights and detailed recommendations about instances that can be upgraded to AlloyDB for PostgreSQL using the Google Cloud console, [gcloud CLI](/sdk/gcloud), or the Recommender API. \n\n### Console\n\nDo one of the following:\n\n- On the **Performance Recommendations** page, click the **Performance\n recommendations** card and then click **Migrate to AlloyDB**.\n The recommendation panel appears, which contains insights and detailed\n recommendations for the instance.\n\n- On the **Instances** page, click **Migrate to AlloyDB**. The\n list of instances displays only those instances for which the\n recommendation applies.\n\n### gcloud\n\nRun the [`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list) command as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.PerformanceInsight\n--filter=insightSubtype=READ_HEAVY_WORKLOAD\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\n### API\n\nCall the [`insights.list`](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/list) method as follows: \n\n```\nGET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region where your instances are located, such as `us-central1`.\n\nA panel appears showing insights about metrics or information that the Insights highlight.\n\n### Apply recommendations\n\nTo implement this recommendation, do the following:\n\n- To upgrade to AlloyDB for PostgreSQL:\n 1. Click **Migrate to AlloyDB** in the **Issues** column. An **Upgrade to AlloyDB** window displays providing a recommendation.\n 2. To proceed with an upgrade, click **Edit** \\\u003e **Upgrade**.\n- For more information about AlloyDB for PostgreSQL, see the [AlloyDB for PostgreSQL documentation](/alloydb/docs).\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)\n- [About database observability](/sql/docs/postgres/observability)"]]