Menggunakan konsultan indeks AlloyDB untuk PostgreSQL dengan insight kueri
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara menggunakan penasihat indeks AlloyDB untuk PostgreSQL dengan insight kueri.
Anda dapat menggunakan penasihat indeks dengan insight kueri untuk melihat rekomendasi penasihat indeks dan membuat indeks yang direkomendasikan untuk meningkatkan performa kueri.
Untuk mempelajari lebih lanjut penasihat indeks, lihat
Ringkasan penasihat indeks.
Anda dapat menggunakan Gemini Cloud Assist untuk membantu Anda memantau dan memecahkan masalah resource AlloyDB. Untuk mengetahui informasi selengkapnya, lihat
Memantau dan memecahkan masalah dengan bantuan Gemini.
Untuk mempelajari cara menggunakan penasihat indeks guna melihat dan membuat kueri rekomendasi sebagai tabel, atau untuk meminta analisis dan laporan sesuai permintaan, lihat Menggunakan penasihat indeks.
Di tabel Dimensi teratas menurut beban database, klik Kueri.
Untuk mempelajari detail rekomendasi tentang kueri, lakukan salah satu hal berikut:
Klik kueri untuk mempelajari lebih lanjut rekomendasi untuk kueri yang dipilih, termasuk informasi berikut:
Dampak performa (tinggi, sedang, dan rendah): Perkiraan kecepatan kueri setelah semua indeks yang direkomendasikan dibuat.
Rekomendasi: Buat rekomendasi indeks.
Tabel yang terpengaruh: Jumlah tabel yang akan terpengaruh saat indeks dibuat.
Perkiraan penyimpanan tambahan yang diperlukan: Perkiraan ukuran penyimpanan yang diperlukan untuk membuat semua indeks yang direkomendasikan.
Jumlah kueri yang terpengaruh: Total jumlah kueri dalam beban kerja yang terpengaruh oleh rekomendasi indeks. Indeks dapat bermanfaat untuk beberapa kueri.
Klik Buat Indeks untuk kueri tertentu guna mempelajari rekomendasi mendetail tentang cara membuat indeks untuk meningkatkan performa kueri.
Pelajari cara menggunakan penasihat indeks untuk melihat dan membuat kueri rekomendasi sebagai tabel,
atau untuk meminta analisis dan laporan sesuai permintaan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 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)."]]