CO: Support RLE with Zstandard - #67
Open
Smyatkin-Maxim wants to merge 1 commit into
Open
Conversation
This is a backport of 7X PR: #17147, with conflicts resolved:
(1) USE_ZSTD is replaced with HAVE_ZSTD
(2) Test changes:
using ao_column -> with (appendonly=true, orientation=column)
ALTER TABLE ALTER COLUMN ENCODING is not supported on 6X, so the
test is taken out.
Original commit message follows:
This addresses #12721.
Zstandard is superior to Zlib in terms of both compression speed and
disk footprint. So offer users the ability to rely on it. To enjoy the
benefits of Zstandard compression in column-oriented tables users can
create tables with compresslevel=5|6.
Example:
create table co_rle_zstd(i int encoding(compresstype=rle_type,
compresslevel=5)) using ao_column;
convert existing tables to the new compress levels as well.
Compresslevels 5 and 6 invoke zstd compression with zstd levels 1 and 3
respectively. Since zstd level 3 is the default and the recommended
level, compresslevel = 6 should cover most cases and is highly
encouraged.
Notes:
(1) Since zstd level = 1 can readily beat zlib level = 9 in terms of
speed (and disk footprint), it can easily fit into our scheme for
compresslevels (lower implies higher speed)
(2) More levels can be provided in the future for zstd, as per demand.
leborchuk
approved these changes
Sep 11, 2026
leborchuk
left a comment
There was a problem hiding this comment.
OMG, let's support it here too. LGTM
Vlasdislav
reviewed
Sep 11, 2026
|
|
||
| #define RLE_MAX_LEVEL (4) | ||
|
|
||
| #endif /* HAVE_LIBZSTD */ |
There was a problem hiding this comment.
Maybe
Suggested change
| #endif /* HAVE_LIBZSTD */ | |
| #endif /* USE_ZSTD */ |
| uint8 *sourceData, | ||
| int32 sourceLen, | ||
| uint8 *compressedBuffer, | ||
| int32 compressedBufferWithOverrrunLen, |
There was a problem hiding this comment.
Typo. rrr -> rr
Suggested change
| int32 compressedBufferWithOverrunLen, |
Author
|
Tests are failing due to this cherry-pick, will fix. |
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.
When we gonna upgrade from gp6 to cloudberry we gonna need to be able to read those zstd encoded RLEs, so I've cherry-picked the original commit from gp6 here.