Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1.25 KB

File metadata and controls

28 lines (23 loc) · 1.25 KB

Compressing your time-series data allows you to reduce your chunk size by more than 90%. This saves on storage costs, and keeps your queries operating at lightning speed.

When you enable compression, the data in your hypertable is compressed chunk by chunk. When the chunk is compressed, multiple records are grouped into a single row. The columns of this row hold an array-like structure that stores all the data. This means that instead of using lots of rows to store the data, it stores the same data in a single row. Because a single row takes up less disk space than many rows, it decreases the amount of disk space required, and can also speed up your queries.

For example, if you had a table with data that looked a bit like this:

Timestamp Device ID Device Type CPU Disk IO
12:00:01 A SSD 70.11 13.4
12:00:01 B HDD 69.70 20.5
12:00:02 A SSD 70.12 13.2
12:00:02 B HDD 69.69 23.4
12:00:03 A SSD 70.14 13.0
12:00:03 B HDD 69.70 25.2

You can convert this to a single row in array form, like this:

Timestamp Device ID Device Type CPU Disk IO
[12:00:01, 12:00:01, 12:00:02, 12:00:02, 12:00:03, 12:00:03] [A, B, A, B, A, B] [SSD, HDD, SSD, HDD, SSD, HDD] [70.11, 69.70, 70.12, 69.69, 70.14, 69.70] [13.4, 20.5, 13.2, 23.4, 13.0, 25.2]