Skip to content

feat(rust)!: expose vector query partition parallelism - #5054

Merged
Xuanwo merged 3 commits into
lancedb:mainfrom
belovaf:codex/vector-query-parallelism
Dec 1, 2026
Merged

Xuanwo merged 3 commits into
lancedb:mainfrom
belovaf:codex/vector-query-parallelism

Conversation

@belovaf

@belovaf belovaf commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: Callers that initialize VectorQueryRequest with an exhaustive struct literal must add query_parallelism: None to preserve automatic scheduling.

Expose Lance's existing IVF partition-search concurrency control through the Rust VectorQuery::query_parallelism builder. This lets callers override the automatic sequential policy used by flat sub-indexes without changing the probe budget or bypassing LanceDB's query API.

The setting is optional, so existing queries keep their behavior. Accepted values match Lance: 0 for automatic selection, -1 for the CPU pool, 1 for sequential execution, and positive limits for partition-parallel execution. Values below -1 are rejected, including requests constructed directly through public fields.

An ordinary Embedded IVF query applies the setting within each index segment. Separate segments may run concurrently. If the selected plan uses shared batch IVF, an explicit value returns NotSupported because its scheduler controls its own load and scoring windows. Leaving it unset preserves batch execution. Enterprise also returns NotSupported before sending an explicitly configured query because its request contract does not support this setting. Namespace queries with explicit settings route locally. The existing ordering, scan-order and RTE checks remain in effect.

The tests cover single-segment IVF values and result equivalence, two-vector Embedded batch execution with the option unset and rejected explicit settings, Enterprise default requests and rejection before HTTP for explicit settings, direct invalid requests, and namespace/RTE routing. The Rust API and vector-search guide document the per-segment scope.

Lance already exposes this control (introduced in lance-format/lance#6475); this PR exposes it at the LanceDB Rust layer.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added enhancement New feature or request Rust Rust related issues labels Nov 14, 2026
lancedb-gatekeeper[bot]

This comment was marked as outdated.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 14, 2026
Xuanwo
Xuanwo previously requested changes Nov 27, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query_parallelism(1) works per index segment on an ordinary Embedded IVF query. Adding a second query vector can select ANNIvfBatchExec, which accepts the setting but still sizes its load and scoring windows from the CPU pool. Please either honor the setting there or return NotSupported when it is explicitly supplied on that plan. Batch scheduler

For Enterprise, I verified that the SDK sends the field over loopback HTTP. The server request model I inspected does not consume it. Please gate explicit settings on backend support and return NotSupported where the requested scheduling cannot be provided. Test explicit versus unset for both paths, and document the per-segment scope. When rebasing the namespace routing predicate, please retain main’s ordering and scan-order checks.

@belovaf
belovaf force-pushed the codex/vector-query-parallelism branch from 6652cd1 to 1d8ec79 Compare November 27, 2026 14:44
@lancedb-gatekeeper lancedb-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 27, 2026

@lancedb-gatekeeper lancedb-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

The revision addresses the batch IVF and Enterprise concerns by rejecting explicit settings where scheduling cannot be honored. Ordinary Embedded IVF applies the option per index segment, while unset requests preserve existing scheduling. Result-equivalence and backend-rejection tests pass, and namespace ordering and RTE guards remain intact.

Please mark this PR with the breaking-change label: lancedb::query::VectorQueryRequest adds query_parallelism, so Rust callers using exhaustive struct literals must initialize the new field.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 27, 2026
@Xuanwo
Xuanwo dismissed their stale review November 27, 2026 15:16

At 1d8ec79, the planner rejects explicit query_parallelism on shared batch IVF and Enterprise. The default routes and namespace ordering checks are preserved. I verified these changes in source.

Xuanwo
Xuanwo previously requested changes Nov 27, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use feat(rust)!: in the PR title and start the description with the migration note below. This gives Rust callers a direct fix for the missing-field compiler error when upgrading from v0.41.0.

BREAKING CHANGE: Callers that initialize VectorQueryRequest with an exhaustive struct literal must add query_parallelism: None to preserve automatic scheduling.

@belovaf belovaf changed the title feat(rust): expose vector query partition parallelism feat(rust)!: expose vector query partition parallelism Nov 27, 2026
@github-actions github-actions Bot added the breaking-change A breaking change in our public APIs label Nov 27, 2026
@lancedb-gatekeeper lancedb-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 27, 2026
@Xuanwo
Xuanwo dismissed their stale review November 27, 2026 17:02

The title now marks the breaking change and the description explains how exhaustive VectorQueryRequest literals can preserve automatic scheduling.

@lancedb-gatekeeper lancedb-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 1, 2026
@Xuanwo
Xuanwo merged commit bd37cb0 into lancedb:main Dec 1, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change A breaking change in our public APIs enhancement New feature or request Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants