Repository navigation
Optimize postings list compression with simdcomp - #92871
Conversation
|
Workflow [PR], commit [5d4d694] Summary: ❌
|
6878913 to
7c029d1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
| @@ -145,6 +146,8 @@ struct PostingsSerialization | |||
| EmbeddedPostings = 1ULL << 1, | |||
| /// If unset, the number of blocks is stored as an additional VarUInt. | |||
| SingleBlock = 1ULL << 2, | |||
| /// If set, the posting lists are encoded and stored in a compressed format on disk. | |||
| CompressedPostings = 1ULL << 3, | |||
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
f0c9adf to
be6266d
Compare
|
Hi @fastio I have seen your latest changes and I am wondering why did you moved the tests to integration. If the problems is the randomization we solve that by assigning a setting value in the beginning of the test. But moving the test to integration adds a level of complexity that we don't want in this case. If we don't know where is the real problem yet, then moving the test to integration is not a solution, but a way to hide the problem. |
Hi @Ergus, I’m very sorry about this. I understand your concern, and I fully agree with your point. The query I moved to the integration tests (it queries system tables to compute the data size) is not the one that triggers the index file issue. However, if we keep it in place, the randomized settings frequently cause the data size validation SQL to fail. That said, you are absolutely right that moving it away could potentially mask the real problem. To address this properly, I split the original test into two parts:
|
|
Hi @fastio
Not need to apologize at all!! ;)
If randomization is an issue, the least we can do is to investigate which settings cause the issue. Then, hardcode their values in the test header preferably with a comment about why the value was chosen. The best approach for tests is always KISS. And integration tests are intended to be used for end-to-end tests that cannot be expressed with a single .sql. They use an infrastructure much harder to use for debugging and reproduce locally. |
Hi @Ergus , Thank you for the feedback, it's very helpful. This PR currently has two issues:
I'm currently adjusting the test cases for this PR. I'll request your review again once the changes are ready. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Hi @fastio I still see the data size mismatch issue failing in fastest. I thought this was already fixed |
Hi @Ergus, Thanks for the feedback. I looked into the fast test failure this time, and it was caused by the latest change (2f558ce) switching the table name from table to 'table', which made the generated SQL output differ from the reference. The main issue is that the table name doesn’t match, not that the data size is mismatched. We just need a small fix to align the table name — I can take care of it. |
00ef573 to
2f558ce
Compare
|
Thank you very much @fastio !! hoping to help with your next contribution very soon!!! |
e3fb348
Hi @Ergus , Thanks a lot! Really appreciate your help. I’m almost ready with the next PR, which should significantly improve query performance for compressed posting lists. And thanks as well to @rschu1ze for the help. |
|
I'm just a random peasant reviewing PRs as I hapen to see them :-) |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Optimize postings list compression with simdcomp.
Documentation entry for user-facing changes
This PR introduces SIMD-accelerated compression for postings lists using
[simdcomp] on x86_64 and StreamVByte as a generic fallback.
Depending on the available SIMD ISA, postings are compressed in fixed-size
blocks with simdcomp, and the remaining tail is encoded with StreamVByte.
By using SIMD-friendly integer compression, we can reduce the storage
footprint and improve scan performance for inverted indexes, especially
for large postings lists.
https://github.com/fast-pack/simdcomp
This is a re-implementation of this PR #89612. With the release of Inverted Index V3, it needs to be reworked accordingly.
How to use ?
Added a parameter enable_postings_compression when creating the index.
A Simple Test
Here is my testing procedure:
Inverted Index Data Size / Raw Data Size
In both scenarios—with posting list compression enabled and disabled—we insert the same 200,000,000 log rows into the test table. We then compute the ratio between the inverted index data size and the raw log data size (excluding the inverted index data).
Merge
Insert
Query
Version info
26.1.1.770