-
Notifications
You must be signed in to change notification settings - Fork 881
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
Removal of sequence number #7103
base: main
Are you sure you want to change the base?
Conversation
2e21dc1
to
bf5bf58
Compare
7e9c8f5
to
d0625c5
Compare
Some questions:
|
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.
Just a few nits so far.
What is the plan for update/downgrade scripts? Do we need to block downgrades somehow, so that people can't downgrade if they have the new format?
Custom Scan (ChunkAppend) on test_partials | ||
Order: test_partials."time" | ||
-> Merge Append | ||
Sort Key: _hyper_35_68_chunk."time" | ||
-> Custom Scan (DecompressChunk) on _hyper_35_68_chunk | ||
-> Sort | ||
Sort Key: compress_hyper_36_71_chunk._ts_meta_sequence_num DESC | ||
Sort Key: compress_hyper_36_71_chunk._ts_meta_min_1, compress_hyper_36_71_chunk._ts_meta_max_1 |
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.
should there be an explicit DESC also in the new sort key? Or should it be ASC?
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.
Previous sort was a DESC becuase compression is set to "time DESC" so to get ASC ordering, you needed reverse order on the sequence number. New ordering should always mirror the column ordering because we are using actual values instead of a sequence which can have its own ordering.
0be3ba2
to
7d42912
Compare
@erimatnor added the missing downgrade script check. Please take a look when you can. |
df5bcff
to
85531a1
Compare
Sequence numbers were an optimization for ordering batches based on the orderby configuration setting. It was used for ordered append and avoiding sorting compressed data when it matched the query ordering. However, with enabling changes to compressed data, bookkeeping of sequence numbers is becoming more of a hassle. Removing them and using the metadata columns for ordering reduces that burden while keeping all the existing optimizations that relied on the sequences in place.
85531a1
to
cee4fbd
Compare
Sequence numbers were an optimization for ordering batches based on the orderby configuration setting. It was used for ordered append and avoiding sorting compressed data when it matched the query ordering. However, with enabling changes to compressed data, bookkeeping of sequence numbers is becoming more of a hassle. Removing them and using the metadata columns for ordering reduces that burden while keeping all the existing optimizations that relied on the sequences in place.
This change does not include downgrade script which will be added in a followup PR.
There are slight planning regressions but otherwise benchmark looks OK:
https://grafana.ops.savannah-dev.timescale.com/d/fasYic_4z/compare-akuzm?orgId=1&var-branch=All&var-run1=3725&var-run2=3735&var-threshold=0&var-use_historical_thresholds=true&var-threshold_expression=2.5%20%2A%20percentile_cont%280.90%29&var-exact_suite_version=false
Disable-check: force-changelog-file