Skip to content

fix(vindex): avoid full index reads during refine - #708

Merged
jerry-024 merged 2 commits into
apache:mainfrom
jerry-024:fix/vindex-refine-metric-full-read
Aug 14, 2026
Merged

fix(vindex): avoid full index reads during refine#708
jerry-024 merged 2 commits into
apache:mainfrom
jerry-024:fix/vindex-refine-metric-full-read

Conversation

@jerry-024

@jerry-024 jerry-024 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

During vector refine and raw reranking, resolve_raw_vector_metric read the entire Vindex file only to obtain the metric. For a 1.95 GB index, this still reconstructed the full file from local-cache blocks and copied it again, making refine slow even on a cache hit.

Brief change log

  • Resolve the Vindex metric directly from global-index manifest metadata when the metric is present.
  • Keep compatibility with Java and legacy indexes whose metadata is empty by range-reading at most the 256-byte Vindex header.
  • Pass the returned Bytes directly to the Vindex reader, removing the additional to_vec copy.
  • Preserve the underlying error source for header reader failures.

Tests

  • Added coverage proving manifest metadata resolves the metric without an index file read.
  • Added coverage for the Java and legacy empty-metadata header fallback.
  • cargo +1.97.0 test -p paimon test_resolve_raw_vector_metric -- --nocapture
  • cargo +1.97.0 clippy -p paimon --lib -- -D warnings
  • cargo +1.97.0 fmt --all -- --check

API and Format

No API or storage-format changes. Existing Java and legacy Vindex files remain compatible through the bounded header fallback.

Documentation

No documentation changes are required.

@jerry-024 jerry-024 changed the title fix(vindex): avoid full index read for refine metric fix(vindex): avoid full index reads during refine Aug 14, 2026

@QuakeWang QuakeWang 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.

LGTM

@jerry-024
jerry-024 merged commit 182934c into apache:main Aug 14, 2026
13 checks passed
@jerry-024
jerry-024 deleted the fix/vindex-refine-metric-full-read branch August 14, 2026 03:23
jerry-024 added a commit to jerry-024/paimon-rust that referenced this pull request Aug 14, 2026
…timing

* upstream/main:
  fix(vindex): avoid full index reads during refine (apache#708)
  feat(vindex): build indexes from streamed data splits (apache#707)
  feat: support deletion vector merge-on-read (apache#706)

# Conflicts:
#	crates/paimon/src/table/vector_search_builder.rs
#	crates/paimon/src/vindex/mod.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