Stay organized with collections
Save and categorize content based on your preferences.
MySQL | PostgreSQL | SQL Server
This page describes how to manage the number of joins without indexes in your
instance's join buffer. This recommender is
called Create indexes or reconfigure join settings.
Every day, this recommender monitors the number of joins without indexes in the
join buffer. The join buffer is a per-connection memory buffer used
for storing data during join operations that cannot use indexes. If the
aggregated number of joins without indexes is greater than 500 per hour, then it
recommends to create an index or increase the value of join_buffer_size.
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 as us-central1
View insights and detailed recommendations
To view insights and detailed recommendations, follow these steps:
Console
Do one of the following:
On the Performance Recommendations page, click the Performance
recommendations card and then click Create indexes or
reconfigure join settings. The recommendation panel appears, which
contains insights and detailed recommendations for the instance.
On the Instances page, click Create indexes or reconfigure join settings.
The list of instances displays only those instances for which the
recommendation applies.
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 as us-central1
Apply the recommendation
To implement this recommendation, do the following:
Create appropriate indexes in your instance to prevent a large number of joins
without indexes.
If you are not able to create indexes for the joins, increase the value of
join_buffer_size until the recommendation disappears. The join buffer can be
increased by session or globally. We recommend that you increase the join
buffer in the session where there are a large number of joins.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[],[],null,["# Create indexes or reconfigure join settings\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to manage the number of joins without indexes in your\ninstance's join buffer. This [recommender](/recommender/docs/recommenders) is\ncalled **Create indexes or reconfigure join settings**.\n\nEvery day, this recommender monitors the number of joins without indexes in the\njoin buffer. The join buffer is a per-connection memory buffer used\nfor storing data during join operations that cannot use indexes. If the\naggregated number of joins without indexes is greater than 500 per hour, then it\nrecommends to create an index or increase the value of `join_buffer_size`.\n\nFor more information on increasing the value of `join_buffer_size`, see\n[Other memory consumption](/sql/docs/mysql/optimize-high-memory-usage#other_memory_consumption).\n\nPricing\n-------\n\nThe **Create indexes or reconfigure join settings** recommender is in the\n*Standard* [Recommender pricing tier](/recommender/pricing).\n\nBefore you begin\n----------------\n\n[Enable the Recommender API](/recommender/docs/enabling).\n\n### Required roles and permissions\n\nTo get the permissions to view and work with insights and recommendations,\nensure that you have the required [Identity and Access Management (IAM) roles](/sql/docs/mysql/project-access-control#roles).\n\nFor more information about IAM roles, see [IAM basic and predefined roles reference](/iam/docs/understanding-roles) and [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\u003cbr /\u003e\n\nList the recommendations\n------------------------\n\nTo list the recommendations, follow these steps: \n\n### Console\n\nTo list recommendations about instance performance, follow these steps:\n\n1. Go to the **Cloud SQL Instances** page.\n\n[Go to Cloud SQL Instances](https://console.cloud.google.com/sql/instances)\n\n1. On the **Improve instance health by investigating issues and acting on\n recommendations** banner, click **Expand Details**.\n\nAlternatively, follow these steps:\n\n1. Go to the **Recommendation Hub** . See also [Find and applyrecommendations with the Recommendations](/recommender/docs/recommendation-hub/identify-configuration-problems).\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n2. In the **All recommendations** card, click **Performance** .\n\n### gcloud\n\nRun the [`gcloud recommender recommendations list`](/sdk/gcloud/reference/recommender/recommendations/list) command as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.PerformanceRecommender \\\n--filter=recommenderSubtype=MYSQL_CREATE_INDEX_OR_RECONFIG_JOIN_BUFFER\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\n### API\n\nCall the [`recommendations.list`](/recommender/docs/reference/rest/v1/projects.locations.recommenders.recommendations/list) method as follows: \n\n```\nGET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\nView insights and detailed recommendations\n------------------------------------------\n\nTo view insights and detailed recommendations, follow these steps: \n\n### Console\n\nDo one of the following:\n\n- On the **Performance Recommendations** page, click the **Performance\n recommendations** card and then click **Create indexes or\n reconfigure join settings**. The recommendation panel appears, which\n contains insights and detailed recommendations for the instance.\n\n- On the **Instances** page, click **Create indexes or reconfigure join settings**.\n The list of instances displays only those instances for which the\n recommendation applies.\n\n### gcloud\n\nRun the [`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list) command as follows: \n\n```\n\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.PerformanceInsight \\\n--filter=insightSubtype=MYSQL_HIGH_JOINS_WITHOUT_INDEXES\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\n### API\n\nCall the [`insights.list`](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/list) method as follows: \n\n```\n\nGET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights\n\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: a region where your instances are located, such as `us-central1`\n\nApply the recommendation\n------------------------\n\nTo implement this recommendation, do the following:\n\n- Create appropriate indexes in your instance to prevent a large number of joins\n without indexes.\n\n- If you are not able to create indexes for the joins, increase the value of\n `join_buffer_size` until the recommendation disappears. The join buffer can be\n increased by session or globally. We recommend that you increase the join\n buffer in the session where there are a large number of joins.\n\n For more information on increasing the value of `join_buffer_size`, see\n [Other memory consumption](/sql/docs/mysql/optimize-high-memory-usage#other_memory_consumption).\n | **Note:** Increasing `join_buffer_size` requires more memory. After increasing this flag, monitor the memory usage.\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)"]]