-
Notifications
You must be signed in to change notification settings - Fork 899
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
Optimize recompression for non-segmentby chunks #7632
base: main
Are you sure you want to change the base?
Conversation
Enables the segmentwise recompression flow to be used for chunks without segmentby columns. This should be more performant than doing a full recompression.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7632 +/- ##
==========================================
+ Coverage 80.06% 81.30% +1.23%
==========================================
Files 190 240 +50
Lines 37181 44696 +7515
Branches 9450 11159 +1709
==========================================
+ Hits 29770 36340 +6570
- Misses 2997 3967 +970
+ Partials 4414 4389 -25 ☔ View full report in Codecov by Sentry. |
@@ -168,6 +168,10 @@ recompress_chunk_segmentwise_impl(Chunk *uncompressed_chunk) | |||
|
|||
CompressedSegmentInfo *current_segment = palloc0(sizeof(CompressedSegmentInfo) * n_keys); | |||
|
|||
// For chunks with no segmentby settings, we can still do segmentwise recompression | |||
// The entire chunk is treated as a single segment | |||
elog(ts_guc_debug_compression_path_info ? INFO : DEBUG1, "using non-segmentby index for recompression") ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will log every time that you are using non-segmentby index but thats not true. You should log the index name you are using instead (its easy to check what index is being used that way).
@@ -483,7 +483,7 @@ select compressed_chunk_name as compressed_chunk_name_after_recompression from c | |||
select :'compressed_chunk_name_before_recompression' as before_recompression, :'compressed_chunk_name_after_recompression' as after_recompression; | |||
before_recompression | after_recompression | |||
----------------------------+---------------------------- | |||
compress_hyper_13_14_chunk | compress_hyper_13_15_chunk | |||
compress_hyper_13_14_chunk | compress_hyper_13_14_chunk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment above on line 475 needs updating since it is incorrect with this change.
@@ -291,6 +291,23 @@ insert into nullseg_many values (:'start_time', 1, NULL, NULL); | |||
SELECT compress_chunk(:'chunk_to_compress'); | |||
select * from :compressed_chunk_name; | |||
|
|||
-- Test behaviour when no segmentby columns are present | |||
SET timescaledb.debug_compression_path_info TO ON; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets enable this GUC for the complete test so we can verify that the correct index is being used for each recompression.
Enables the segmentwise recompression flow to be used for chunks without segmentby columns.
This should be more performant than doing a full recompression.