Create IVF Index Online

When the base table must remain available for ongoing updates and cannot be locked during index creation, use the ONLINE clause with CREATE VECTOR INDEX to build the IVF index online. This allows applications with heavy DML to continue updating the table while the index is being created.

Syntax

CREATE VECTOR INDEX index_name ON table_name (vector_column)
  ORGANIZATION NEIGHBOR PARTITIONS
  DISTANCE distance_metric
  WITH TARGET ACCURACY target_accuracy
  PARAMETERS (type IVF, neighbor partitions num_partitions)
  ONLINE;

Usage Notes

Example

CREATE VECTOR INDEX galaxies_ivf_idx ON galaxies (embedding)
  ORGANIZATION NEIGHBOR PARTITIONS
  DISTANCE COSINE
  WITH TARGET ACCURACY 90
  PARAMETERS (type IVF, neighbor partitions 10)
  ONLINE;