4 ms·
It would be awesome if someone with some Rust knowledge could make an extension to create a compressed string type like Antirez Smaz [1]. I know Postgres compr
by giovannibonetti 6y ago
It would be awesome if someone with some Rust knowledge could make an extension to create a compressed string type like Antirez Smaz [1].
I know Postgres compresses TEXT types by default, but only when the data exceeds TOAST_TUPLE_THRESHOLD (default 2 kB)
Some examples on the project page [1] show reduction of size between 10% and more than 50% for some small strings (less than 100 bytes).
[1] https://github.com/antirez/smaz https://github.com/antirez/smaz
- stubish 6y agoI think the existing C API would be a better fit, and the work would likely be a fairly simple modification to the citext extension found in contrib section of the PostgreSQL source if anyone is game.
- zombodb 6y agoI'd be inclined to agree. That said, it'd be easy to prototype with pgx, assuming that compression library exists in the Rust ecosystem too?
- giovannibonetti 6y agoI guess this compression library should do the trick [1], but I haven't tested it yet. [1] https://docs.rs/compress/0.1.2/compress/entropy/ari/index.html https://docs.rs/compress/0.1.2/compress/entropy/ari/index.ht...