Skip to content

perf(vector-search): execute PK-vector leaves concurrently - #647

Merged
JingsongLi merged 1 commit into
apache:mainfrom
JunRuiLee:perf/pk-vector-concurrent-ann
Aug 4, 2026
Merged

perf(vector-search): execute PK-vector leaves concurrently#647
JingsongLi merged 1 commit into
apache:mainfrom
JunRuiLee:perf/pk-vector-concurrent-ann

Conversation

@JunRuiLee

@JunRuiLee JunRuiLee commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Purpose

This is PR 3/3 of the stacked vector-search performance series. The preceding
PRs #645 and #646 have been merged into main, and this branch has been rebased
onto the current main so the PR diff is isolated to concurrent PK-vector leaf
execution.

PK-vector bucket search previously did not execute all independent search work
concurrently. ANN segments and exact-fallback files were scheduled in separate
phases, and ANN CPU work could run inline or serially despite a configured
global-index.thread-num greater than one.

This change represents ANN segments and uncovered exact files as independent
leaves, executes them through one bounded concurrency window, and moves blocking
index searches to the shared process-level executor.

Brief change log

  • Combine ANN-segment and exact-file work into one concurrent bucket leaf plan.
  • Load each ANN segment lazily inside its leaf instead of preloading every index.
  • Keep vindex segments range-backed on the caller runtime and Lumina segments
    buffered.
  • Share the configured range-read budget across lazy vindex segment readers.
  • Run blocking ANN and regular global vector-index searches on the dedicated
    process-level executor.
  • Apply one per-query concurrency budget across buckets, ANN segments, and exact
    fallback files.
  • Apply a shared process-level budget across concurrent queries while keeping
    its logical capacity separate from the executor's physical OS-thread cap.
  • Drain submitted leaves and report errors deterministically by submission order.
  • Preserve deterministic Top-K merging regardless of leaf completion order.
  • Validate global-index.thread-num against Tokio's semaphore limit.
  • Keep permits owned by started ANN and regular global vector-index work after
    caller cancellation without blocking Tokio runtime threads.

Tests

  • cargo check -p paimon
  • cargo test -p paimon --lib — 2142 passed, 1 ignored
  • cargo test -p paimon --test pk_vector_baseline_test — 8 passed
  • cargo test -p paimon --test pk_vector_batch_test — 10 passed
  • cargo test -p paimon --test pk_vector_java_fixture_test — 1 passed
  • cargo fmt --all -- --check
  • git diff --check

API and Format

No public API or storage-format changes. The existing
global-index.thread-num option and default value are retained.

Documentation

No user-facing documentation changes are required. The concurrency and execution
changes are internal to vector-index reads.

@JunRuiLee
JunRuiLee force-pushed the perf/pk-vector-concurrent-ann branch from 084a450 to b2dd1fd Compare August 4, 2026 14:11
@JunRuiLee
JunRuiLee marked this pull request as ready for review August 4, 2026 14:13

@JingsongLi JingsongLi 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

@JingsongLi
JingsongLi merged commit 7d12424 into apache:main Aug 4, 2026
13 checks passed
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