[EXPERIMENT] feat(chunk,st): add chunk format that supports start timestamp#17475
Closed
bwplotka wants to merge 18 commits into
Closed
[EXPERIMENT] feat(chunk,st): add chunk format that supports start timestamp#17475bwplotka wants to merge 18 commits into
bwplotka wants to merge 18 commits into
Conversation
krajorama
reviewed
Nov 10, 2025
bwplotka
force-pushed
the
st-tsdbchunk1
branch
4 times, most recently
from
November 19, 2025 11:36
39c93a9 to
7b20f74
Compare
bwplotka
force-pushed
the
st-tsdbchunk1
branch
2 times, most recently
from
November 21, 2025 06:27
88ebf26 to
7f3f8fc
Compare
3 tasks
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
krajorama
force-pushed
the
st-tsdbchunk1
branch
from
January 8, 2026 10:32
66796ed to
93e9f9a
Compare
Member
|
trivial rebase |
Related to prometheus/proposals#60 Signed-off-by: bwplotka <[email protected]> Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
krajorama
force-pushed
the
st-tsdbchunk1
branch
from
January 8, 2026 10:38
93e9f9a to
60d6159
Compare
Signed-off-by: György Krajcsovits <[email protected]>
Stores whether the chunk has ST in the size header as 1 bit. Stores whether the chunk has constant ST in the size header as 1 bit. This limits chunk size to 16K samples from 64K. If there is a change in the ST in the middle of the chunk, we recode the chunk to include ST for all samples, otherwise it's only kept for the first sample or not at all. Signed-off-by: György Krajcsovits <[email protected]>
Member
|
Added my idea for the chunk encoding. Stores whether the chunk has ST in the size header as 1 bit. If there is a change in the ST in the middle of the chunk, we recode |
Signed-off-by: György Krajcsovits <[email protected]>
Member
Author
|
Replaced with #17909 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to play with different implementations of float chunk that persists ST/CT information as per PROM-60.
Goals
Implementations so far:
This PR has many various implementations, but interesting ones are below:
This is essentially a DOD for ST just with optimization for typical constant ST and ST == 0 cases.
It performs pretty well, perhaps good enough.
It's my funky variation of
XOROptSTwhere instead of DOD, when we see ST we encode either 0 (ST same as before) or special varbitints, but in relation to the timestamp delta/dod.Playing with it, results are promising (
Iterator/vt=constant/st=delta-2case is questionable in practice - prod data would tell)."...Buffered" type of algorithms are not iteratively appending or reading, they read and write chunk fully into memory. This is good for cases where you need all samples in a chunk, but not if you want only a few. It also optimizes for latency, less for space, even less for mem allocs.
Using tscodec-go buffered, lossy float compression (a lot currently, up to 1e-6 in my tests)
Skipped benchmarks in this iteration, but TL;DR it's fast but bit wider (and buffered and lossy) (TODO redo)
Next
XOROptST/XORCSTvarbitints for it.XOROptST/XORCST, to check!Benchmarks (so far!)
Writes
Reads
Does this PR introduce a user-facing change?