by cryptonector · 4y ago · 0 comments
(It’s still a win to use compression at the db level because the data is typically also compressed in memory.)
If you do piecewise page-level compression, then you're back to the problem of not saving any space unless you can guarantee better than 50% compression per page, to fit at least 2 compressed pages per physical page. And nobody gets better than 50% compression on arbitrary binary data without expending a lot of CPU cycles.
To get really good compression ratios you need to be able to analyze a larger volume of data (and of course there has to be low enough entropy in the data itself). So if you're restricted to page-sized chunks to compress, you'll never get enough of a window to achieve great compression ratios.
(PS: I've done plenty of work on data compression. https://en.wikipedia.org/wiki/ARC_%28file_format%29 )
I think LSMs work great as indexed write-ahead logs. Like, the ZIL is essentially a write-ahead log, but it's not indexed. The ZIL should have been indexed so that if you crash you don't have to process the ZIL into the ZFS tree, instead you just run with it (this might also reduce the amount of RAM ZFS needs to track open transactions).