-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Use doc values skipper for _tsid in synthetic _id postings #138568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
95c83de
Use doc values skipper for _tsid in synthetic _id postings
tlrx bfc7c61
Update docs/changelog/138568.yaml
tlrx 0293a40
Merge branch 'main' into 2025/11/25/ES-13604
tlrx 5000d9f
feedback
tlrx 848d819
Merge branch 'main' into 2025/11/25/ES-13604
tlrx 82a0652
Merge remote-tracking branch 'tlrx/2025/11/25/ES-13604' into 2025/11/…
tlrx 9ff33a7
revert
tlrx dc10a6e
Merge branch 'main' into 2025/11/25/ES-13604
tlrx b3fc3b9
min
tlrx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 138568 | ||
| summary: Use doc values skipper for `_tsid` in synthetic `_id` postings | ||
| area: TSDB | ||
| type: enhancement | ||
| issues: [] |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my understanding, if we don't find the
tsIdOrdat level 0, this will returnNO_MORE_DOCS? I think that I might be missing something here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the ordinal is not found in the first level 0, then it skips to the next levels until it finds a level that includes the ordinal or exhaust the iterator, in which case the Javadoc indicates that
minDocsreturnsNO_MORE_DOCS.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that a
DocValuesSkipperis kind of a skip list on top of docs values blocks of data.If that helps, here is a representation of such skipper levels:
For example, when looking for
tsIdOrd == 9theadvance(min, max)method executes:minValue: 0, maxValue: 0, [minDocID: 0, maxDocID: 31]has max value0below9so we can skip tomaxDocID + 1 = 321which isminValue: 0, maxValue: 7, [minDocID: 0, maxDocID: 718]which also has a max value7 < 9so we can in fact skip tomaxDocID + 1 = 718 + 1 = 7192has a max value of64so we cannot skip more0is nowminValue: 8, maxValue: 8, [minDocID: 719, maxDocID: 765], with max value of8we can skip all docs until765 +11, which isminValue: 8, maxValue: 15, [minDocID: 719, maxDocID: 1440]and has max value of15, sotsIdOrd == 9is between docs ids[766, 1440]minDocs(0) == 766I hope it helps. It took me some time to understand all of this 🫠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation, this makes sense 👍