Skip to content
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

Add levels to DocValues skipper index #13563

Merged
merged 12 commits into from
Jul 19, 2024
Merged

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Jul 11, 2024

Currently the DocValues skipper index collects the stats every 4096 documents that allow implementors to used them to decide if they want to process those documents or they can be skipped. The idea of adding levels is to be able to skip several of those block (called intervals in the code) in one step by collecting the stats of the blocks and adding them to the index.

This implementation collects the stats of 8 of those intervals. For the first level, the first interval gets a new level with the stats from the next 8 intervals, then the 9th interval gets another level with the stats from the following 8 intervals and so on. For the second level, the first interval gets a new level with the stats from the next 8 level1 intervals, which is the same as the stats from the first 64 level 0 intervals and so on.

I run some basic experiments and I must say I did not see much change on the performance, still it feels the right thing to do, therefore I opened this PR.

relates #11432

@iverase iverase requested a review from jpountz July 11, 2024 14:44
Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

It makes sense to me overall.

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

Thanks, it does indeed make more sense to me to expose all levels. I left a few comments.

+ skipper.minDocID(level)
+ " < "
+ doc);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What was wrong with having this check on every level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current condition is skipper.minDocID(level) < doc where the doc is the provided doc on advance. So the provided doc needs to be lower than or equal to the minDocID not to trigger the error. I

It checks we have advance to the closer interval forward. This check is strange as it is only valid for implementations with exact bounds and it is clearly not valid for levels above 0.

Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense.

+ skipper.minDocID(level)
+ " < "
+ doc);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense.

@iverase iverase merged commit 9f991ed into apache:main Jul 19, 2024
3 checks passed
@iverase iverase deleted the skipperLevels branch July 19, 2024 09:20
@iverase iverase added this to the 10.0.0 milestone Jul 24, 2024
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