API Reference›Indexes
API Reference

Indexes

Create, list and delete indexes on tables: sorted indexes for range filters, BM25 indexes for full-text search, and vector indexes for similarity search.

List indexes on a table

GET/v1/connections/{connection_id}/tables/{schema}/{table}/indexes

List the indexes on a table.

Path parameters

NameTypeDescription
connection_id (required)stringThe database's default_connection_id. It is returned by Create database and Get database. Each index returned by List indexes across tables in a database also carries the connection_id of its table.
schema (required)stringSchema name
table (required)stringTable name

Response 200 — Indexes listed

NameTypeDescription
indexes (required)IndexInfoResponse[]
Fields of indexes
NameTypeDescription
indexes[].algorithmstringVector index algorithm: hnsw or ivf. Absent for other index types.
indexes[].columns (required)string[]Indexed columns.
indexes[].created_at (required)stringWhen the index was created.
indexes[].index_name (required)stringIndex name.
indexes[].index_type (required)stringIndex type: sorted, bm25 or vector.
indexes[].metricstringDistance metric of a vector index. Absent for other index types.
indexes[].nlistintegerNumber of clusters an ivf index was built with. Can be lower than the requested nlist, because it is capped by the number of vectors the clusters were fitted to.
indexes[].probe_fractionnumberShare of an ivf index each search reads, from 0 (exclusive) to 1, when set at creation. When absent, Hotdata picks the share for each search.
indexes[].source_columnstringText column an embedding-based vector index was built from; search it with vector_distance(<source_column>, …). columns then holds the generated embedding column. Absent for other indexes.
indexes[].status (required)IndexStatusIndex build status: ready once built, pending until then.
indexes[].updated_at (required)stringWhen the index was last updated.
indexes[].vector_precisionstringPrecision a vector index stores each number at, such as int8. Always set for ivf (default int8); for hnsw, set only when chosen at creation, and otherwise it matches the column.
Example response
{
  "indexes": [
    {
      "algorithm": "string",
      "columns": [
        "string"
      ],
      "created_at": "2026-01-01T00:00:00Z",
      "index_name": "string",
      "index_type": "string",
      "metric": "string",
      "nlist": 0,
      "probe_fraction": 0,
      "source_column": "string",
      "status": "ready",
      "updated_at": "2026-01-01T00:00:00Z",
      "vector_precision": "string"
    }
  ]
}

Errors

StatusDescription
404Table not found
500Internal server error

Create an index on a table

POST/v1/connections/{connection_id}/tables/{schema}/{table}/indexes

Create a sorted, BM25 full-text or vector index on a table. The table must hold loaded data and must not declare sorted_by.

A table can have only one vector index. A vector index that generates its own embeddings (with embedding_provider_id) must be the only index on its table. Requests that break these rules return 400, even with async set.

Path parameters

NameTypeDescription
connection_id (required)stringThe database's default_connection_id. It is returned by Create database and Get database. Each index returned by List indexes across tables in a database also carries the connection_id of its table.
schema (required)stringSchema name
table (required)stringTable name

Request body

NameTypeDescription
algorithm"hnsw" or "ivf"How a vector index is built. Defaults to hnsw. hnsw: a graph kept in memory. Very fast searches, but memory grows with the table, so very large tables cannot be served. ivf: vectors grouped into clusters; a search reads only the nearest clusters. Slower than hnsw, but memory follows how much of the index a search reads, so it works for much larger tables. It stores a copy of the table's rows, which uses extra storage. Supports the l2 and cosine metrics. Search it with ORDER BY vector_distance(column, '<query>') LIMIT <k> and name the columns to return instead of *; vector_search works only with hnsw. Generating embeddings for tens of millions of rows is not supported yet.
asyncbooleanBuild the index in the background and return a job ID to poll. Default: false
async_after_msintegerWith async: true, wait up to this many milliseconds for the build before falling back to a job ID. Must be between 1000 and 30000. Min: 1000
columns (required)string[]Columns to index.
descriptionstringDescription of what the embeddings represent, such as "product descriptions".
dimensionsintegerVector size to request from the embedding model, for models that support more than one. Defaults to the model's own size.
embedding_provider_idstringEmbedding provider that turns the text column into vectors. The vectors are stored in a new column, and later loads and searches use the same provider. With ivf, the metric must be l2 or cosine.
index_name (required)string
index_type"sorted" or "bm25" or "vector"Index type. sorted supports range queries, bm25 full-text search, and vector similarity search. Default: "sorted"
metricstringDistance metric for a vector index: l2, cosine or dot. Defaults to l2, or to the embedding provider's metric when embedding_provider_id is set.
nlistintegerFor ivf: number of clusters to group the vectors into. More clusters means each search reads less data. Defaults to a value based on the table size. Range: 1–65536
output_columnstringName of the generated vector column. Defaults to {column}_embedding.
probe_fractionnumberFor ivf: share of the index each search reads, above 0 and up to 1. Higher is more accurate and slower. Range: 0–1
vector_precision"float64" or "float32" or "float16" or "float8" or "int8"How precisely a vector index stores each number. Lower precision makes the index smaller, so it needs less memory, and for ivf makes each search read less. Defaults to the column's own precision for hnsw, and int8 for ivf. To change it, drop and recreate the index; the table's data is never changed. ivf accepts int8 and float32 only. hnsw accepts every value except int8. Accuracy figures below come from benchmarks; test on your own data. float64: only for columns that already hold 64-bit values. float32: half the size of float64, with no loss for the usual 32-bit embeddings. float16: half the size of float32; results within 0.1 percentage points of float32 on 1536-dimension text embeddings with cosine distance. float8: a quarter of the size of float32; about 4 percentage points less accurate on the same test, which a wider search does not recover. int8: a quarter of the size of float32. A search of every cluster finds about 99.5% of the true neighbours; the default search finds fewer (see probe_fraction). With l2, accuracy drops when vector lengths vary widely (about 93% when the longest is 16 times the shortest); use float32 if that matters.
Example request
{
  "index_name": "orders_customer_id",
  "index_type": "sorted",
  "columns": [
    "customer_id"
  ]
}

Response 201 — Index created

NameTypeDescription
algorithmstringVector index algorithm: hnsw or ivf. Absent for other index types.
columns (required)string[]Indexed columns.
created_at (required)stringWhen the index was created.
index_name (required)stringIndex name.
index_type (required)stringIndex type: sorted, bm25 or vector.
metricstringDistance metric of a vector index. Absent for other index types.
nlistintegerNumber of clusters an ivf index was built with. Can be lower than the requested nlist, because it is capped by the number of vectors the clusters were fitted to.
probe_fractionnumberShare of an ivf index each search reads, from 0 (exclusive) to 1, when set at creation. When absent, Hotdata picks the share for each search.
source_columnstringText column an embedding-based vector index was built from; search it with vector_distance(<source_column>, …). columns then holds the generated embedding column. Absent for other indexes.
status (required)IndexStatusIndex build status: ready once built, pending until then.
updated_at (required)stringWhen the index was last updated.
vector_precisionstringPrecision a vector index stores each number at, such as int8. Always set for ivf (default int8); for hnsw, set only when chosen at creation, and otherwise it matches the column.
Example response
{
  "algorithm": "string",
  "columns": [
    "string"
  ],
  "created_at": "2026-01-01T00:00:00Z",
  "index_name": "string",
  "index_type": "string",
  "metric": "string",
  "nlist": 0,
  "probe_fraction": 0,
  "source_column": "string",
  "status": "ready",
  "updated_at": "2026-01-01T00:00:00Z",
  "vector_precision": "string"
}

Response 202 — The index is building in the background. Poll the returned job.

NameTypeDescription
id (required)stringJob ID.
status (required)JobStatusStatus of a background job. succeeded, partially_succeeded and failed are final; keep polling while it is pending or running. - pending: queued, or waiting to retry. - running: in progress. - succeeded: finished; all its work succeeded. - partially_succeeded: finished with a result, but some of its work failed (for example, some databases in a bulk creation). See error_message. - failed: failed and will not be retried. See error_message.
status_url (required)stringPath to poll for the job's status.
Example response
{
  "id": "string",
  "status": "pending",
  "status_url": "string"
}

Errors

StatusDescription
400Invalid request
404Table not found
500Internal server error

Delete an index

DELETE/v1/connections/{connection_id}/tables/{schema}/{table}/indexes/{index_name}

Delete an index from a table. Returns 409 while a load into the table is running; retry when it finishes. Deleting a vector index that generated its own embeddings keeps the embedding column in the table.

Path parameters

NameTypeDescription
connection_id (required)stringThe database's default_connection_id. It is returned by Create database and Get database. Each index returned by List indexes across tables in a database also carries the connection_id of its table.
schema (required)stringSchema name
table (required)stringTable name
index_name (required)stringIndex name

Response 204 — Index deleted

Errors

StatusDescription
404Index not found
409A load into the table is running. Retry when it finishes.
500Internal server error

List indexes across tables in a database

GET/v1/indexes

List the indexes in the database named by the X-Database-Id header, one page at a time. Filter by connection, schema, table or index type.

Query parameters

NameTypeDescription
connection_idstringFilter by connection ID
schemastringFilter by schema name
tablestringFilter by table name
index_typestringFilter by index type: sorted, bm25 or vector
limitintegerIndexes per page. Default 100, maximum 1000.
cursorstringThe next_cursor from the previous page

Headers

NameTypeDescription
X-Database-Id (required)stringDatabase ID. Required.

Response 200 — Indexes listed

NameTypeDescription
count (required)integerNumber of indexes on this page.
has_more (required)booleanWhether more indexes follow. Fetch them with next_cursor.
indexes (required)IndexEntryResponse[]Indexes on this page.
limit (required)integerPage size used.
next_cursorstringCursor for the next page, present only when has_more is true. Pass it as the cursor query parameter.
Example response
{
  "count": 0,
  "has_more": true,
  "indexes": [
    {
      "algorithm": "string",
      "columns": [
        "string"
      ],
      "created_at": "2026-01-01T00:00:00Z",
      "index_name": "string",
      "index_type": "string",
      "metric": "string",
      "nlist": 0,
      "probe_fraction": 0,
      "source_column": "string",
      "status": "ready",
      "updated_at": "2026-01-01T00:00:00Z",
      "vector_precision": "string",
      "connection_id": "string",
      "schema_name": "string",
      "table_name": "string"
    }
  ],
  "limit": 0,
  "next_cursor": "string"
}

Errors

StatusDescription
400Missing X-Database-Id, a bad filter value, or a bad cursor
404Database not found
500Internal server error