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
/v1/connections/{connection_id}/tables/{schema}/{table}/indexesList the indexes on a table.
Path parameters
| Name | Type | Description |
|---|---|---|
connection_id (required) | string | The 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) | string | Schema name |
table (required) | string | Table name |
Response 200 — Indexes listed
| Name | Type | Description |
|---|---|---|
indexes (required) | IndexInfoResponse[] |
Fields of indexes
| Name | Type | Description |
|---|---|---|
indexes[].algorithm | string | Vector index algorithm: hnsw or ivf. Absent for other index types. |
indexes[].columns (required) | string[] | Indexed columns. |
indexes[].created_at (required) | string | When the index was created. |
indexes[].index_name (required) | string | Index name. |
indexes[].index_type (required) | string | Index type: sorted, bm25 or vector. |
indexes[].metric | string | Distance metric of a vector index. Absent for other index types. |
indexes[].nlist | integer | Number 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_fraction | number | Share 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_column | string | Text 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) | IndexStatus | Index build status: ready once built, pending until then. |
indexes[].updated_at (required) | string | When the index was last updated. |
indexes[].vector_precision | string | Precision 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
| Status | Description |
|---|---|
404 | Table not found |
500 | Internal server error |
Create an index on a table
/v1/connections/{connection_id}/tables/{schema}/{table}/indexesCreate 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
| Name | Type | Description |
|---|---|---|
connection_id (required) | string | The 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) | string | Schema name |
table (required) | string | Table name |
Request body
| Name | Type | Description |
|---|---|---|
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. |
async | boolean | Build the index in the background and return a job ID to poll. Default: false |
async_after_ms | integer | With 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. |
description | string | Description of what the embeddings represent, such as "product descriptions". |
dimensions | integer | Vector size to request from the embedding model, for models that support more than one. Defaults to the model's own size. |
embedding_provider_id | string | Embedding 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" |
metric | string | Distance 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. |
nlist | integer | For 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_column | string | Name of the generated vector column. Defaults to {column}_embedding. |
probe_fraction | number | For 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
| Name | Type | Description |
|---|---|---|
algorithm | string | Vector index algorithm: hnsw or ivf. Absent for other index types. |
columns (required) | string[] | Indexed columns. |
created_at (required) | string | When the index was created. |
index_name (required) | string | Index name. |
index_type (required) | string | Index type: sorted, bm25 or vector. |
metric | string | Distance metric of a vector index. Absent for other index types. |
nlist | integer | Number 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_fraction | number | Share 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_column | string | Text 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) | IndexStatus | Index build status: ready once built, pending until then. |
updated_at (required) | string | When the index was last updated. |
vector_precision | string | Precision 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.
| Name | Type | Description |
|---|---|---|
id (required) | string | Job ID. |
status (required) | JobStatus | Status 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) | string | Path to poll for the job's status. |
Example response
{
"id": "string",
"status": "pending",
"status_url": "string"
}
Errors
| Status | Description |
|---|---|
400 | Invalid request |
404 | Table not found |
500 | Internal server error |
Delete an index
/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
| Name | Type | Description |
|---|---|---|
connection_id (required) | string | The 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) | string | Schema name |
table (required) | string | Table name |
index_name (required) | string | Index name |
Response 204 — Index deleted
Errors
| Status | Description |
|---|---|
404 | Index not found |
409 | A load into the table is running. Retry when it finishes. |
500 | Internal server error |
List indexes across tables in a database
/v1/indexesList 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
| Name | Type | Description |
|---|---|---|
connection_id | string | Filter by connection ID |
schema | string | Filter by schema name |
table | string | Filter by table name |
index_type | string | Filter by index type: sorted, bm25 or vector |
limit | integer | Indexes per page. Default 100, maximum 1000. |
cursor | string | The next_cursor from the previous page |
Headers
| Name | Type | Description |
|---|---|---|
X-Database-Id (required) | string | Database ID. Required. |
Response 200 — Indexes listed
| Name | Type | Description |
|---|---|---|
count (required) | integer | Number of indexes on this page. |
has_more (required) | boolean | Whether more indexes follow. Fetch them with next_cursor. |
indexes (required) | IndexEntryResponse[] | Indexes on this page. |
limit (required) | integer | Page size used. |
next_cursor | string | Cursor 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
| Status | Description |
|---|---|
400 | Missing X-Database-Id, a bad filter value, or a bad cursor |
404 | Database not found |
500 | Internal server error |