Vector index functions

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

Note: To provide feedback or request support for this feature, send email tobq-vector-search@google.com.

GoogleSQL for BigQuery supports the following vector index functions.

Function list

NameSummary
VECTOR_INDEX.STATISTICS Calculate how much an indexed table's data has drifted between when a vector index was trained and the present.

VECTOR_INDEX.STATISTICS

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

Note: To provide feedback or request support for this feature, send email tobq-vector-search@google.com.
VECTOR_INDEX.STATISTICS(TABLEtable_name)

Description

TheVECTOR_INDEX.STATISTICS function calculates how much an indexed table'sdata has drifted between when avector index was trained and thepresent. Use this function to determine if table data has changed enough torequire a vector index rebuild. If necessary, you can use theALTER VECTOR INDEX REBUILD statement to rebuild the vector index.

To alter vector indexes, you must have the BigQuery Data Editor(roles/bigquery.dataEditor) or BigQuery Data Owner(roles/bigquery.dataOwner) IAM role on the table that contains thevector index.

Definitions

  • table_name: The name of the table that contains the vector index,in the formatdataset_name.table_name.

    If there is no active vector index on the table, the function returns emptyresults. If there is an active vector index on the table, but the indextraining isn't complete, the function returns aNULL drift score.

Output

AFLOAT64 value in the range[0,1). A lower value indicates less drift.Typically, a change of0.3 or greater is considered significant.

Example

This example returns the drift for the tablemytable.

SELECT*FROMVECTOR_INDEX.STATISTICS(TABLEmydataset.mytable);

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-15 UTC.