Calculate how much an indexed table's data has drifted between when a
vector index was trained and the present.
VECTOR_INDEX.STATISTICS
VECTOR_INDEX.STATISTICS(TABLEtable_name)
Description
The VECTOR_INDEX.STATISTICS function calculates how much an indexed table's
data has drifted between when a vector index was trained and the
present. Use this function to determine if table data has changed enough to
require a vector index rebuild. If necessary, you can use the
ALTER 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 the
vector index.
Definitions
table_name: The name of the table that contains the vector index,
in the format dataset_name.table_name.
If there is no active vector index on the table, the function returns empty
results. If there is an active vector index on the table, but the index
training isn't complete, the function returns a NULL drift score.
Output
A FLOAT64 value in the range [0,1). A lower value indicates less drift.
Typically, a change of 0.3 or greater is considered significant.
Example
This example returns the drift for the table mytable.
[[["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-10-02 UTC."],[],[]]