Skip to main content

execute_create_index

Function execute_create_index 

Source
pub fn execute_create_index(
    stmt: &Statement,
    db: &mut Database,
) -> Result<String>
Expand description

Handles CREATE INDEX [UNIQUE] <name> ON <table> [USING <method>] (<column>). Single-column indexes only.

Two flavours, branching on the optional USING <method> clause:

  • No USING, or USING btree: regular B-Tree secondary index (Phase 3e). Indexable types: Integer, Text.
  • USING hnsw: HNSW ANN index (Phase 7d.2). Indexable types: Vector(N) only. Distance metric is L2 by default; cosine and dot variants are deferred to Phase 7d.x.

Returns the (possibly synthesized) index name for the status message.