[MDEV-26740] Inplace alter rebuild increases file size Created: 2021-10-01 Updated: 2024-01-15 Resolved: 2024-01-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Thirunarayanan Balathandayuthapani | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
After inplace alter table, InnoDB increases the file size. InnoDB does the normal insert
|
| Comments |
| Comment by Marko Mäkelä [ 2022-01-18 ] | ||||||||||||||||||||||
|
I believe that the size difference must be related to the B-tree index page fill factor, or to the way how pages are allocated ( I remember that there was some discussion of page fill factor during the implementation of the MySQL 5.7 bulk insert. I cannot remember if it was about intentional or accidental changes to the fill factor. Based on my findings in The page fill factor can affect the performance of subsequent operations, for the better or worse.
| ||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-01-17 ] | ||||||||||||||||||||||
|
It turns out that
This will report the file size 10,485,760 bytes (10 MiB) for the first two steps, and 9,437,184 bytes (9 MiB) for the last step:
If we insert 1,000,000 rows instead of 100,000, then the reported file sizes will be 32 MiB and 36 MiB (larger with the bulk load enabled). | ||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-12-20 ] | ||||||||||||||||||||||
|
Thank you, this is a very simple fix. I approved the 10.6 version, but I think that this should be applied to 10.4 already. As far as I understand, this regression was introduced in 10.2 by importing the MySQL 5.7 bulk index creation changes. | ||||||||||||||||||||||
| Comment by Matthias Leich [ 2024-01-10 ] | ||||||||||||||||||||||
|
origin/10.6- |