Skip to content

CO: Support RLE with Zstandard - #67

Open
Smyatkin-Maxim wants to merge 2 commits into
REL_2_STABLEfrom
zstd_rle_support
Open

Smyatkin-Maxim wants to merge 2 commits into
REL_2_STABLEfrom
zstd_rle_support

Conversation

@Smyatkin-Maxim

Copy link
Copy Markdown

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.

@leborchuk leborchuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OMG, let's support it here too. LGTM

Comment thread src/include/storage/gp_compress.h Outdated

#define RLE_MAX_LEVEL (4)

#endif /* HAVE_LIBZSTD */

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe

Suggested change
#endif /* HAVE_LIBZSTD */
#endif /* USE_ZSTD */

Comment thread src/include/storage/gp_compress.h
@Smyatkin-Maxim

Smyatkin-Maxim commented Sep 11, 2026

Copy link
Copy Markdown
Author

Tests are failing due to this cherry-pick, will fix.

@Smyatkin-Maxim
Smyatkin-Maxim force-pushed the zstd_rle_support branch 2 times, most recently from dc33675 to 52c853d Compare September 14, 2026 11:27
soumyadeep2007 and others added 2 commits September 14, 2026 16:45
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.
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.

4 participants