alt.hn

7/1/2026 at 1:05:16 PM

Designing DB partitions you don't have to babysit

https://explainanalyze.com/p/designing-partitioning-you-dont-have-to-babysit/

by rtolkachev

7/4/2026 at 7:26:38 PM

This is a topic that interests me a lot but there's a lot I find surprising since I finally started working with postgres dependent apps. Why for example is the id a good primary key? Joins are not uncommon, but I don't have anyone searching on id in my application and it is not even supposed to be user visible. I would think every possible user search would look at all partitions indexes if I did this instead of creation date.

by yasaheblasa

7/4/2026 at 8:13:37 PM

Your primary key is there to uniquely identify a record. You need additional indexes on fields you will search on.

by jagged-chisel

7/4/2026 at 5:55:12 PM

Or you could just warehouse the daily data into something like ClickHouse and start fresh every day. It's built for this kind of workload and has demonstrated some absolutely insane analytical performance at massive scale. We're currently running it on an $170/month VPS, querying over 500+ billion rows daily without any issues. At that point, partitioning an ever-growing OLTP table starts looking like the harder problem.

by djfobbz

7/4/2026 at 8:17:05 PM

With the other comment about kdb+ and this show a misread of the article: The article AND ANY use of a columnar DB show the same issue: Point lookups are badly pessimized with both partitions on other columns and/or columnar.

That is why columnar DBs, not matter how impressive, are not used by OLTP workloads (and here this article point you can undo the advantages without pay attention at the consequences of partitions).

by mamcx

7/4/2026 at 5:44:53 PM

For anyone interested in the topic I suggest reading about snowflake id [https://en.wikipedia.org/wiki/Snowflake_ID] or uuid7 the patterns from the article translate cleanly. The bigint is 64 bytes where uuid is 128. There are other caveats but its all about tradeoffs.

by piterrro

7/4/2026 at 5:32:17 PM

Or just use kdb+ and 1bn rows a day is par for the course.

by leprechaun1066