mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
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 https://github.com/lance-format/lance/pull/6475); this PR exposes it at the LanceDB Rust layer. --------- Co-authored-by: Xuanwo <github@xuanwo.io>