Skip to content

Vector Search Q6

Vector Search benchmark · all Vector Search queries

Representative SQL

Rendered in the benchmark’s native SQL with default parameters (no dialect translation available).

SELECT
v.id,
ARRAY_COSINE_SIMILARITY(v.embedding, q.query_vector) AS similarity
FROM vectors AS v
CROSS JOIN (
SELECT
query_vector
FROM vector_queries
WHERE
query_id = 2
) AS q
WHERE
v.category IN ('category_01', 'category_02', 'category_03')
ORDER BY
similarity DESC
LIMIT 20

Representative DataFrame

No DataFrame implementation is registered for this query.

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import VectorSearch
bench = VectorSearch(scale_factor=0.01) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['Q6'])

Source

Query text: benchbox/core/vector_search/queries.py