Repository navigation
[fix](inverted index) Exclude MoW light deletes from BM25 statistics - #69403
Open
Authorlove wants to merge 1 commit into
Open
Authorlove wants to merge 1 commit into
Authorlove wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Authorlove
force-pushed
the
fix/bm25-visible-statistics
branch
from
October 21, 2026 12:52
b2ae44e to
53efe99
Compare
### What problem does this PR solve? Issue Number: None Related PR: apache#69352, apache#69438, apache#69403 Problem Summary: MoW light deletes filter rows through versioned DELETE predicates, but BM25 statistics only excluded delete-bitmap and delete-sign rows. Reuse DeleteHandler with the captured read version and historical column identities to collect the additional hidden row IDs. Read only predicate columns in bounded batches and merge disjoint, tracked row-ID lists into the existing statistics path. Keep the upstream tablet sharing, per-scanner caches and norms-based avgdl. ### Release note Correct BM25 statistics after merge-on-write light deletes without waiting for compaction. ### Check List (For Author) - Test: 93 selected ASAN tests passed, including three real-segment predicate tests. Full-master SQL passed V2/V3 with phrase true/false and SNII with phrase true, including mutation phases and forced scanner splitting. Existing parallel scan and replica-statistics suites passed. The unfixed query path fails the new regression's initial score comparison. Format, hygiene and changed-line source and test clang-tidy passed. - Behavior changed: Yes. Light-deleted rows no longer affect MoW BM25 statistics. - Does this need documentation: No new configuration or syntax.
Authorlove
force-pushed
the
fix/bm25-visible-statistics
branch
from
November 2, 2026 02:24
53efe99 to
94bd985
Compare
Authorlove
marked this pull request as ready for review
November 2, 2026 07:55
Authorlove
requested review from
airborne12,
csun5285 and
eldenmoon
as code owners
November 2, 2026 07:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: None
Related PR: #69352, #69438
MoW light deletes use versioned DELETE predicates. The storage reader filters their rows, but BM25 collection statistics only exclude delete-bitmap and delete-sign rows. The same visible documents therefore score differently from an independently loaded MoW table before compaction.
Extend the existing tablet-wide statistics collection with the captured DELETE predicates. Reuse DeleteHandler for current and historical column identities, compound/NULL predicate semantics and the query/rowset version boundaries. Read only the referenced columns in bounded batches and union filtered row IDs with the existing hidden set. The existing document-count, term-frequency and norms-sum corrections then apply unchanged to CLucene and SNII, including prefix expansion.
This keeps the existing shared-statistics mechanism, per-scanner derived caches and MoW norms-based avgdl. It adds no exact-length cache or raw-text tokenization. A newer insert is not hidden by an older DELETE. Scans with no DELETE predicates require no additional column reads.
Scope: MoW with its normal delete bitmap. DUP/MOR tables and the independent skip_delete_sign/show_hidden_columns issue are outside this change. DUP currently uses exact token totals, so extending its visibility statistics requires a separate decision about preserving that scoring contract; it must not silently switch to norms only while predicates exist.
Release note
Correct BM25 statistics on merge-on-write tables after light deletes, without waiting for compaction.
Check List (For Author)
Cost and remaining scope
The additional work reads the predicate columns of segments to which a captured light-delete predicate applies. It runs once per tablet through the existing holder. Added row-ID arrays use DorisVector and are disjoint from bitmap/sign rows before a linear merge. There is no new permanent cache, but query work and temporary memory grow with affected stored rows; no production performance claim is made.