Reconfigure temporary table settings

MySQL  |  PostgreSQL  |  SQL Server

Preview

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. You can process personal data for this feature as outlined in theCloud Data Processing Addendum, subject to the obligations and restrictions described in the agreement under which you access Google Cloud. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

This page describes how to manage the number of temporary tables. Thisrecommender is calledReconfigure temp table settings.

Every day, this recommender analyzes the number of temporarytables created on disk compared to the total number of temporary tables. If thenumber of temporary tables created on disk is more than 20% of the totalnumber of tables, then this recommender advises you to do one of the following:

  • Increase the value of either thetmp_table_size flag or themax_heap_table_size flag, or both flags.

  • If the values formax_heap_tmp_table_size andtmp_table_size aren't equal,then increase the smaller value to match the larger value.

  • If the values formax_heap_tmp_table_size andtmp_table_size are the same,increase both of them to a larger value.

For more information on increasing the value oftmp_table_size, seetmp_table_size.

Pricing

TheReconfigure temp table settings recommender is in theStandardRecommender pricing tier.

Before you begin

Enable the Recommender API.

Required roles and permissions

To get the permissions to view and work with insights and recommendations, ensure that you have the requiredIdentity and Access Management (IAM) roles.

TaskRole
View recommendationsrecommender.cloudsqlViewer orcloudsql.admin
Apply recommendationscloudsql.editor orcloudsql.admin
For more information about IAM roles, seeIAM basic and predefined roles reference andManage access to projects, folders, and organizations.

List the recommendations

To list the recommendations, follow these steps:

Console

To list recommendations about instance performance, follow these steps:

  1. Go to theCloud SQL Instances page.

Go to Cloud SQL Instances

  1. On theImprove instance health by investigating issues and acting onrecommendations banner, clickExpand Details .

Alternatively, follow these steps:

  1. Go to theActive Assist. See alsoFind and apply recommendations with the Recommendations.

    Go to the Active Assist

  2. In theAll recommendations card, clickPerformance .

gcloud

Run thegcloud recommender recommendations list command as follows:

gcloud recommender recommendations list \--project=PROJECT_ID \--location=LOCATION \--recommender=google.cloudsql.instance.PerformanceRecommender \--filter=recommenderSubtype=MYSQL_RECONFIG_TMP_TABLES

Replace the following:

  • PROJECT_ID: your project ID
  • LOCATION: a region where your instances are located, such asus-central1

API

Call therecommendations.list method as follows:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations

Replace the following:

  • PROJECT_ID: your project ID
  • LOCATION: a region where your instances are located, such asus-central1

View insights and detailed recommendations

To view insights and detailed recommendations, follow these steps:

Console

Do one of the following:

  • On thePerformance Recommendations page, click thePerformancerecommendations card and then clickReconfigure temp table settings.The recommendation panel appears, which contains insights and detailedrecommendations for the instance.

  • On theInstances page, clickReconfigure temp table settings. Thelist of instances displays only those instances for which therecommendation applies.

gcloud

Run thegcloud recommender insights list command as follows:

gcloud recommender insights list \--project=PROJECT_ID \--location=LOCATION \--insight-type=google.cloudsql.instance.PerformanceInsight \--filter=insightSubtype=INSIGHT_SUBTYPE

Replace the following:

  • PROJECT_ID: your project ID
  • LOCATION: a region where your instances are located, such asus-central1
  • INSIGHT_SUBTYPE: set this parameter to one of the following:
    • MYSQL_HIGH_NUMBER_OF_TMP_TABLE_ON_DISK_TMP_TABLE: displayinsights for the total number of temporary tables on disk for yourinstance
    • MYSQL_HIGH_NUMBER_OF_TMP_TABLE_ON_DISK_MAX_HEAP: displayinsights for the total number of user-created temporarytables on disk for your instance

API

Call theinsights.list method as follows:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights

Replace the following:

  • PROJECT_ID: your project ID
  • LOCATION: a region where your instances are located, such asus-central1

Apply the recommendation

To implement this recommendation, do one of the following:

  • If the values for themax_heap_tmp_table_size andtmp_table_size flags arenot equal, then increase the smaller value to match the larger value.

  • If the values for themax_heap_tmp_table_size andtmp_table_size flags arethe same, increase both of them to larger values.

Note: Increasingtmp_table_size andmax_heap_tmp_table_size requires morememory. After increasing these flags, monitor the memory usage.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-02 UTC.