Index advisor overview

This page describes the Cloud SQL for MySQL index advisor.

Cloud SQL for MySQL offers a fully managed index advisor that tracks the queries your database handles regularly. Periodically, the index advisor analyzes these queries to recommend new indexes that can improve query performance. Enabling the index advisor lets you detect and fix performance issues with systems and queries.

How does the index advisor work?

Index advisor helps you improve query processing by doing the following:

  • Help you identify a set of indexes with SQL commands to create indexes.
  • Provide data to help you evaluate recommended indexes, for example, estimated storage size and impact of indexes on a query.
The index advisor stores and displays the CREATE INDEX command containing the database name, table name, and column names. The tracked queries are all normalized queries with all literals removed.

Index recommendations are encrypted at rest. For more information about how to use the index advisor, see Use index advisor. For more information on how to use index advisor with Query Insights, see Use index advisor with Query Insights.

In Cloud SQL for MySQL, you can use database flags to configure and tune the index advisor. For more information, see Index advisor flags.


Cloud SQL for MySQL index advisor has the following limitations:

  • The index advisor provides CREATE INDEX recommendations only.
  • The index advisor is only supported by Cloud SQL for MySQL versions 8.0 or later.
  • Enabling index advisor might require an instance restart if the performance_schema flag is off. For more information on how to enable this flag, see Database flags.
  • Replicas aren't supported in Cloud SQL for MySQL.
  • Shared core machines aren't supported in Cloud SQL for MySQL.