Bypass PostgreSQL catalog overhead with direct partition hash calculations
5 comments
·August 23, 2025Elucalidavah
Tangential: is "without requiring knowledge of data patterns" a frequently useful requirement? I.e. isn't knowledge of data patterns basically required for any performance optimization?
ysleepy
Without a comparison of letting postgres calculate the partition this is just useless.
And who in their right mind would calculate a hash using a static SQL query that isn't even using the pg catalog hashing routine but a reimplementation.
I'm baffled.
wengo314
this looks like maintenance nightmare going forward, but i could be wrong.
If you are stuck on specific pg version for a while, maybe it's worth it.
itsthecourier
nice to see ruby getting ahead
I’d be interested to see a benchmark of actually selecting rows by manually specifying the partition vs not.
This benchmark seems to be pure computation of the hash value, which I don’t think is helpful to test the hypothesis. A lot can happen at actual query time that this benchmark does not account for.