Hi Marko, thanks for the response ... so for the DOCS part
On Sun, Aug 20, 2023 at 6:12 PM pslawek83 via discuss<discuss@lists.mariadb.org> wrote:Thanks everyone for the answers. Tested this PAGE_COMPRESSION a bit and make some reading. Not sure if I fully understand how that works... is that correct?1. Impossible without punch hole as if we don't have it the server will just write partially used pages which will take full page size anyway. But in docs it seems it described its use with punch hole disabled. What's the reason to still have page compression without punch hole?Can you please point to the misleading part of the documentation sothat it can be corrected?2. After enabling compression each page needs to be trimmed using punch hole, so if we have 1 TB database and 64k blocks, the database files will have over 15 million fragments (1000000000000/64000)That is correct.So if we get like 50% compression and then we'll be able to put another 1TB of data into these holes we'll be having close to 31 million file fragments. I'm not sure if under such conditions the FS will be able to even allocate space efficiently anymore, copy these files, etc. Or im not getting something?For what it is worth, around the same time when the page_compressedwas being developed for MariaDB Server 10.1, something similar wasbeing worked on at Oracle, I think for MySQL 5.7. To my understanding,the same hardware partner worked with both companies. The obviouswould have been https://en.wikipedia.org/wiki/Fusion-io_NVMFS if ithad worked without kernel panics or existed in a mainline kernel. Idon’t even know if it ever was open sourced.3. I was testing compression of ~1.5GB table with nice results on default 16kb page size. One thing i noticed is that l was always getting exactly the same compressed size using `du`. However the table read/copy times were different from 40s for uncompressed to 80-400 seconds depending on algo. Is that possible that is because page size is too low?As far as I remember, most compression algorithms that are derivativesof the LZ77 family have an input buffer size of 32 KiB. From thatpoint of view, it would seem to make sense to use innodb_page_size=32kor innodb_page_size=64k instead of the default. Furthermore, I thinkthat it was a mistake to implement bzip2 support at all. Thatalgorithm would work with much larger buffer sizes.4. Myrocks seems to be very slow compared to compressed inno. Was also reading docs related to it. For its usecase is it more suitable for storing large rows rather than many small rows?To my understanding, the LSM trees that MyRocks is built on work bestin an insert-only workload. On top of LSM trees, MyRocks implementssome caches and Bloom filters. If you have few updates or deletes andmost reads are accessing recently inserted data, it could work.5. I remember reading that some innodb compression is going to be obsolete. Is that row compression? Or there are no plans to obsolete any compression model?I wanted to deprecate and remove the ROW_FORMAT=COMPRESSED that Idesigned and implemented in the InnoDB Plugin for MySQL 5.1 based onsome high level ideas of Heikki Tuuri between 2005 and 2007.https://jira.mariadb.org/browse/MDEV-22367 was the first step towardsthat. Based on community feedback, this won’t be happening. Even aftersome data structure cleanup that took place in MariaDB Server 10.6,supporting the format incurs an overhead of some 32 to 40 bytes perbuffer page descriptor, which is not insignificant. Removing bothROW_FORMAT=COMPRESSED and the adaptive hash index would shrink theblock descriptor to 80 bytes from its current 10.6 size of 160 bytes.The write performance with ROW_FORMAT=COMPRESSED should have beendegraded when I implemented the easier-to-parse log record format inMDEV-12353 (MariaDB Server 10.5). There are open bugs aboutROW_FORMAT=COMPRESSED, such ashttps://jira.mariadb.org/browse/MDEV-31574. I would say that theInnoDB ROW_FORMAT=COMPRESSED seemed like a good idea back when it wasimplemented, when HDD storage was the only practical option. Just likethe InnoDB change buffer, which I removed in MariaDB Server 11.0 afterhaving to deal with too many cases of corruption:With best regards,Marko--Marko Mäkelä, Lead Developer InnoDBMariaDB plc