[MDEV-26029] Sparse files are inefficient on thinly provisioned storage Created: 2021-06-28 Updated: 2021-07-20 Resolved: 2021-06-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1, 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.6.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
The MariaDB implementation of page_compressed tables for InnoDB uses sparse files. In the worst case, in the data file, every data page will consist of some data followed by a hole. This may be extremely inefficient in some file systems. If the underlying storage device is thinly provisioned (can compress data on the fly), it would be good to write regular files (with sequences of NUL bytes at the end of each page_compressed block) and let the storage device take care of compressing the data. |
| Comments |
| Comment by Marko Mäkelä [ 2021-07-20 ] | ||
|
The detection of sparse files currently requires read access to the block device. It would be nice to have it exposed via the Linux /sys file system, similar to the SSD detection (
In such case, thin provisioning will be assumed to be disabled, that is, sparse files will be written for page_compressed tables, as was the case before this improvement. |