Skip to content

perf(scan): prune index manifest entries - #703

Merged
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:scan-index-prune
Aug 10, 2026
Merged

perf(scan): prune index manifest entries#703
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:scan-index-prune

Conversation

@QuakeWang

@QuakeWang QuakeWang commented Aug 10, 2026

Copy link
Copy Markdown
Member

Purpose

Scan planning retained index-manifest entries that could not affect the query, including DELETE entries, deletion vectors from unselected partitions, and sorted global indexes unrelated to predicate fields. These entries were ignored later but still increased planning CPU and memory usage.

Brief change log

  • Retain only live entries required by active index consumers.
  • Apply partition pruning to sorted global indexes and deletion vectors.
  • Select sorted indexes by predicate field IDs, including extra fields.
  • Preserve fail-loud validation for retained sorted-index candidates and entries whose field relevance cannot be determined.

Tests

  • cargo fmt --all -- --check
  • cargo clippy --locked --all-targets --workspace --features fulltext,vortex -- -D warnings
  • cargo test --locked -p paimon --all-targets --features fulltext,vortex
  • cargo test -p paimon-datafusion --test procedures test_create_global_index

API and Format

Documentation

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
// Keep malformed entries so the scanner can preserve fail-loud validation.
return Ok(true);
};
Ok(predicate_field_ids.contains(&global_index.index_field_id)

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.

Malformed index_meta for an unrelated sorted index is pruned before validation, so it no longer fails loudly as described in the PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@XiaoHongbo-Hope Good catch. This is intentional: unrelated indexes are pruned before index_meta validation, matching Java. I've updated the PR description to clarify the fail-loud scope.

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 3577e28 into apache:main Aug 10, 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.

3 participants