lance-format / lance-format/lance
Migrate ANNIvfPartitionExec to native DataFusion partitions
@wjones127 is already working on this.
Since Jun 4, 2026.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
ANNIvfPartitionExec outputs a single partition and manages parallelism internally via tokio::spawn per delta index and spawn_cpu for partition searches. It should be migrated to output N partitions (where N = target_partitions).
Each partition should pull nprobe work from a shared queue rather than using a static upfront split, to handle uneven per-partition search costs and avoid stragglers. The existing early-stop AtomicUsize coordination (num_results_found) is acceptable small shared state — whichever partition updates the counter can stop new work from being pulled from the queue, regardless of which partition would have pulled next.
A TopK merge node is needed above ANNIvfPartitionExec to combine per-partition results. This can either be a new custom exec or use SortPreservingMergeExec + GlobalLimitExec if those give correct distance-ranked top-K semantics.
The tokio::spawn-per-delta fan-out should be replaced by partition-level execution.
Depends on #7081 (EnforceDistribution) to handle exchange nodes automatically.
Part of the migration tracked in #6967.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.