Skip to content

feat: split read only payload index - #8858

Merged
generall merged 3 commits into
devfrom
feat/split-read-only-payload-index
Apr 30, 2026
Merged

generall merged 3 commits into
devfrom
feat/split-read-only-payload-index

Conversation

@dancixx

@dancixx dancixx commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --workspace --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dancixx
dancixx marked this pull request as ready for review April 30, 2026 16:28
@dancixx
dancixx requested a review from generall April 30, 2026 16:28
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f4db80b-117a-4543-9891-e851b06ad67d

📥 Commits

Reviewing files that changed from the base of the PR and between 4838092 and 9f69f48.

📒 Files selected for processing (22)
  • lib/segment/benches/boolean_filtering.rs
  • lib/segment/benches/conditional_search.rs
  • lib/segment/benches/range_filtering.rs
  • lib/segment/src/index/hnsw_index/hnsw.rs
  • lib/segment/src/index/payload_index_base.rs
  • lib/segment/src/index/plain_payload_index.rs
  • lib/segment/src/index/plain_vector_index.rs
  • lib/segment/src/index/sparse_index/sparse_vector_index.rs
  • lib/segment/src/index/struct_payload_index.rs
  • lib/segment/src/segment/entry.rs
  • lib/segment/src/segment/facet.rs
  • lib/segment/src/segment/order_by.rs
  • lib/segment/src/segment/sampling.rs
  • lib/segment/src/segment/scroll.rs
  • lib/segment/src/segment/segment_ops.rs
  • lib/segment/src/segment_constructor/segment_builder.rs
  • lib/segment/tests/integration/exact_search_test.rs
  • lib/segment/tests/integration/filtering_context_check.rs
  • lib/segment/tests/integration/filtrable_hnsw_test.rs
  • lib/segment/tests/integration/nested_filtering_test.rs
  • lib/segment/tests/integration/payload_index_test.rs
  • lib/segment/tests/integration/sparse_vector_index_search_tests.rs

📝 Walkthrough

Walkthrough

This PR refactors the payload index abstraction by splitting PayloadIndex into two traits. A new PayloadIndexRead trait is introduced to contain all read-only operations (indexed field introspection, cardinality estimation, query execution, payload-block iteration, and payload retrieval). The existing PayloadIndex trait is updated to extend PayloadIndexRead and retain only mutating operations (index build/apply, set/drop index rules, and payload mutations). Trait implementations in PlainPayloadIndex and StructPayloadIndex are refactored accordingly to split read and write responsibilities. Imports across 15+ files are updated to reference the new read-only trait where appropriate.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • qdrant/qdrant#8766 — Modifies the payload-block iteration API with for_each_payload_block callback pattern, which is now incorporated into the PayloadIndexRead trait.

Suggested reviewers

  • generall
  • xzfc
  • timvisee
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is a standard contribution checklist and does not actually describe what the changes do or why they are needed. Add an explanation of what the payload index split achieves and why this refactoring improves the codebase.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: splitting the payload index into read-only and mutable components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/split-read-only-payload-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

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