This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 88792ed0d1 [docs] Reorganize the vector index guide (#11397)
88792ed0d1 is described below
commit 88792ed0d15b6aec47e4bdef997fb3971914cecb
Author: Jingsong Lee <[email protected]>
AuthorDate: Tue Nov 24 13:23:49 2026 +0800
[docs] Reorganize the vector index guide (#11397)
---
docs/docs/multimodal-table/global-index/vector.mdx | 421 +++++++++++----------
docs/static/img/multimodal-vector-index-flow.svg | 68 ++++
docs/static/img/multimodal-vector-maxsim.svg | 60 +++
3 files changed, 348 insertions(+), 201 deletions(-)
diff --git a/docs/docs/multimodal-table/global-index/vector.mdx
b/docs/docs/multimodal-table/global-index/vector.mdx
index 0e3f58fb92..9ec36b7252 100644
--- a/docs/docs/multimodal-table/global-index/vector.mdx
+++ b/docs/docs/multimodal-table/global-index/vector.mdx
@@ -27,54 +27,38 @@ under the License.
# Vector Index
-Vector Index provides approximate nearest neighbor (ANN) search for vector
similarity search scenarios such as
-recommendation systems, image retrieval, and RAG (Retrieval Augmented
Generation) applications.
+A vector index uses approximate nearest neighbor (ANN) search to find rows with
+embeddings similar to a query vector. On a Data Evolution append table, Paimon
+uses the matching row IDs to read the requested columns.
-Supported vector index types:
+[](/img/multimodal-vector-index-flow.svg)
-| Index Type | Description |
-|---|---|
-| `ivf-flat` | IVF index with flat vector storage. |
-| `ivf-pq` | IVF index with product quantization. |
-| `ivf-sq` | IVF index with 8-bit scalar-quantized residuals. |
-| `ivf-rq` | IVF index with rotated residual quantization. |
-| `diskann` | paimon-vindex DiskANN index with graph traversal and persisted
rerank vectors. |
+The examples use Data Evolution append tables. For setup, coverage and refresh,
+or the primary-key index lifecycle, see [Global
Index](../global-index#prerequisites),
+[Manage Global Indexes](./manage-indexes), and
+[Primary-Key Global Index](../../primary-key-table/global-index).
-Choose the index type based on the trade-off you want:
-
-| Index Type | Best For |
-|---|---|
-| `ivf-flat` | Highest recall among IVF variants when storage and memory are
acceptable. |
-| `ivf-pq` | The smallest IVF files when stronger quantization loss is
acceptable. |
-| `ivf-sq` | High compact-index throughput with one byte per vector dimension.
|
-| `ivf-rq` | Higher compact-IVF recall when additional scan work is
acceptable. |
-| `diskann` | High-recall immutable collections served from local SSD or a
complete local cache. |
-
-See the [paimon-vindex
documentation](https://paimon.apache.org/docs/vector-index/) for its index
-selection guidance, storage architecture, and native API details.
-
-:::warning Upgrading paimon-vindex indexes to 0.3.0
+## Build Vector Index
-paimon-vindex 0.3.0 does not read the experimental `ivf-hnsw-flat` and
`ivf-hnsw-sq` files written
-by 0.2.x. Rebuild those indexes as `ivf-flat`, `ivf-pq`, `ivf-sq`, `ivf-rq`,
or `diskann` before
-removing the old runtime. Keep the source vectors or a 0.2-compatible index
copy until the upgrade
-is accepted.
+Load the embeddings before building the index. For Python builds and queries,
+install `pypaimon[vindex]` or the matching `paimon-vindex==0.6.0` dependency.
-:::
+### Supported Columns
-For table prerequisites, see [Global Index](../global-index#prerequisites).
-For refresh, coverage modes, and shared build options, see
-[Manage Global Indexes](./manage-indexes).
+| Embeddings per row | Column type | Embedding dimension |
+|---|---|---|
+| One | `ARRAY<FLOAT>` | Set `<index-type>.dimension` to the array length. The
default is `128`. |
+| One | `VECTOR<FLOAT, d>` | Paimon reads `d` from the column type. |
+| List | `ARRAY<VECTOR<FLOAT, d>>` | Paimon reads `d` from the inner `VECTOR`
type. |
+| List | `ARRAY<ARRAY<FLOAT>>` | Set `<index-type>.dimension` to the length of
each inner array. |
-## Build Vector Index
+For instructions on declaring a `VECTOR` column, see [Vector
Storage](../vector).
-Create and populate the [shared example table](../global-index#prerequisites)
first.
-The build and search examples below use its three-dimensional `embedding`
column.
-For this small dataset, use `ivf-flat` with one cluster; production workloads
should
-choose an index type and cluster count for their own data.
+### Build an Index on a Single-Vector Column
-For Python, install `pypaimon[vindex]` (or its matching `paimon-vindex==0.6.0`
-dependency) before building or querying native vector indexes.
+Create and populate the [shared example table](../global-index#prerequisites).
+Its `embedding` column contains three-dimensional vectors. The following
examples
+use `ivf-flat` with one cluster.
<Tabs groupId="vector-build">
@@ -130,54 +114,40 @@ print(added_files)
</Tabs>
-For `ARRAY<FLOAT>` columns, specify the dimension with
`<index-type>.dimension`.
-For `VECTOR<FLOAT, n>` columns, Paimon uses the dimension from the column type.
-Every query vector must have that same dimension.
+### Build an Index on a List of Vectors
-### Python Tables with Deletion Vectors
+On a Data Evolution append table, each row can hold a different number of
+embeddings. Each embedding list column can have its own range-sharded
`ivf-flat`,
+`ivf-pq`, `ivf-sq`, `ivf-rq`, or `diskann` index. These indexes require cosine
+similarity and use it by default. A range with no embeddings produces no index
file.
-Python can build the native vector indexes listed above on data-evolution
tables
-with deletion vectors enabled, including tables created with the multimodal
API's
-default options:
+For the SQL examples, create a Data Evolution table `db.documents` with an
+`id INT` column and a `chunks ARRAY<VECTOR<FLOAT, 2>>` column. Define `chunks`
+using `DataTypes.ARRAY(DataTypes.VECTOR(2, DataTypes.FLOAT()))` in Java or
+`pa.list_(pa.list_(pa.float32(), 2))` in a PyArrow schema. Load the sample rows
+and build the index in Spark SQL.
-```python
-import pyarrow as pa
-import pypaimon.multimodal as pm
+```sql
+INSERT INTO db.documents VALUES
+ (1, array(array(1.0f, 0.0f), array(0.0f, 1.0f))),
+ (2, array(array(1.0f, 1.0f)));
-connection = pm.connect(options={"warehouse": "/tmp/paimon-warehouse"})
-table = connection.create_table(
- "vectors",
- schema=pa.schema([("id", pa.int64()), ("embedding", pa.list_(pa.float32(),
2))]),
- options={"file.format": "parquet"},
-)
-table.add([{"id": 1, "embedding": [0.0, 1.0]}, {"id": 2, "embedding": [1.0,
1.0]}])
-table.create_index("embedding", "ivf-flat", options={
- "ivf-flat.nlist": "1", "ivf-flat.distance.metric": "l2",
-})
-table.delete("id = 1")
-print(table.search([0.0, 1.0]).select(["id"]).limit(1).to_list()) # [{"id":
2}]
+CALL sys.create_global_index(
+ table => 'db.documents',
+ index_column => 'chunks',
+ index_type => 'ivf-flat',
+ options => 'ivf-flat.nlist=1'
+);
```
-Index builds preserve physical row IDs, including rows already marked as
deleted.
-Search applies the deletion vectors from its query snapshot before selecting
-top-K results, so logical deletes do not require rebuilding the index. Logical
-deletion does not physically remove vectors from existing index files.
+If `chunks` is `ARRAY<ARRAY<FLOAT>>` with two-element embeddings, add
+`ivf-flat.dimension=2` to the build options.
## Vector Search
-Python indexed vector searches use the `global-index.thread-num` table option,
-the same as Java. It must be a positive integer and defaults to `32`. Single
and
-batch queries open and search at most that many index shards concurrently,
-bounded by the number of splits. Set it to `1` for serial shard searches. It
-applies to both paimon-vindex and Lumina indexes. Results retain the same score
-and row-ID tie ordering. Each shard can also use native search and I/O threads,
-so choose the thread count together with those settings and the available
-memory. In Python, raw-vector fallback continues to use the table read
-parallelism.
-
-The examples search the three-dimensional IVF-flat index built above. A limit
of
-`5` returns at most five matches; the three-row sample table returns fewer.
-`ivf.nprobe=1` matches the single cluster in this example.
+Match the query vector dimension to the indexed embeddings. The following
+examples request up to five rows from the three-dimensional `embedding` index.
+`ivf.nprobe=1` probes the sample index's only cluster.
<Tabs groupId="vector-search">
@@ -194,8 +164,7 @@ ORDER BY __paimon_search_score DESC, id;
<TabItem value="flink-sql-procedure" label="Flink SQL (Procedure)">
-Unlike Spark's table-valued function, Flink uses a `CALL` procedure to perform
vector search.
-The procedure returns JSON-serialized rows as strings.
+Flink's `CALL` procedure returns rows as JSON strings.
```sql
-- Search for top-5 nearest neighbors
@@ -259,9 +228,6 @@ List<GlobalIndexResult> batchResults =
table.newBatchVectorSearchBuilder()
// batchResults.get(i) corresponds to queryVectors[i].
```
-For Java, use `Table.newVectorSearchBuilder()` to produce a global index
result, then pass
-the result to `TableScan.withGlobalIndexResult`.
-
</TabItem>
<TabItem value="python-sdk" label="Python SDK">
@@ -288,94 +254,39 @@ pa_table = table_read.to_arrow(plan.splits())
print(pa_table)
```
-You can also add a scalar filter to pre-filter rows before vector search:
-
-```python
-from pypaimon.common.predicate_builder import PredicateBuilder
-
-table.create_global_index("category", index_type="btree")
-
-predicate = (
- PredicateBuilder(table.fields)
- .equal("category", "electronics")
-)
-
-result = (
- table.new_vector_search_builder()
- .with_vector_column("embedding")
- .with_query_vector([1.0, 2.0, 3.0])
- .with_limit(5)
- .with_filter(predicate)
- .execute_local()
-)
-```
-
-Exact scalar global-index answers pre-filter the vector search. If scalar
indexes cannot
-evaluate the predicate, each shard retrieves ANN candidates and checks them
against the
-filter columns of the same pinned snapshot. The coordinator merges the
filtered results;
-it does not perform a full-table scalar scan or a raw scan to fill missing
matches.
-
-`vector-index.post-filter.candidates-factor` is a positive integer, defaulting
to `10`.
-The candidate count is `max(original Top-K * factor, required reranking
limit)`, capped by
-the shard size and the backend integer limit. For example, Top-K 10 normally
requests 100
-candidates. Batch execution may split large inputs into memory-bounded chunks.
On single-vector
-columns, each query runs ANN once per shard. Post-filtering may return fewer
than Top-K rows, including zero even
-when matches exist outside the candidates. Increasing the factor trades more
ANN/scalar
-work for more candidates. Post-filtering does not retry or scan raw data to
fill Top-K.
-Raw work outside vector coverage still follows the configured index search
modes. When a
-scalar index can evaluate the predicate but covers only some rows, setting
-[`scalar-index.prefilter.search-mode`](./manage-indexes#coverage-and-freshness)
-to `full` or `detail` also plans raw scans for its uncovered rows.
-
-Build a BTree index for frequently used metadata filters, such as `category`,
`tenant_id`,
-or `event_time`, to restrict candidate row IDs before ANN.
-
-An index answer that is only a candidate set — `contains`, ends-with or `LIKE`
on a BTree index,
-or a conjunction with a member no index can evaluate — is never ranked as if
it matched, because
-a non-matching but closer row would take a top-k slot from a matching one. By
default such
-candidates are excluded and a warning is logged, so the result may hold fewer
than `limit` rows;
-set `global-index.filter.refine-from-data=true` to verify them by reading
their filter columns
-instead. That read runs on the caller and can cover every candidate row.
-
</TabItem>
</Tabs>
-A search selects top-K row IDs; reading those rows through a regular table scan
-does not imply score order. See [Read Scored
Results](./manage-indexes#read-scored-results)
-for SQL ordering and Java/Python score access.
+Vector search selects the top-K row IDs and their scores. To return table
+rows in score order, see [Read Scored
Results](./manage-indexes#read-scored-results).
### Search a List of Vectors
-On a Data Evolution append table, Spark SQL, Flink SQL, Java, and PyPaimon can
search a column
-containing multiple embeddings per row. The native `ivf-flat`, `ivf-pq`,
`ivf-sq`, `ivf-rq`, and `diskann`
-indexes support these columns with range sharding and cosine similarity.
-Omitting the metric selects `cosine`. Index creation rejects any other metric.
-The column can be `ARRAY<VECTOR<FLOAT, d>>` or `ARRAY<ARRAY<FLOAT>>`. For the
latter,
-specify the inner dimension when building the index. Each row can contain a
different
-number of vectors. You can build an independent index for each such column.
-
-```sql
--- Spark SQL
-CALL sys.create_global_index(
- table => 'db.documents', index_column => 'chunks', index_type =>
'ivf-flat',
- options => 'ivf-flat.dimension=2,ivf-flat.distance.metric=cosine'
-);
-
-SELECT id, __paimon_search_score
-FROM vector_search('db.documents', 'chunks', array(array(1.0f, 0.0f),
array(0.0f, 1.0f)), 10)
-ORDER BY __paimon_search_score DESC, id;
-```
+Spark SQL, Flink SQL, Java, and PyPaimon can search columns that store multiple
+embeddings per row. The SQL examples use the
+[index on `db.documents.chunks`](#build-an-index-on-a-list-of-vectors).
A single query vector ranks rows by their best matching embedding. A query
matrix
uses MaxSim to rank rows. For every query vector, take the highest cosine
similarity
-among a row's embeddings, then sum those similarities. Each row can occupy one
-place in the result. Null embeddings are skipped. A row with no embeddings has
no score.
-A range with no embeddings produces no index file.
+among a row's embeddings, then sum those similarities. Each row appears at
most once.
+Null embeddings are skipped. A row with no embeddings has no score.
Query matrices require at least one vector, fixed inner dimensions and finite
coordinates.
+
+[![For the sample row with id 1, the query vectors [1, 0] and [0, 1] each have
a best cosine match of 1 against the row's embeddings. MaxSim adds the two
maxima for a row score of
2.](/img/multimodal-vector-maxsim.svg)](/img/multimodal-vector-maxsim.svg)
+
Spark SQL accepts a deterministic matrix expression that it can evaluate
during analysis,
such as a nested array literal, in an uncorrelated `vector_search` call. A
correlated
`LATERAL vector_search` call takes one query vector per outer row.
+
+```sql
+SELECT id, __paimon_search_score
+FROM vector_search('db.documents', 'chunks', array(array(1.0f, 0.0f),
array(0.0f, 1.0f)), 10)
+ORDER BY __paimon_search_score DESC, id;
+```
+
+Row `1` scores `2`, and row `2` scores approximately `1.414`.
+
In Flink SQL, pass the matrix as a JSON string to the search procedure. The
procedure
executes matrix queries locally even when `vector-search.distribute.enabled`
is enabled.
@@ -387,47 +298,114 @@ CALL sys.vector_search(
);
```
-For a matrix query, Paimon retrieves candidate rows for each query vector and
scores the
-union against their complete lists from the query snapshot. Candidate
retrieval is approximate.
-Each indexed vector carries the row ID of its source list. When several
matches share that
-ID, the reader keeps their highest score and can request more distinct
candidate rows
-before applying the post-filter.
-By default, it requests up to four times the final limit per query vector per
shard.
-Set `refine_factor` to select that multiplier for any of the five indexes.
Uncovered rows
-included by the search mode are scored with the same MaxSim formula. Java
exposes matrix queries through
-`newVectorSearchBuilder().withMultiVector(float[][])`. PyPaimon uses
-`new_vector_search_builder().with_multi_vector(vectors)` with a compatible
native runtime.
-For independent top-K results per vector, use the batch vector search builder.
+For a matrix query, Paimon retrieves approximate candidates for each query
vector.
+When several matched embeddings share a row ID, the reader keeps the highest
+score for that ID and can request more distinct candidates before applying the
+post-filter. Paimon scores the union of candidate rows against their complete
+embedding lists from the query snapshot.
-## Search Options
+The reader requests up to four times the final limit per query vector per shard
+by default. Set `refine_factor` to change that multiplier for any of the five
+indexes. Uncovered rows included by the search mode use the same MaxSim
scoring.
-Search-time options are passed with each vector search request:
+For matrix queries, Java uses
`newVectorSearchBuilder().withMultiVector(float[][])`.
+PyPaimon uses `new_vector_search_builder().with_multi_vector(vectors)` with a
+compatible native runtime. For independent top-K results per vector, use the
+batch vector search builder.
-| Option | Default | Description |
-|---|---|---|
-| `ivf.nprobe` | Automatic | Explicit number of IVF clusters to probe. When
omitted, paimon-vindex derives the width from the index, `top_k`, and filter
selectivity. |
-| `centroid.nprobe` | Automatic | Number of centroid shards to search per
row-ID range. Paimon chooses this width when omitted. Within each selected
shard, `ivf.nprobe` controls the IVF lists to search and `diskann.l_search`
controls the DiskANN graph search width. |
-| `ivf.max_initial_filter_expansion_factor` | Disabled | Positive integer
limiting filter-driven expansion of the initial automatic IVF probe width. A
factor of `1` disables initial filter expansion. Progressive retries may still
probe more clusters when fewer than `top_k` filtered results are found. |
-| `refine_factor` | List columns use `4` for a matrix query and `1` for a
single query vector. Disabled for single-vector columns. | Retrieves `top_k *
refine_factor` candidates per query vector and reranks them with the original
vectors stored in the Paimon table. For single-vector columns it is most useful
with compressed indexes such as `ivf-pq`, `ivf-sq`, and `ivf-rq`. |
-| `ivf_pq.batch_table_reuse` | `auto` | Distance-table reuse for native
batched IVF-PQ searches on single-vector columns. Accepts `auto`, `on`, or
`off`. |
-| `ivf_pq.batch_table_reuse.max_bytes` | 512 MiB | Positive long integer
limiting the memory used by IVF-PQ batch distance-table reuse. Search falls
back to direct table construction when the reusable tables exceed the budget. |
-| `diskann.l_search` | Automatic | paimon-vindex DiskANN graph candidate
width. The automatic value uses calibration when available, otherwise `max(100,
2 * top_k)`. |
+### Filter Vector Search in Python
-Use the same distance metric at build time and query time. Search options can
be passed per query,
-so you can use a larger `ivf.nprobe` or `diskann.l_search` for higher recall
queries and a smaller
-value for latency-sensitive queries. Do not set both in one query.
+Use `with_filter` to restrict matches by scalar columns. This example builds a
+BTree index on `category` in the shared example table.
-`ivf.max_initial_filter_expansion_factor` applies only to automatic IVF search
and cannot be combined
-with `ivf.nprobe` or `diskann.l_search`. Lower factors reduce initial
filtered-search work but may
-reduce Recall@K compared with uncapped automatic search. Progressive expansion
occurs only when
-fewer than `top_k` valid results are returned; if the capped initial search
already fills `top_k`,
-probing stops.
+```python
+from pypaimon.common.predicate_builder import PredicateBuilder
-`refine_factor` also accepts the alias `rerank_factor` and hyphenated
spellings such as
-`refine-factor`. The four IVF indexes also accept `ivf.refine_factor`. Setting
`refine_factor=1`
-still performs the raw-vector rerank for the indexed candidates. Single-vector
columns skip
-reranking when the option is unset.
-List columns always score candidate rows against their complete embedding
lists.
+table = catalog.get_table("db.my_table")
+table.create_global_index("category", index_type="btree")
+
+predicate = (
+ PredicateBuilder(table.fields)
+ .equal("category", "electronics")
+)
+
+result = (
+ table.new_vector_search_builder()
+ .with_vector_column("embedding")
+ .with_query_vector([1.0, 2.0, 3.0])
+ .with_limit(5)
+ .with_filter(predicate)
+ .execute_local()
+)
+```
+
+Exact scalar index results restrict ANN search to matching row IDs. If the
+scalar indexes cannot evaluate the predicate, each shard retrieves ANN
+candidates and checks their filter columns from the pinned query snapshot.
+The coordinator merges the filtered results from the shards.
+
+`vector-index.post-filter.candidates-factor` is a positive integer with
default `10`.
+The candidate count is `max(original Top-K * factor, required reranking
limit)`,
+capped by the shard size and the backend integer limit. Top-K 10 normally
requests
+100 candidates. Batch execution can split large inputs into memory-bounded
chunks.
+On single-vector columns, each query runs ANN once per shard. Post-filtering
+can return fewer than `top_k` rows, even zero, when matches fall outside the
+candidates. Increasing the factor adds candidates and increases ANN and scalar
+filter work.
+
+Raw searches outside vector index coverage follow the configured index search
+modes. When a scalar index can evaluate the predicate and covers only some
+rows, setting `scalar-index.prefilter.search-mode` to `full` or `detail` also
plans
+raw scans for its uncovered rows. See [Coverage and
Freshness](./manage-indexes#coverage-and-freshness).
+
+Some scalar index answers contain unverified candidates. Examples include
+`contains`, ends-with, or `LIKE` on a BTree index and conjunctions with a
+condition that no index can evaluate. By default, Python excludes these
+candidates and logs a warning, so the result may hold fewer than `limit` rows.
+Set `global-index.filter.refine-from-data=true` to verify the candidates
against
+their filter columns. That read runs on the caller and can cover every
candidate row.
+
+### Python Tables with Deletion Vectors
+
+Python can build native vector indexes on Data Evolution append tables
+with deletion vectors enabled, including tables created with the multimodal
API's
+default options:
+
+```python
+import pyarrow as pa
+import pypaimon.multimodal as pm
+
+connection = pm.connect(options={"warehouse": "/tmp/paimon-warehouse"})
+table = connection.create_table(
+ "vectors",
+ schema=pa.schema([("id", pa.int64()), ("embedding", pa.list_(pa.float32(),
2))]),
+ options={"file.format": "parquet"},
+)
+table.add([{"id": 1, "embedding": [0.0, 1.0]}, {"id": 2, "embedding": [1.0,
1.0]}])
+table.create_index("embedding", "ivf-flat", options={
+ "ivf-flat.nlist": "1", "ivf-flat.distance.metric": "l2",
+})
+table.delete("id = 1")
+print(table.search([0.0, 1.0]).select(["id"]).limit(1).to_list()) # [{"id":
2}]
+```
+
+Index builds preserve physical row IDs, including rows already marked as
deleted.
+Search applies the deletion vectors from its query snapshot before selecting
+top-K results, so logical deletes do not require rebuilding the index. Logical
+deletion does not physically remove vectors from existing index files.
+
+## Choose an Index Type
+
+| Index type | Layout | When to use it |
+|---|---|---|
+| `ivf-flat` | IVF with flat vector storage | Favor recall when memory and
storage allow it. |
+| `ivf-pq` | IVF with product quantization | Minimize IVF index size when
stronger quantization is acceptable. |
+| `ivf-sq` | IVF with 8-bit scalar-quantized residuals | Favor search
throughput with one byte per vector dimension. |
+| `ivf-rq` | IVF with rotated residual quantization | Favor recall on a
compact IVF index when higher scan cost is acceptable. |
+| `diskann` | DiskANN graph with persisted rerank vectors | Serve high-recall
queries on immutable collections from a local SSD or a complete local cache. |
+
+For index selection guidance, storage details, and the native API, see the
+[paimon-vindex documentation](https://paimon.apache.org/docs/vector-index/).
## Build Options
@@ -435,9 +413,9 @@ Build options for native vector indexes:
| Option | Default | Description |
|---|---|---|
-| `<index-type>.sharding` | `range` | Use `centroid` to train an outer router
for each row-ID range when building a Spark Data Evolution index. |
+| `<index-type>.sharding` | `range` | Use `centroid` to train an outer router
per row-ID range in a Spark or PyPaimon Data Evolution build. |
| `<index-type>.centroid.nlist` | Automatic | Number of outer centroids per
contiguous row-ID range with centroid sharding. |
-| `<index-type>.dimension` | `128` for `ARRAY<FLOAT>` | Required for
`ARRAY<ARRAY<FLOAT>>`. Columns with a fixed-size vector type supply their own
dimension. |
+| `<index-type>.dimension` | `128` for `ARRAY<FLOAT>` | See [Supported
Columns](#supported-columns) for how each column type supplies the dimension. |
| `<index-type>.distance.metric` | `inner_product` for single-vector columns,
`cosine` for lists | Single-vector columns support `l2`, `cosine`, and
`inner_product`. List columns support `cosine`. |
| `<index-type>.ivf.coarse-assignment` | `auto` | Build-time list assignment
for all IVF types. `auto` uses Vamana when `dimension × nlist ≥ 1,000,000` and
exact assignment otherwise; `exact` always uses exact assignment. |
| `<index-type>.ivf.train.max-points-per-centroid` | `256` | Positive coarse
K-means training limit for all IVF types: at most `nlist × value` vectors. |
@@ -494,11 +472,10 @@ Additional paimon-vindex DiskANN build options:
### Quantized and DiskANN Builds
-The following are alternative builds for a **separate, populated** table
-`db.model_embeddings` whose `embedding ARRAY<FLOAT>` values have dimension
`768`.
-They do not apply to the three-dimensional sample table. Choose one
alternative;
-train quantized indexes on a representative dataset large enough for the chosen
-clustering and quantization parameters.
+Choose one of these builds for a populated `db.model_embeddings` table with
+768-dimensional `embedding ARRAY<FLOAT>` values. Train quantized indexes on a
+representative dataset large enough for the chosen clustering and quantization
+parameters.
```sql
CALL sys.create_global_index(
@@ -523,12 +500,12 @@ CALL sys.create_global_index(
Pass the same option keys to Python's `create_global_index(...,
options={...})`.
Use full 768-dimensional query vectors when searching either of these indexes.
-## Centroid-Based Sharding
+### Centroid-Based Sharding
[Centroid Vector Index](./centroid-vector) covers Spark and PyPaimon builds,
probe options, the
index manifest and router file formats, and the Bitmap filters attached to
each shard.
-## Per-Field Options
+### Per-Field Options
The options above can also be set at the table level (in `TBLPROPERTIES`),
where they are shared
by every vector column of the same index type. When a table has multiple
vector columns, you can
@@ -600,6 +577,48 @@ These properties configure subsequent IVF-PQ builds;
creating the table does not
build an index. After loading data, a build on `title_embedding` uses
`nlist=256`,
while one on `image_embedding` uses `nlist=512` and trains with half of its
non-null vectors.
+## Search Options
+
+Search-time options are passed with each vector search request:
+
+| Option | Default | Description |
+|---|---|---|
+| `ivf.nprobe` | Automatic | Explicit number of IVF clusters to probe. When
omitted, paimon-vindex derives the width from the index, `top_k`, and filter
selectivity. |
+| `centroid.nprobe` | Automatic | Number of centroid shards to search per
row-ID range. Paimon chooses this width when omitted. Within each selected
shard, `ivf.nprobe` controls the IVF lists to search and `diskann.l_search`
controls the DiskANN graph search width. |
+| `ivf.max_initial_filter_expansion_factor` | Disabled | Positive integer
limiting filter-driven expansion of the initial automatic IVF probe width. A
factor of `1` disables initial filter expansion. Progressive retries may still
probe more clusters when fewer than `top_k` filtered results are found. |
+| `refine_factor` | List columns use `4` for a matrix query and `1` for a
single query vector. Disabled for single-vector columns. | Retrieves `top_k *
refine_factor` candidates per query vector and reranks them with the original
vectors stored in the Paimon table. For single-vector columns it is most useful
with compressed indexes such as `ivf-pq`, `ivf-sq`, and `ivf-rq`. |
+| `ivf_pq.batch_table_reuse` | `auto` | Distance-table reuse for native
batched IVF-PQ searches on single-vector columns. Accepts `auto`, `on`, or
`off`. |
+| `ivf_pq.batch_table_reuse.max_bytes` | 512 MiB | Positive long integer
limiting the memory used by IVF-PQ batch distance-table reuse. Search falls
back to direct table construction when the reusable tables exceed the budget. |
+| `diskann.l_search` | Automatic | paimon-vindex DiskANN graph candidate
width. The automatic value uses calibration when available, otherwise `max(100,
2 * top_k)`. |
+
+Use the same distance metric at build time and query time. Search options can
be passed per query,
+so you can use a larger `ivf.nprobe` or `diskann.l_search` for higher recall
queries and a smaller
+value for latency-sensitive queries. Do not set both in one query.
+
+`ivf.max_initial_filter_expansion_factor` applies only to automatic IVF search
and cannot be combined
+with `ivf.nprobe` or `diskann.l_search`. Lower factors reduce initial
filtered-search work but may
+reduce Recall@K compared with uncapped automatic search. Progressive expansion
occurs only when
+fewer than `top_k` valid results are returned; if the capped initial search
already fills `top_k`,
+probing stops.
+
+`refine_factor` also accepts the alias `rerank_factor` and hyphenated
spellings such as
+`refine-factor`. The four IVF indexes also accept `ivf.refine_factor`. Setting
`refine_factor=1`
+still performs the raw-vector rerank for the indexed candidates. Single-vector
columns skip
+reranking when the option is unset.
+List columns always score candidate rows against their complete embedding
lists.
+
+### Shard Search Concurrency
+
+The `global-index.thread-num` table option caps the number of index shards Java
+and Python can open and search concurrently for single and batch queries. The
+setting must be a positive integer and defaults to `32`. The number of splits
+also bounds concurrency. Set the option to `1` for serial shard searches.
+
+The setting applies to paimon-vindex and Lumina indexes. Parallel searches
+preserve score and row-ID tie ordering. Each shard can also use native search
+and I/O threads, so account for those threads and available memory when
choosing
+the value. Python raw-vector fallback uses table read parallelism.
+
## Drop Vector Index
<Tabs groupId="vector-drop">
diff --git a/docs/static/img/multimodal-vector-index-flow.svg
b/docs/static/img/multimodal-vector-index-flow.svg
new file mode 100644
index 0000000000..a4774a2d94
--- /dev/null
+++ b/docs/static/img/multimodal-vector-index-flow.svg
@@ -0,0 +1,68 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="780" height="374" viewBox="0 0
780 374" role="img" aria-labelledby="title desc">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<title id="title">From embeddings to matching rows</title>
+<desc id="desc">In a Data Evolution append table, a range-sharded index maps
embeddings to row IDs. Approximate nearest neighbor search finds top-K row IDs
and scores. Paimon uses the row IDs to read the requested table columns.</desc>
+<defs>
+ <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7"
markerHeight="7" orient="auto">
+ <path d="M0 0 L10 5 L0 10 Z" fill="#526277"/>
+ </marker>
+</defs>
+<rect x="1" y="1" width="778" height="372" rx="12" fill="#fff"
stroke="#d7dfeb" stroke-width="1.5"/>
+<g font-family="Arial, Helvetica, sans-serif" fill="#172b4d">
+ <text x="24" y="45" font-size="28" font-weight="700">From embeddings to
matching rows</text>
+ <text x="24" y="75" font-size="19" fill="#526277">Data Evolution append
table with range sharding</text>
+
+ <text x="24" y="112" font-size="20" font-weight="700">Build</text>
+ <rect x="24" y="125" width="320" height="90" rx="8" fill="#eaf2ff"
stroke="#d7dfeb"/>
+ <rect x="436" y="125" width="320" height="90" rx="8" fill="#f2ecfb"
stroke="#d7dfeb"/>
+ <g font-size="22" font-weight="700">
+ <text x="44" y="160" fill="#2463b4">Embedding column</text>
+ <text x="456" y="160" fill="#7046a4">Vector index shards</text>
+ </g>
+ <g font-size="19" fill="#526277">
+ <text x="44" y="189">Embeddings with row IDs</text>
+ <text x="456" y="189">Shards cover row-ID ranges</text>
+ </g>
+
+ <text x="24" y="252" font-size="20" font-weight="700">Search</text>
+ <rect x="24" y="270" width="162" height="78" rx="8" fill="#f5f7fb"
stroke="#d7dfeb"/>
+ <rect x="210" y="270" width="162" height="78" rx="8" fill="#f2ecfb"
stroke="#d7dfeb"/>
+ <rect x="402" y="270" width="162" height="78" rx="8" fill="#eaf2ff"
stroke="#d7dfeb"/>
+ <rect x="594" y="270" width="162" height="78" rx="8" fill="#e7f5f1"
stroke="#d7dfeb"/>
+ <g font-size="20" font-weight="700" text-anchor="middle">
+ <text x="105" y="316">Query vector</text>
+ <text x="291" y="304" fill="#7046a4">ANN search</text>
+ <text x="483" y="304" fill="#2463b4">Top-K matches</text>
+ <text x="675" y="304" fill="#14766b">Read rows</text>
+ </g>
+ <g font-size="17" fill="#526277" text-anchor="middle">
+ <text x="291" y="329">Probe index shards</text>
+ <text x="483" y="329">Scored row IDs</text>
+ <text x="675" y="329">Projected columns</text>
+ </g>
+</g>
+<g fill="none" stroke="#526277" stroke-width="2" stroke-linejoin="round"
marker-end="url(#arrow)">
+ <path d="M352 170 H426"/>
+ <path d="M596 222 V239 H291 V262"/>
+ <path d="M191 309 H205"/>
+ <path d="M378 309 H396"/>
+ <path d="M570 309 H588"/>
+</g>
+</svg>
diff --git a/docs/static/img/multimodal-vector-maxsim.svg
b/docs/static/img/multimodal-vector-maxsim.svg
new file mode 100644
index 0000000000..9aff0f926a
--- /dev/null
+++ b/docs/static/img/multimodal-vector-maxsim.svg
@@ -0,0 +1,60 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="780" height="356" viewBox="0 0
780 356" role="img" aria-labelledby="title desc">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<title id="title">MaxSim for one candidate row</title>
+<desc id="desc">The row stores embeddings [1, 0] and [0, 1]. The first query
vector [1, 0] has cosine similarities 1 and 0. The second query vector [0, 1]
has similarities 0 and 1. MaxSim sums the best match for each query vector, so
the row scores 2.</desc>
+<rect x="1" y="1" width="778" height="354" rx="12" fill="#fff"
stroke="#d7dfeb" stroke-width="1.5"/>
+<g font-family="Arial, Helvetica, sans-serif" fill="#172b4d">
+ <text x="24" y="45" font-size="28" font-weight="700">MaxSim for one
candidate row</text>
+ <text x="24" y="75" font-size="19" fill="#526277">Cosine similarities
against the two embeddings in the sample row with id 1</text>
+
+ <rect x="24" y="106" width="732" height="58" fill="#f5f7fb"/>
+ <rect x="223" y="164" width="171" height="52" fill="#f2ecfb"/>
+ <rect x="394" y="216" width="171" height="52" fill="#f2ecfb"/>
+ <rect x="565" y="164" width="191" height="104" fill="#e7f5f1"/>
+ <g fill="none" stroke="#d7dfeb">
+ <rect x="24" y="106" width="732" height="162"/>
+ <path d="M223 106 V268 M394 106 V268 M565 106 V268 M24 164 H756 M24 216
H756"/>
+ </g>
+
+ <g font-size="20" font-weight="700">
+ <text x="44" y="142">Query vector</text>
+ <g text-anchor="middle">
+ <text x="308.5" y="142">[1, 0]</text>
+ <text x="479.5" y="142">[0, 1]</text>
+ <text x="660.5" y="142">Best match</text>
+ </g>
+ </g>
+ <g font-size="22">
+ <text x="44" y="198">q₁ = [1, 0]</text>
+ <text x="44" y="250">q₂ = [0, 1]</text>
+ <g text-anchor="middle">
+ <text x="308.5" y="198" fill="#7046a4" font-weight="700">1</text>
+ <text x="479.5" y="198" fill="#526277">0</text>
+ <text x="308.5" y="250" fill="#526277">0</text>
+ <text x="479.5" y="250" fill="#7046a4" font-weight="700">1</text>
+ <text x="660.5" y="198" fill="#14766b" font-weight="700">1</text>
+ <text x="660.5" y="250" fill="#14766b" font-weight="700">1</text>
+ </g>
+ </g>
+
+ <rect x="24" y="292" width="732" height="42" rx="8" fill="#e7f5f1"/>
+ <text x="44" y="320" font-size="22" font-weight="700" fill="#14766b">MaxSim
score = 1 + 1 = 2</text>
+</g>
+</svg>