Enable and disable vector embeddings on your instance
Stay organized with collections
Save and categorize content based on your preferences.
MySQL | PostgreSQL | SQL Server
This section describes how to configure your Cloud SQL instance to
support the storage, indexing, and querying of vector embeddings.
Both Cloud SQL Enterprise edition and Cloud SQL
Enterprise Plus edition instances support vector embeddings. All versions of
MySQL 8.0.36+ are supported.
Before you begin
Make sure you have the Cloud SQL Admin and Compute Viewer roles on
your user account.
INSTANCE_NAME: the name of the instance you want to enable vector
embedding support on.
FLAGS: configure the following MySQL flag on your instance:
cloudsql_vector: set this flag to on to enable vector embedding
storage and vector similarity search support. This flag is off by
default. When you configure the flag, your command looks similar to the
following:
The cloudsql_vector flag is static. After you update the instance with
the flag (by turning it on or off), your instance restarts automatically
in order for the configuration changes to take effect.
For more information about how to configure database flags for MySQL, see
Configure database flags.
Disable vector embeddings
Before you disable vector embeddings on your instance, you must
explicitly drop all vector indexes on the instance. To learn how to find a list
of vector indexes on the instance, see
Monitor vector indexes.
Disabling vector embeddings support prevents you from creating new vector
embedding columns and vector indexes. It also prevents you from using the
approx_distance function for vector searches. To turn off support for vector
embeddings, set the cloudsql_vector flag to off. After you configure this
static flag, the instance restarts automatically for the configuration change to
take effect.
To disable support for vector embeddings, set the cloudsql_vector flag to
off.
[[["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,["# Enable and disable vector embeddings on your instance\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n| To use the GA version of vector search, the instance maintenance version should be version `MYSQL_8_0_version.R20241208.01_00` or newer, where version is the minor version number. For information about how to upgrade your instance to a newer version that supports GA vector embeddings, see [Self-service maintenance](/sql/docs/mysql/self-service-maintenance). \n|\n| For information about the syntax and behavior of vector embeddings for the Public Preview version of this feature, see [Work with vector embeddings (Preview)](/sql/docs/mysql/work-with-vectors-preview).\n\nThis section describes how to configure your Cloud SQL instance to\nsupport the storage, indexing, and querying of vector embeddings.\n\nBoth Cloud SQL Enterprise edition and Cloud SQL\nEnterprise Plus edition instances support vector embeddings. All versions of\nMySQL 8.0.36+ are supported.\n\nBefore you begin\n----------------\n\nMake sure you have the Cloud SQL Admin and Compute Viewer roles on\nyour user account.\n\nFor more information, see\n[Roles and permissions](/sql/docs/mysql/roles-and-permissions).\n\nEnable the database flag for vector embeddings\n----------------------------------------------\n\nTo turn on support for vector embeddings, you must enable the MySQL database\nflags. \n\n gcloud sql instances patch \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --database-flags=\u003cvar translate=\"no\"\u003eFLAGS\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of the instance you want to enable vector embedding support on.\n- \u003cvar translate=\"no\"\u003eFLAGS\u003c/var\u003e: configure the following MySQL flag on your instance:\n\n - `cloudsql_vector`: set this flag to `on` to enable vector embedding\n storage and vector similarity search support. This flag is off by\n default. When you configure the flag, your command looks similar to the\n following:\n\n gcloud sql instances patch my-instance \\\n --database-flags=cloudsql_vector=on\n\n The `cloudsql_vector` flag is static. After you update the instance with\n the flag (by turning it on or off), your instance restarts automatically\n in order for the configuration changes to take effect.\n\nFor more information about how to configure database flags for MySQL, see\n[Configure database flags](/sql/docs/mysql/flags).\n\nDisable vector embeddings\n-------------------------\n\nBefore you disable vector embeddings on your instance, you must\nexplicitly drop all vector indexes on the instance. To learn how to find a list\nof vector indexes on the instance, see\n[Monitor vector indexes](/sql/docs/mysql/create-manage-vector-indexes#monitor_vector_indexes).\n\nDisabling vector embeddings support prevents you from creating new vector\nembedding columns and vector indexes. It also prevents you from using the\n`approx_distance` function for vector searches. To turn off support for vector\nembeddings, set the `cloudsql_vector` flag to `off`. After you configure this\nstatic flag, the instance restarts automatically for the configuration change to\ntake effect.\n\nTo disable support for vector embeddings, set the `cloudsql_vector` flag to\n`off`.\n\nFor example: \n\n gcloud sql instances patch \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --database-flags=cloudsql_vector=off\n\nReplace \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e with the name of the instance on which you're\nturning off vector embedding support.\n\nWhat's next\n-----------\n\n- Read the [overview about vector search on Cloud SQL](/sql/docs/mysql/vector-search).\n- Learn how to [generate vector embeddings](/sql/docs/mysql/generate-manage-vector-embeddings#generate_vector_embeddings_based_on_row_data).\n- Learn how to [create vector indexes](/sql/docs/mysql/create-manage-vector-indexes).\n- Learn how to [perform searches on vector embeddings](/sql/docs/mysql/search-filter-vector-embeddings)."]]