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

feat: enable zstd compression and encodings in merge tree data part #3380

Merged
merged 2 commits into from Feb 27, 2024

Conversation

v0y4g3r
Copy link
Contributor

@v0y4g3r v0y4g3r commented Feb 26, 2024

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR enables ZSTD compression and column-wise encodings in DataPart in merge tree memtable to save memory up to 90%.

Total memory consumption for freezing a DataBuffer with 10M rows to DataPart and iterating all batches from that DataPart:

image

The results

  • Elapsed time means the total time for freezingDataBuffer with 10 million rows to DataPart and iterating that DataPart.
Type Encoded part size Elapsed time
Raw 315MB (1260%) 2.98s (102%)
Encodings only 166MB (664%) 2.91s (100%)
Zstd only 49MB(196%) 3.80s (131%)
Zstd&encodings 25MB(100%) 3.30s (113%)

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

Refer to a related PR or issue link (optional)

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Feb 26, 2024
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.24%. Comparing base (d8dc93f) to head (b060629).

❗ Current head b060629 differs from pull request most recent head 69f8185. Consider uploading reports for the commit 69f8185 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3380      +/-   ##
==========================================
- Coverage   85.67%   85.24%   -0.43%     
==========================================
  Files         893      893              
  Lines      147382   147251     -131     
==========================================
- Hits       126270   125531     -739     
- Misses      21112    21720     +608     

@v0y4g3r v0y4g3r changed the title feat: enable zstd compression in merge tree data part to save memory feat: enable zstd compression and encodings in merge tree data part Feb 27, 2024
Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@fengjiachun fengjiachun added this pull request to the merge queue Feb 27, 2024
Merged via the queue into GreptimeTeam:main with commit 492a009 Feb 27, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants