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

Reset sequence numbers on non-rollup compression #6637

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion tsl/src/compression/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,26 @@ compress_chunk(Oid in_table, Oid out_table, int insert_options)
}

RowCompressor row_compressor;
/* Reset sequence is used for resetting the sequence without
* having to fetch the existing sequence for an individual
* sequence group. If we are rolling up an uncompressed chunk
* into an existing compressed chunk, we have to fetch
* sequence numbers for each batch of the segment using
* the respective index. In normal compression, this is
* not necessary because we start segment numbers from zero.
* We distinguish these cases by insert_options being zero for rollups.
*
* Sequence numbers are planned to be removed in the near future,
* which will render this flag obsolete.
*/
bool reset_sequence = insert_options > 0;
row_compressor_init(settings,
&row_compressor,
in_desc,
out_rel,
out_desc->natts,
true /*need_bistate*/,
false /*reset_sequence*/,
reset_sequence,
insert_options);

if (matched_index_rel != NULL)
Expand Down