REBUILD_INDEX

Use the DBMS_VECTOR.REBUILD_INDEX function to rebuild an index.

Syntax

This API rebuilds an index. In case only the idx_name is provided, it rebuilds the index using get_ddl. When all params are provided, it performs a drop index followed by a call to dbms_vector.create_index().

DBMS_VECTOR.REBUILD_INDEX (
    IDX_NAME                   IN VARCHAR2,
    TABLE_NAME                 IN VARCHAR2 DEFAULT NULL,
    IDX_VECTOR_COL             IN VARCHAR2 DEFAULT NULL, 
    IDX_INCLUDE_COLS           IN VARCHAR2 DEFAULT NULL,
    IDX_PARTITIONING_SCHEME    IN VARCHAR2 DEFAULT NULL,
    IDX_ORGANIZATION           IN VARCHAR2 DEFAULT NULL,
    IDX_DISTANCE_METRIC        IN VARCHAR2 DEFAULT 'COSINE',
    IDX_ACCURACY               IN NUMBER DEFAULT 90,
    IDX_PARAMETERS             IN CLOB DEFAULT NULL,
    IDX_PARALLEL_CREATION      IN NUMBER DEFAULT 1,
);

Parameters

Specify the input parameters in JSON format.

Table 12-11 REBUILD_INDEX (IN) Parameters of DBMS_VECTOR

Parameter Description

table_name

Table on which to create the index.

idx_name

Name of the index.

idx_vector_col

Vector column on which to rebuild the index.

idx_partitioning_scheme

Partitioning scheme. LOCAL or GLOBAL.

idx_organization

Index organization. Either NEIGHBOR PARTITIONS or INMEMORY NEIGHBOR GRAPH.

idx_distance_metric

Distance computation metric. Defaults to COSINE. Can also be MANHATTAN, HAMMING, DOT, EUCLIDEAN, L2_SQUARED, EUCLIDEAN_SQUARED.

idx_accuracy

Target accuracy.

idx_parameters

Takes in CLOB with type of index and associated parameters. Type, neighbor partitions for IVF, neighbors/efConstruction for HNSW)

.

idx_parallel_creation

Number of parallel threads used for index construction.

DATA

This function accepts the input data type as VARCHAR2, NUMBER, or CLOB.

If you specify only the idx_name value, then the function rebuilds the index using get_ddl. If you specify all the parameter values, then the function first performs a drop index operation and then calls the DBMS_VECTOR.CREATE_INDEX() function.