Inverted File Flat CREATE INDEX

Syntax and examples for creating Inverted File Flat vector indexes.

Syntax

CREATE VECTOR INDEX <vector index name>
ON <table name> ( <vector column> )
[GLOBAL] ORGANIZATION [NEIGHBOR] PARTITIONS
[WITH] [DISTANCE <metric name>]
[WITH TARGET ACCURACY <percentage value>
[PARAMETERS ( TYPE IVF,
              { NEIGHBOR PARTITIONS <number of partitions> |
                SAMPLES_PER_PARTITION <number of samples> |
                MIN_VECTORS_PER_PARTITION <minimum number of vectors per partition> |
                NEIGHBOR PARTITION GROUPING <ON \| OFF> }
            )]]
[PARALLEL <degree of parallelism>]
[LOCAL];

The GLOBAL clause specifies a global IVF index. By default, IVF vector indexes are globally partitioned by centroid.

Specify the LOCAL clause to create a local IVF index.

IVF Parameters

Parameter Purpose
NEIGHBOR PARTITIONS Determines the target number of centroid partitions that are created by the index.
SAMPLES_PER_PARTITION Decides the total number of vectors that are passed to the clustering algorithm (samples_per_partition * neighbor_partitions). Passing all the vectors could significantly increase the total index creation time. The goal is to pass in a subset of vectors that can capture the data distribution.
MIN_VECTORS_PER_PARTITION Represents the target minimum number of vectors per partition. The goal is to trim out any partition that can end up with few vectors (<= 100).
NEIGHBOR PARTITION GROUPING

Enables, in addition to partitioning, further data grouping in the storage layer for centroids in the IVF index. This can result in query performance benefits in serial, parallel, and multi-user (concurrent) queries due to additional pruning during the scan.

When this storage optimization is enabled, the default number of centroids may increase, which can lead to a longer IVF index creation time. To disable this feature, you must drop the index and recreate it. Neighbor partition grouping will continue to be enabled on an index that is rebuilt. Online index rebuild is supported on IVF indexes that have this storage option enabled.

Neighbor partition grouping can only be specified upon index creation and cannot be enabled or disabled using ALTER INDEX or REBUILD.

This parameter is only applicable to global IVF indexes. It is not supported with HNSW indexes or local IVF indexes.

The valid range for IVF vector index parameters are:

   
ACCURACY > 0 and <= 100
DISTANCE COSINE (default)

EUCLIDEAN

L2_SQUARED (as in EUCLIDEAN_SQUARED)

DOT

MANHATTAN

HAMMING
TYPE IVF
NEIGHBOR PARTITIONS >0 and <= 10000000
SAMPLES_PER_PARTITION From 1 to (num_vectors/neighbor_partitions)
MIN_VECTORS_PER_PARTITION From 0 (no trimming of centroid partitions) to total number of vectors (which would result in 1 centroid partition)
NEIGHBOR PARTITION GROUPING ON | OFF. The default value is OFF.

Examples

For detailed information on the syntax, see CREATE VECTOR INDEX in Oracle AI Database SQL Language Reference.

See Also: