Utilizzare il consulente per gli indici di AlloyDB per PostgreSQL con gli approfondimenti sulle query
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come utilizzare lo strumento di consulenza per gli indici di AlloyDB per PostgreSQL con
query insights.
Puoi utilizzare i suggerimenti sull'indicizzazione con Query Insights per visualizzare i suggerimenti
e creare gli indici consigliati per migliorare le prestazioni delle query.
Per saperne di più sul suggeritore di indici, vedi
Panoramica del suggeritore di indici.
Per scoprire come utilizzare Index Advisor per visualizzare ed eseguire query sui suggerimenti
come tabella o per richiedere un'analisi e un report on demand, consulta
Utilizzare Index Advisor.
Nell'elenco di cluster e istanze, fai clic su un'istanza.
Fai clic su Approfondimenti sulle query.
Fai clic su Modifica impostazioni.
Disattiva i suggerimenti di Index Advisor deselezionando Abilita
suggerimenti. I suggerimenti di Index Advisor sono abilitati per impostazione predefinita.
Modificare la frequenza di aggiornamento dei suggerimenti di Index Advisor
Per modificare la frequenza di aggiornamento:
Nella console Google Cloud , vai alla pagina Cluster.
Nell'elenco di cluster e istanze, fai clic su un'istanza.
Fai clic su Approfondimenti sulle query. I consigli di Index Advisor vengono visualizzati nella
colonna Consigli della tabella Dimensioni principali per carico del database.
(Facoltativo) Per visualizzare solo le query con suggerimenti CREATE INDEX, aggiungi un filtro per Suggerimento: crea indici.
Visualizzare i consigli per una query
Per visualizzare i dettagli dei consigli sugli indici per una query specifica, segui questi
passaggi:
Nella console Google Cloud , vai alla pagina Cluster.
Nell'elenco di cluster e istanze, fai clic su un'istanza.
Fai clic su Approfondimenti sulle query.
Nella tabella Dimensioni massime per carico del database, fai clic su Query.
Per visualizzare i dettagli dei suggerimenti relativi a una query, esegui una delle seguenti operazioni:
Fai clic su una query per scoprire di più sui consigli per la query selezionata, incluse le seguenti informazioni:
Impatto sulle prestazioni (alto, medio e basso): la
velocità stimata della query dopo la creazione di tutti gli indici consigliati.
Consigli: crea suggerimenti per gli indici.
Tabelle interessate: il numero di tabelle che verranno
interessate quando vengono creati gli indici.
Spazio di archiviazione stimato aggiuntivo necessario: lo spazio di archiviazione stimato necessario per creare tutti gli indici consigliati.
Numero di query interessate: il numero totale di query nel workload interessate dai suggerimenti per gli indici. Un indice può essere utile per più query.
Fai clic su Crea indici per una query specifica per visualizzare consigli dettagliati
sulla creazione di indici per migliorare le prestazioni delle query.
Visualizza le query interessate
Nella console Google Cloud , vai alla pagina Cluster.
Scopri come utilizzare Index Advisor per visualizzare ed eseguire query sui suggerimenti come tabella
o per richiedere un'analisi e un report on demand.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis page outlines how to use the AlloyDB for PostgreSQL index advisor in conjunction with query insights to optimize query performance by viewing and implementing index recommendations.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage index advisor recommendations by enabling or disabling them and adjusting the refresh frequency within the Query Insights settings of your AlloyDB cluster.\u003c/p\u003e\n"],["\u003cp\u003eThe index advisor provides insights such as performance impact, tables impacted, estimated storage needed, and number of impacted queries for each recommendation, which are all located in the \u003cstrong\u003eQueries\u003c/strong\u003e section of the \u003cstrong\u003eTop dimensions by database load\u003c/strong\u003e table.\u003c/p\u003e\n"],["\u003cp\u003eYou can directly copy and execute the \u003ccode\u003eCREATE INDEX\u003c/code\u003e commands generated by the index advisor to create the recommended indexes, which will be found after clicking \u003cstrong\u003eCreate Indexes\u003c/strong\u003e for a given query.\u003c/p\u003e\n"],["\u003cp\u003eAccessing the index advisor recommendations and editing its settings requires specific permissions, such as the Basic viewer or Database Insights viewer roles, that can be granted by an administrator.\u003c/p\u003e\n"]]],[],null,["# Use the AlloyDB for PostgreSQL index advisor with query insights\n\nThis page describes how you can use the AlloyDB for PostgreSQL index advisor with\nquery insights.\n\nYou can use the index advisor with query insights to view index advisor\nrecommendations and create recommended indexes to improve query performance.\nTo learn more about the index advisor, see\n[Index advisor overview](/alloydb/docs/index-advisor-overview).\n\nYou can use Gemini Cloud Assist to help you monitor and troubleshoot\nyour AlloyDB resources. For more information, see\n[Monitor and troubleshoot with Gemini assistance](/alloydb/docs/monitor-troubleshoot-with-gemini).\n\nTo learn how to use the index advisor to view and query recommendations\nas a table, or to request an on-demand analysis and report, see\n[Use the index advisor](/alloydb/docs/use-index-advisor).\n\nBefore you begin\n----------------\n\nTo access the query insights dashboard,\n[enable access to AlloyDB in your\nGoogle Cloud project](/alloydb/docs/project-enable-access).\n\n### Required roles\n\nTo use the AlloyDB index advisor, you need permissions to do the\nfollowing:\n\n- To access index recommendations, you need permissions to access the AlloyDB query insights dashboard.\n- To edit the index advisor settings, you need permissions to update AlloyDB instances.\n\nTo get these permissions, ask your administrator to grant you one of the\nfollowing roles:\n\n- Basic viewer (`roles/viewer`)\n- Database Insights viewer (`roles/databaseinsights.viewer`)\n\nFor more information about granting roles, see\n[Manage access](/iam/docs/granting-changing-revoking-access).\n\nDisable index advisor recommendations\n-------------------------------------\n\nTo disable index advisor recommendations, follow these steps:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query Insights**.\n\n4. Click **Edit settings**.\n\n5. Disable the index advisor recommendations by deselecting **Enable\n recommendations**. Index advisor recommendations are enabled by default.\n\nChange the refresh frequency for index advisor recommendations\n--------------------------------------------------------------\n\nTo change the refresh frequency, follow these steps:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query insights**.\n\n4. Click **Edit settings**.\n\n5. Increase or decrease the refresh frequency for index advisor\n recommendations. The default refresh frequency is every 24 hours.\n\nView and filter the index advisor recommendations\n-------------------------------------------------\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query insights** . The index advisor recommendations are displayed in\n the **Recommendations** column of the **Top dimensions by database load**\n table.\n\n4. (Optional) To view only queries with CREATE INDEX recommendations, add a\n filter for **Recommendation: Create Indexes**.\n\nView recommendations for a query\n--------------------------------\n\nTo view details of index recommendations for a specific query, follow these\nsteps:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query insights**.\n\n4. In the **Top dimensions by database load** table, click **Queries**.\n\n5. To learn recommendation details about a query, do one of the following:\n\n - Click a query to learn more about recommendations for the selected query, including the following information:\n - **Performance impact** (high, medium, and low): The estimated query speed after all recommended indexes are created.\n - **Recommendations**: Create index recommendations.\n - **Tables impacted**: The number of tables that will be impacted when indexes are created.\n - **Additional estimated storage needed**: The estimated storage size needed to create all the recommended indexes.\n - **Number of impacted queries**: The total number of queries in the workload impacted by the index recommendations. An index may benefit multiple queries.\n - Click **Create Indexes** for a specific query to learn detailed recommendations about creating indexes to improve query performance.\n\nView impacted queries\n---------------------\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query insights**.\n\n4. In the **Top dimensions by database load** table, click **Queries**.\n\n5. Click **Create indexes** for a specific query.\n\n6. Click **Show impacted queries**.\n\n7. Click a query to learn details about the impacted query.\n\nCreate recommended indexes\n--------------------------\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query insights**.\n\n4. In the **Top dimensions by database load** table, click **Queries**.\n\n5. Click **Create Indexes** for a specific query.\n\n6. Click **Copy all index commands**. The CREATE INDEX commands are copied\n to your clipboard.\n\n7. Connect to the primary instance on the command line.\n\n8. To create the recommended indexes, run the commands that were copied to\n your clipboard, for example:\n\n ```sql\n CREATE INDEX ON \"public\".\"demo_order\" (\"customer_id\");\n ```\n\nWhat's next\n-----------\n\n- Learn how to [use the index advisor](/alloydb/docs/use-index-advisor) to view and query recommendations as a table, or to request an on-demand analysis and report.\n- Learn how [AlloyDB helps make smart indexes](https://cloud.google.com/blog/products/databases/how-the-alloydb-index-advisor-helps-make-smart-indexes)."]]