Skip to content

Commit

Permalink
docs: Update compression-methods.md (#3799)
Browse files Browse the repository at this point in the history
Fix Delta encoding examples in "About compression" page

Signed-off-by: Enrico Stefanel <me@enst.it>
Co-authored-by: Iain Cox <iain@timescale.com>
  • Loading branch information
enstit and billy-the-fish authored Feb 13, 2025
1 parent 11477fb commit 0179a0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions use-timescale/compression/compression-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ this:
|time|cpu|mem_free_bytes|temperature|humidity|
|-|-|-|-|-|
|2023-04-01 10:00:00|82|1,073,741,824|80|25|
|2023-04-01 10:05:00|98|858,993,459|81|25|
|2023-04-01 10:05:00|98|858,904,583|81|25|
|2023-04-01 10:00:05|98|858,993,459|81|25|
|2023-04-01 10:00:10|98|858,904,583|81|25|

With delta encoding, you only need to store how much each value changed from the
previous data point, resulting in smaller values to store. So after the first
row, you can represent subsequent rows with less information, like this:

|time|cpu|mem_free_bytes|temperature|humidity|
|-|-|-|-|-|
|2020-04-01 10:00:00|82|1,073,741,824|80|25|
|2023-04-01 10:00:00|82|1,073,741,824|80|25|
|5 seconds|16|-214,748,365|1|0|
|5 seconds|0|-88,876|0|0|

Expand All @@ -86,7 +86,7 @@ Applied to the example dataset from earlier, delta-of-delta encoding results in
|-|-|-|-|-|
|2020-04-01 10:00:00|82|1,073,741,824|80|25|
|5 seconds|16|-214,748,365|1|0|
|0|0|-88,876|0|0|
|0 seconds|0|-88,876|0|0|

In this example, delta-of-delta further compresses 5 seconds in the time column
down to 0 for every entry in the time column after the second row, because the
Expand Down

0 comments on commit 0179a0c

Please sign in to comment.