frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

How TimescaleDB compresses time-series data

https://roszigit.com/en/blog/timescaledb-compression-hypercore
61•lkanwoqwp•2h ago

Comments

blackoil•1h ago
Gorilla by Facebook had this. Value is stored as delta and time as delta of delta.
lokar•1h ago
They say they are using “gorilla compression “

I’m still amazed every time I go back and read how the compression for floating point values works.

f311a•1h ago
It's used in ClickHouse as well. CH supports all known compression algos and they are documented pretty well.
gopalv•1h ago
> What does compression do to query performance?

That section is the most relevant whenever compression in a DB is discussed.

The purpose of a database is to find, aggregate or update data - storage is where the trade-off gets expressed. There are no silver bullets here.

Any method of compression which speeds up either filter rejection or scan rate is better than something that only trades off IO for CPU usage.

For example, dictionary encoding can be slower to read (because you decompress the whole dictionary and not just the skip read after filter), but not if you can squeeze out an IN clause by turning string comparisons into O(1) dictionary followed by a simple integer filter. Remember, this can be arbitrarily complex (Druid is a great example of this) and then the bitmaps can be used because the dictionary index will be a dense 0-N.

Even better if that can feed a deterministic operation like UPPER() so that you do it over the dictionary hits once, instead of each row. You can even use it over the same hash slot, instead of another dictionary collision check or hash computation.

If anyone is looking at JSONB compression, go take a long look at the Variant encoding proposals from Databricks/Snowflake for Iceberg[1].

Turning a single column "payload" JSONB field into chunks which are columnarized and strictly typed allows you to do all the tricks mentioned here, but on loosely typed data but chunk by chunk.

[1] - https://github.com/apache/parquet-format/blob/master/Variant...

PaulWaldman•23m ago
There’s an issue tracking TimescaleDB JSONB compression: https://github.com/timescale/timescaledb/issues/2978
tudorg•45m ago
I have been working on another PG extension for timeseries (https://github.com/xataio/deltax) for a few months, and trying to score as good as possible on ClickBench.

This is a project that is simply lot of fun to work on. There are many tricks that can be used to speed-up analytics, besides just type-aware compression:

* for each segment you will keep things like max/min/sum, number of distinct values, bloom filters, etc. For a good amount of common queries, you can answer them just based on this metadata, so you don't need to decompress the columns at all.

* for text column, you compress them differently based on cardinality. Low cardinality (think labels or similar) is dictionary based compression. High cardinality is LZ4.

* Generally the smaller the data on disk, the higher the cold runs performance. This is because you need less IO to load it in memory. I have discovered that on top of the type-aware compression, it's worth doing another round of LZ4. There's also some research that it's sometimes worth doing multiple passes of LZ4.

* Partition and segment pruning. If you can tell from the metadata or bloom filters that the filter doesn't match a partition or segment, you skip the whole thing.

* Push down of filters in the decompression layer. Depending on the compression algorithm, while you decompress you can also filter out the values that you don't need. This avoids passing data and allocating memory for elements that will be later discarded anyway.

* Organization of data on disk is more important than almost anything else. Of course, that's the main point of columnar storage, but there are level of details on how to organize the data so that IO is minimized during queries. I have tried 3-4 different layouts before settling on one.

* For top N type of queries, which are really common in analytics, you want to stop the reading from disk / decompressed as soon as you have enough data to guarantee that you have a correct top N to satisfy the query.

* Parallelize everything: at least ClickBench runs on instances with a lot of CPU cores, so you need to parallelize every step of the way. This is done differently depending on the query type. For example for top N, each worker can take a subset of the segments and get the top N from each of them. Then you combine those in a single result.

Iroh 1.0

https://www.iroh.computer/blog/v1
665•chadfowler•4h ago•214 comments

TinyWind: A pixel pirate sailing game with real wind physics (380k+ kms sailed)

https://tinywind.io
338•tinywind•3h ago•71 comments

Typst 0.15.0

https://typst.app/docs/changelog/0.15.0/
133•schu•2h ago•23 comments

Ask HN: Has anyone replaced Claude/GPT with a local model for daily coding?

309•cloudking•5h ago•190 comments

My Homelab AI Dev Platform

https://rsgm.dev/post/ai-dev-platform/
146•rsgm•4h ago•32 comments

How TimescaleDB compresses time-series data

https://roszigit.com/en/blog/timescaledb-compression-hypercore
62•lkanwoqwp•2h ago•6 comments

Game Engine White Papers Commander Keen

https://forgottenbytes.net/commander_keen.html
55•mfiguiere•1h ago•10 comments

Factoring "short-sleeve" RSA keys with polynomials

https://blog.trailofbits.com/2026/06/12/factoring-short-sleeve-rsa-keys-with-polynomials/
22•ledoge•3d ago•0 comments

Hetzner Price Adjustment

https://docs.hetzner.com/general/infrastructure-and-availability/price-adjustment/#cloud-servers
183•tuhtah•6h ago•298 comments

Making glass-to-metal seals for home­made vacuum tubes

https://maurycyz.com/projects/glass/1/
93•zdw•1d ago•27 comments

Show HN: Fata – Spaced repetition to fight skill rot from AI coding

https://fata.dev
38•djoume•4d ago•18 comments

Fox to buy Roku

https://www.wsj.com/business/deals/fox-roku-deal-f6e564f9
196•thm•7h ago•268 comments

Claude Corps

https://www.anthropic.com/news/claude-corps
38•Mustan•2h ago•31 comments

Launch HN: Drafted (YC P26) – Models for residential architecture

27•PrimalNick•3h ago•27 comments

Copper transport drug restores memory and clears toxic Alzheimer's proteins

https://www.monash.edu/news/articles/copper-drug-restores-memory-and-clears-toxic-alzheimers-prot...
175•bookofjoe•5h ago•68 comments

Boot Naked Linux

https://nick.zoic.org/art/boot-naked-linux/
46•abnercoimbre•3h ago•21 comments

Your ePub Is fine

https://andreklein.net/your-epub-is-fine-kobo-disagrees-blame-adobe/
849•sohkamyung•20h ago•287 comments

Apple Foundation Models

https://platform.claude.com/docs/en/cli-sdks-libraries/libraries/apple-foundation-models
426•MehrdadKhnzd•14h ago•201 comments

CrankGPT

https://crankgpt.com
494•rishikeshs•6h ago•201 comments

Can Europe train a frontier AI model on the compute it owns?

https://github.com/sammysltd/euromesh
85•smashini•6h ago•99 comments

Show HN: machine0 – Persistent NixOS VMs You Control from the CLI

https://machine0.io
49•bwm•3h ago•16 comments

Around 200 Stanford students walk out as Google CEO takes stage

https://www.sfgate.com/tech/article/sundar-pichai-stanford-commencement-22304888.php
60•pera•1h ago•3 comments

Teenagers Stayed Overnight at Their School and Found Hidden Ancient Roman Ruins

https://www.smithsonianmag.com/smart-news/these-italian-teenagers-stayed-overnight-at-their-schoo...
153•thunderbong•4d ago•74 comments

Openrouter Fusion API

https://openrouter.ai/openrouter/fusion
180•tdchaitanya•12h ago•70 comments

Even more batteries included with Emacs

https://karthinks.com/software/even-more-batteries-included-with-emacs/
330•signa11•17h ago•119 comments

The Alaska Server

https://serialport.org/blog/the-alaska-server/
8•speckx•1h ago•1 comments

Improvement in advanced Alzheimer’s disease following high-dose psilocybin

https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2026.1813281/full
174•cl3misch•12h ago•123 comments

Show HN: Exploiting Slack's video embeds to achieve E2EE communication

https://v1c.rocks/log/exploiting-slack-video/
21•victorio•4h ago•2 comments

Ported my C game to WASM, here's every bug that I hit

http://ernesernesto.github.io/writes/portingmatchmorphosistowasm/
94•birdculture•3d ago•77 comments

Dalus (YC W25) Is Hiring a Senior Software Engineer in Germany

https://www.ycombinator.com/companies/dalus/jobs/5IDmKJt-senior-software-frontend-engineer-german...
1•sebastianvoelkl•12h ago