Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Vista VECTOR_INDEXES
La vista INFORMATION_SCHEMA.VECTOR_INDEXES contiene una fila para cada índice vectorial en un conjunto de datos.
Permisos necesarios
Para ver los metadatos del índice vectorial, necesitas el permiso bigquery.tables.get o bigquery.tables.list de Identity and Access Management (IAM) en la tabla con el índice. Cada una de los siguientes roles predefinidos de IAM incluye, al menos, uno de estos permisos:
Cuando consultas la vista INFORMATION_SCHEMA.VECTOR_INDEXES, los resultados de la consulta contienen una fila por cada índice vectorial de un conjunto de datos.
La vista INFORMATION_SCHEMA.VECTOR_INDEXES tiene el siguiente esquema:
Nombre de la columna
Tipo de datos
Valor
index_catalog
STRING
El nombre del proyecto que contiene el conjunto de datos.
index_schema
STRING
Es el nombre del conjunto de datos que contiene el índice.
table_name
STRING
El nombre de la tabla en la que se crea el índice.
index_name
STRING
Es el nombre del índice vectorial.
index_status
STRING
El estado del índice: ACTIVE, PENDING
DISABLEMENT, TEMPORARILY DISABLED, o
PERMANENTLY DISABLED.
ACTIVE significa que el índice se puede usar o crear. Consulta coverage_percentage
para ver el progreso de la creación del índice.
PENDING DISABLEMENT significa que el tamaño total de las tablas indexadas supera el límite de tu organización. El índice se pone en cola para su eliminación. En este estado, el índice se puede usar en las consultas de búsqueda vectorial y se te cobra por el almacenamiento del índice vectorial.
TEMPORARILY DISABLED significa que el tamaño total de las tablas indexadas supera el límite de tu organización, o la tabla indexada es inferior a 10 MB. En este estado, el índice no se usa en las consultas de búsqueda vectorial y no se te cobra por el almacenamiento del índice vectorial.
PERMANENTLY DISABLED significa que hay un cambio de esquema incompatible en la tabla indexada.
creation_time
TIMESTAMP
La hora en la que se creó el índice.
last_modification_time
TIMESTAMP
La última vez que se modificó la configuración del índice. Por ejemplo, borrar una columna indexada.
last_refresh_time
TIMESTAMP
La última vez que se indexaron los datos de la tabla. Un valor NULL significa que el índice aún no está disponible.
disable_time
TIMESTAMP
La hora en la que el estado del índice se estableció en DISABLED. El valor es NULL si el estado del índice no es DISABLED.
disable_reason
STRING
El motivo por el que se inhabilitó el índice. NULL si el estado del índice no es DISABLED.
DDL
STRING
La declaración del lenguaje de definición de datos (DDL) que se usa para crear el índice.
coverage_percentage
INTEGER
El porcentaje aproximado de datos de tabla que se indexaron.
0% significa que el índice no se puede usar en una consulta VECTOR_SEARCH, incluso si ya se indexaron algunos datos.
unindexed_row_count
INTEGER
La cantidad de filas en la tabla que no se indexaron.
total_logical_bytes
INTEGER
La cantidad de bytes lógicos facturables para el índice.
total_storage_bytes
INTEGER
La cantidad de bytes de almacenamiento facturables para el índice.
Permiso y sintaxis
Las consultas realizadas a esta vista deben tener un calificador de conjunto de datos. En la siguiente tabla, se explica el permiso de la región para esta vista:
-- Returns metadata for vector indexes in a single dataset.SELECT*FROMmyDataset.INFORMATION_SCHEMA.VECTOR_INDEXES;
Ejemplo
En el siguiente ejemplo, se muestran todos los índices vectoriales activos en las tablas del conjunto de datos my_dataset, ubicado en el proyecto my_project. Incluye los nombres, las declaraciones DDL que se usan para crearlos y el porcentaje de cobertura. Si una tabla base indexada tiene menos de 10 MB, su índice no se propaga. En ese caso, el valor coverage_percentage será 0.
[[["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)"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.VECTOR_INDEXES\u003c/code\u003e view provides metadata for each vector index within a dataset, with each row representing a unique index.\u003c/p\u003e\n"],["\u003cp\u003eAccessing vector index metadata requires \u003ccode\u003ebigquery.tables.get\u003c/code\u003e or \u003ccode\u003ebigquery.tables.list\u003c/code\u003e IAM permissions, which are included in several predefined roles such as \u003ccode\u003eroles/bigquery.admin\u003c/code\u003e and \u003ccode\u003eroles/bigquery.dataViewer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eVECTOR_INDEXES\u003c/code\u003e schema includes details like \u003ccode\u003eindex_name\u003c/code\u003e, \u003ccode\u003eindex_status\u003c/code\u003e (\u003ccode\u003eACTIVE\u003c/code\u003e, \u003ccode\u003ePENDING DISABLEMENT\u003c/code\u003e, \u003ccode\u003eTEMPORARILY DISABLED\u003c/code\u003e, or \u003ccode\u003ePERMANENTLY DISABLED\u003c/code\u003e), \u003ccode\u003ecreation_time\u003c/code\u003e, \u003ccode\u003ecoverage_percentage\u003c/code\u003e, and the \u003ccode\u003eDDL\u003c/code\u003e statement used to create the index.\u003c/p\u003e\n"],["\u003cp\u003eQueries on this view must include a dataset qualifier and the query execution location must match the region of the \u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e view.\u003c/p\u003e\n"],["\u003cp\u003eAn index might not be populated if the indexed base table is less than 10MB, in which case the \u003ccode\u003ecoverage_percentage\u003c/code\u003e is 0, meaning it is not usable.\u003c/p\u003e\n"]]],[],null,["# VECTOR_INDEXES view\n===================\n\nThe `INFORMATION_SCHEMA.VECTOR_INDEXES` view contains one row for each vector\nindex in a dataset.\n\nRequired permissions\n--------------------\n\nTo see [vector index](/bigquery/docs/vector-index) metadata, you need the\n`bigquery.tables.get` or `bigquery.tables.list` Identity and Access Management (IAM)\npermission on the table with the index. Each of the following predefined\nIAM roles includes at least one of these permissions:\n\n- `roles/bigquery.admin`\n- `roles/bigquery.dataEditor`\n- `roles/bigquery.dataOwner`\n- `roles/bigquery.dataViewer`\n- `roles/bigquery.metadataViewer`\n- `roles/bigquery.user`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.VECTOR_INDEXES` view, the query results contain one row for each vector index in a dataset.\n\n\u003cbr /\u003e\n\nThe `INFORMATION_SCHEMA.VECTOR_INDEXES` view has the following schema:\n\nScope and syntax\n----------------\n\nQueries against this view must have a [dataset qualifier](/bigquery/docs/information-schema-intro#syntax). The\nfollowing table explains the region scope for this view:\n\n\u003cbr /\u003e\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the ID of your dataset. For more information, see [Dataset qualifier](/bigquery/docs/information-schema-intro#dataset_qualifier).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\n**Example** \n\n -- Returns metadata for vector indexes in a single dataset.\n SELECT * FROM myDataset.INFORMATION_SCHEMA.VECTOR_INDEXES;\n\nExample\n-------\n\nThe following example shows all active vector indexes on tables in the dataset\n`my_dataset`, located in the project `my_project`. It includes their names, the\nDDL statements used to create them, and their coverage percentage. If an\nindexed base table is less than 10 MB, then its index is not populated, in\nwhich case the `coverage_percentage` value is 0. \n\n```googlesql\nSELECT table_name, index_name, ddl, coverage_percentage\nFROM my_project.my_dataset.INFORMATION_SCHEMA.VECTOR_INDEXES\nWHERE index_status = 'ACTIVE';\n```\n\nThe result is similar to the following: \n\n```\n+------------+------------+-------------------------------------------------------------------------------------------------+---------------------+\n| table_name | index_name | ddl | coverage_percentage |\n+------------+------------+-------------------------------------------------------------------------------------------------+---------------------+\n| table1 | indexa | CREATE VECTOR INDEX `indexa` ON `my_project.my_dataset.table1`(embeddings) | 100 |\n| | | OPTIONS (distance_type = 'EUCLIDEAN', index_type = 'IVF', ivf_options = '{\"num_lists\": 100}') | |\n+------------+------------+-------------------------------------------------------------------------------------------------+---------------------+\n| table2 | indexb | CREATE VECTOR INDEX `indexb` ON `my_project.my_dataset.table2`(vectors) | 42 |\n| | | OPTIONS (distance_type = 'COSINE', index_type = 'IVF', ivf_options = '{\"num_lists\": 500}') | |\n+------------+------------+-------------------------------------------------------------------------------------------------+---------------------+\n| table3 | indexc | CREATE VECTOR INDEX `indexc` ON `my_project.my_dataset.table3`(vectors) | 98 |\n| | | OPTIONS (distance_type = 'DOT_PRODUCT', index_type = 'TREE_AH', | |\n| | | tree_ah_options = '{\"leaf_node_embedding_count\": 1000, \"normalization_type\": \"NONE\"}') | |\n+------------+------------+-------------------------------------------------------------------------------------------------+---------------------+\n```"]]