Set up Gemini in Databases

To set up Gemini in Databases, perform the steps in this document:

  1. Enable Gemini in Databases.

  2. Enable the Recommender API.

  3. Enable index advisor (only applicable to Cloud SQL for PostgreSQL and Cloud SQL for MySQL.)

Before you begin

To enable Gemini in Databases, you must have the roles/billing.admin Identity and Access Management (IAM) role.

Enable Gemini in Databases

  1. In the Google Cloud console, go to the Gemini for Google Cloud page.

    Gemini for Google Cloud

  2. Click Gemini in Databases.

    The Explore Gemini pane is displayed.

  3. Click Get Gemini in Databases.

    The Admin for Gemini page is displayed.

  4. Choose the billing for which you want to enable Gemini in Databases and click Continue to Admin for Gemini page.

    The Gemini in Databases page is displayed.

  5. Click Review terms and turn on.

    The Turn on Gemini in Databases page is displayed.

  6. Click Purchase to enable Gemini in Databases.

Enable the Recommender API

Enable the Recommender API.

Enable the API

Enable index advisor

You can enable index advisor for Cloud SQL for MySQL 8.0 instances and Cloud SQL for PostgreSQL 12 and later instances.

Cloud SQL for MySQL

Index advisor for Cloud SQL for MySQL uses data from MySQL Performance Schema. By default Cloud SQL enables MySQL Performance Schema on all MySQL 8.0 instances that have more than 15 GB of memory.

  1. Before you enable index advisor, enable Query Insights on the instance.
  2. If you already have MySQL Performance Schema enabled on your Cloud SQL for MySQL instances, then to enable index advisor, run the following gcloud CLI command:
  3. gcloud sql instances patch INSTANCE_NAME \
        --database-flags=cloudsql_index_advisor=on
    

    Replace INSTANCE_NAME with the name of your instance.

  4. If you don't have MySQL Performance Schema enabled on your Cloud SQL for MySQL instances, then to enable index advisor, run the following gcloud CLI command:
  5. gcloud sql instances patch INSTANCE_NAME \
       --database-flags=cloudsql_index_advisor=on,performance_schema=on
    

    Replace INSTANCE_NAME with the name of your instance.

For more information about configuring flags, see Configure database flags.

Cloud SQL for PostgreSQL

  1. Before you enable index advisor, enable Query Insights on the instance.
  2. To enable index advisor for Cloud SQL for PostgreSQL instances, run the following Google Cloud CLI command:
  3. gcloud sql instances patch INSTANCE_NAME \
       --database-flags=cloudsql.enable_index_advisor=on
        

    Replace INSTANCE_NAME with the name of your instance.

For more information about configuring flags, see Configure database flags.