Administra tablas abiertas y definiciones de tablas abiertas
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
MySQL | PostgreSQL | SQL Server
En esta página, se describe cómo administrar instancias con una gran cantidad de tablas abiertas y una gran cantidad de definiciones de tablas abiertas. Este recommender se llama Administra tablas abiertas.
Todos los días, este recomendador analiza las métricas de los siguientes aspectos:
La cantidad de tablas abiertas o definiciones de tablas abiertas para una instancia de la siguiente manera:
Si la cantidad de tablas abiertas o definiciones de tablas abiertas aumenta en 1 tabla cada 2 segundos o más rápido, durante las 24 horas anteriores.
Si la cantidad de tablas abiertas o definiciones de tablas abiertas es igual o mayor que el valor de table_open_cache y table_definition_cache, respectivamente.
Si se cumple alguna de estas condiciones, el recomendador te aconseja que aumentes el valor de table_open_cache o table_definition_cache.
Para obtener más información sobre cómo aumentar el valor de table_open_cache y table_definition_cache, consulta Límite de tablas.
En el banner Mejora el estado de la instancia mediante la investigación de problemas y la acción de las recomendaciones, haz clic en Expandir detalles.
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations
Reemplaza lo siguiente:
PROJECT_ID: el ID de tu proyecto
LOCATION: una región en la que se encuentran las instancias, como us-central1.
Visualiza las estadísticas y las recomendaciones detalladas
Para visualizar estadísticas y recomendaciones detalladas, sigue estos pasos:
Console
Realiza una de las siguientes acciones:
En la página Recomendaciones de rendimiento, haz clic en la tarjeta Recomendaciones de rendimiento y, luego, en Administrar tablas abiertas. Aparecerá el panel de recomendaciones, que contiene estadísticas y recomendaciones detalladas para la instancia.
En la página Instancias, haz clic en Administrar tablas abiertas.
La lista de instancias muestra solo aquellas para las que se aplica la recomendación.
LOCATION: una región en la que se encuentran las instancias, como us-central1.
INSIGHT_SUBTYPE: establece este parámetro en una de las siguientes opciones:
MYSQL_HIGH_NUMBER_OF_OPEN_TABLES: muestra estadísticas sobre la cantidad de tablas abiertas para tu instancia
MYSQL_HIGH_NUMBER_OF_OPEN_TABLE_DEFINITIONS: muestra estadísticas sobre la cantidad de definiciones de tablas abiertas para tu instancia
API
Llama al método insights.list de la siguiente manera:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights
Reemplaza lo siguiente:
PROJECT_ID: el ID de tu proyecto
LOCATION: una región en la que se encuentran las instancias, como us-central1.
Aplica la recomendación
Para implementar esta recomendación, haz una de las siguientes acciones:
Para una gran cantidad de tablas abiertas, aumenta el valor de table_open_cache en 500 hasta que la recomendación desaparezca.
Para una gran cantidad de definiciones de tablas abiertas, aumenta el valor de table_definition_cache en 500 hasta que la recomendación desaparezca.
Esta recomendación se actualiza a diario, por lo que, después de aumentar el valor de table_open_cache o table_definition_cache, espera 24 horas antes de volver a verificar la recomendación. Para obtener más información sobre cómo aumentar el valor de table_open_cache y table_definition_cache, consulta Límite de tablas.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Manage open tables and open table definitions\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n|\n| **Preview\n| --- [Gemini in Databases](/gemini/docs/overview)**\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 instances with a high number of open tables\nand a high number of open table definitions. This [recommender](/recommender/docs/recommenders) is called **Manage open tables**.\n\nEvery day, this recommender analyzes metrics for the following:\n\n- The number of open tables or open table definitions for an instance as follows:\n - If the number of open tables or open table definitions increases by 1 table every 2 seconds, or faster, during the previous 24 hours.\n - If the number of open tables or open table definitions is equal to or more than the value of `table_open_cache` and `table_definition_cache`, respectively. If either of these are true, then the recommender advises you to increase the value of `table_open_cache` or `table_definition_cache`.\n\nFor more information on increasing the value of `table_open_cache` and\n`table_definition_cache`, see [Table limit](/sql/docs/quotas#table_limit).\n\nPricing\n-------\n\nThe **Manage open tables** recommender is in the *Standard*\n[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 apply recommendations 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_RECONFIG_OPEN_TABLES\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 **Manage open tables**. The\n recommendation panel appears, which contains insights and detailed\n recommendations for the instance.\n\n- On the **Instances** page, click **Manage open tables**.\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=INSIGHT_SUBTYPE\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- \u003cvar translate=\"no\"\u003eINSIGHT_SUBTYPE\u003c/var\u003e: set this parameter to one of the following:\n - `MYSQL_HIGH_NUMBER_OF_OPEN_TABLES`: display insights for the number of open tables for your instance\n - `MYSQL_HIGH_NUMBER_OF_OPEN_TABLE_DEFINITIONS`: display insights for the number of open table definitions for your instance\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 one of the following:\n\n- For a high number of open tables, increase the value of `table_open_cache` by\n 500 until the recommendation disappears.\n\n- For a high number of open table definitions, increase the value of\n `table_definition_cache` by 500 until the recommendation disappears.\n\n| **Note:** Increasing `table_open_cache` or`table_definition_cache` requires more memory. After increasing these flags, monitor the memory usage .\n\nThis recommendation is updated daily, so after you increase the value of either\n`table_open_cache` or `table_definition_cache`, wait for 24 hours before\nchecking the recommendation again. For more information on increasing the value\nof `table_open_cache` and `table_definition_cache`, see [Table limit](/sql/docs/quotas#table_limit).\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)"]]