Skip to content

ivf: Retry only incomplete queries in automatic batch search - #72

Merged
jerry-024 merged 2 commits into
apache:mainfrom
shyjsarah:codex/ivf-batch-partial-retry
Aug 12, 2026
Merged

ivf: Retry only incomplete queries in automatic batch search#72
jerry-024 merged 2 commits into
apache:mainfrom
shyjsarah:codex/ivf-batch-partial-retry

Conversation

@shyjsarah

@shyjsarah shyjsarah commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Purpose

Automatic IVF batch search currently doubles nprobe for the entire batch whenever any query returns fewer than the required number of results. A small number of difficult queries can therefore force already-complete queries to be searched repeatedly at every expansion round.

Changes

  • Track incomplete queries independently during automatic IVF batch expansion.
  • Pack and retry only incomplete queries in later rounds.
  • Scatter retried results back to their original positions in the batch output.
  • Apply the behavior to filtered and unfiltered IVF Flat, IVF SQ, IVF PQ, and IVF RQ batch search paths.
  • Keep explicit/fixed nprobe searches as one unchanged full-batch call.
  • Preserve the no-copy fast path when the first automatic-search round completes the batch.

This change intentionally does not reuse previously scanned IVF lists. Retried queries still search 0..nprobe; incremental new-list-only scanning is handled by the follow-up PR.

Tests

  • cargo fmt --all -- --check
  • cargo test --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • mvn -f java/pom.xml test
  • JNI release build and native validation, panic-boundary, and handle-safety tests on macOS

Automatic IVF batch search previously expanded nprobe for the entire
batch whenever any query returned fewer than the required results.

Track incomplete queries per round, retry only those queries, and
scatter their results back to the original batch order. Explicit IVF
nprobe searches remain a single unchanged batch call.

Incremental reuse of previously probed lists is intentionally left to
a follow-up change.
@shyjsarah
shyjsarah force-pushed the codex/ivf-batch-partial-retry branch from 534857b to 8bab74a Compare August 10, 2026 05:42
@shyjsarah shyjsarah changed the title ivf: Retry only incomplete queries in automatic batch search ivf: incrementally scan expanded batch probe ranges Aug 10, 2026
@shyjsarah
shyjsarah force-pushed the codex/ivf-batch-partial-retry branch from 8bab74a to 534857b Compare August 10, 2026 05:45
@shyjsarah shyjsarah changed the title ivf: incrementally scan expanded batch probe ranges ivf: Retry only incomplete queries in automatic batch search Aug 10, 2026
Comment thread core/src/index.rs Outdated
Comment thread core/src/index.rs

@jerry-024 jerry-024 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@jerry-024
jerry-024 merged commit b36f8a9 into apache:main Aug 12, 2026
9 checks passed
jerry-024 added a commit to jerry-024/paimon-vector-index that referenced this pull request Aug 12, 2026
* upstream/main:
  ivf: incrementally scan expanded batch probe ranges (apache#73)
  ivf: Retry only incomplete queries in automatic batch search (apache#72)

# Conflicts:
#	core/src/ivfpq.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants