Skip to content

Vector Search Benchmark

CLI name: vector_search - use benchbox run --benchmark vector_search

Query templates: every Vector Search query

The Vector Search benchmark tests similarity-search performance across OLAP databases that support array/vector operations. It covers exact kNN, filtered kNN, and approximate (ANN) search over synthetic embedding data.

Overview

PropertyValue
Total Queries6
Data SourceSynthetic embeddings (reproducible)
Default Dimensions128
Primary TargetDuckDB (array_cosine_similarity, array_distance)
Dialect Variantspgvector, ClickHouse, Snowflake, StarRocks, Doris

Query Coverage

ID / AreaDescription
Exact kNN (cosine)Exact k-nearest neighbors by cosine similarity
Exact kNN (L2)Exact k-nearest neighbors by Euclidean distance
Filtered kNNMetadata predicate + distance ordering
Large-k ground truthGround-truth generation for recall evaluation
ANN searchSame SQL form; relies on HNSW index from load phase
Multi-category filteredMulti-predicate filtered similarity search

Scale Factors

ScaleVectorsNotes
0.01~10 KQuick smoke test
0.1~100 KDev / CI
1.0~1 MDefault - representative workload

Usage

Terminal window
benchbox run --platform duckdb --benchmark vector_search --scale 1.0
benchbox run --platform duckdb --benchmark vector_search --scale 0.1 \
--benchmark-option dimensions=64
benchbox run --platform duckdb --benchmark vector_search --scale 1.0 \
--benchmark-option dimensions=768

The first command uses the defaults: 128-dimensional vectors at SF=1 (about 1M vectors). The second uses smaller vectors for quick tests, and the third uses higher-dimensional embeddings.

Benchmark Options

OptionDefaultDescription
dimensions128Embedding vector dimensionality

Platform Support

Vector Search targets engines with native array / vector operations:

PlatformSupportNotes
DuckDBPrimaryNative array_cosine_similarity / array_distance
PostgreSQLVia pgvectorRequires pgvector extension
ClickHouseYesDialect variant uses ClickHouse vector ops
SnowflakeYesDialect variant uses Snowflake vector ops
StarRocksYesDialect variant uses StarRocks vector distance fns
DorisYesDialect variant uses Doris array distance fns

Notes

  • Synthetic data is reproducible - the same seed produces identical embeddings across runs.
  • ANN queries reuse kNN SQL but rely on an HNSW (or equivalent) index being built during the load phase.
  • Recall is evaluated against the large-k ground-truth query; compare approximate vs. exact results after a run.

See Also