Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Commit ca659c1

Browse files
committed
Extend blockchain compression section
Extending the introduction of compression for the blockchain tutorial by giving some more background and some links.
1 parent 0700bca commit ca659c1

1 file changed

Lines changed: 28 additions & 5 deletions

File tree

tutorials/blockchain-query/blockchain-compress.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,34 @@ content_group: Query the Bitcoin blockchain
99

1010
# Set up compression and compress the dataset
1111

12-
This tutorial uses a dataset that contains Bitcoin blockchain data for
13-
the past five days, in a hypertable named `transactions`.
14-
15-
Storing a lot of data can be expensive. Using compression, you can store
16-
the same dataset much more efficiently and potentially query it even faster.
12+
You have now seen how to create a hypertable for your Bitcoin dataset
13+
and query it for blockchain data. When ingesting a dataset like this
14+
is seldom necessary to update old data and over time the amount of
15+
data in the tables will grow. Soon you will end up with a lot of data
16+
and since this is mostly immutable you can compress it to save space
17+
and avoid incurring additional cost.
18+
19+
It is possible to use disk-oriented compression like the support
20+
offered by ZFS and Btrfs but since TimescaleDB is build for handling
21+
event-oriented data (such as time-series) it comes with support for
22+
compressing data in hypertables.
23+
24+
TimescaleDB compression allows you to store the data in a vastly more
25+
efficient format allowing up to 20x compression ratio compared to a
26+
normal PostgreSQL table, but this is of course highly dependent on the
27+
data and configuration.
28+
29+
TimescaleDB compression is implemented natively in PostgreSQL and does
30+
not require special storage formats. Instead it relies on features of
31+
PostgreSQL to transform the data into columnar format before
32+
compression. The use of a columnar format allows better compression
33+
ratio since similar data is stored adjacently. For more details on how
34+
the compression format looks, you can look at the [compression
35+
design][compression-design] section.
36+
37+
A beneficial side-effect of compressing data is that certain queries
38+
will be significantly faster since less data has to be read into
39+
memory.
1740

1841
<Procedure>
1942

0 commit comments

Comments
 (0)