mariadb/storage
Thirunarayanan Balathandayuthapani ce9fefb24d MDEV-35689 InnoDB system tables cannot be optimized or defragmented
- With the help of MDEV-14795, InnoDB implemented a way to
shrink the InnoDB system tablespace after undo tablespaces
have been moved to separate files (MDEV-29986). There is no way
to defragment any pages of InnoDB system tables. By doing that,
shrinking of system tablespace can be more effective. This patch
deals with defragment of system tables inside ibdata1.

Following steps are done to do the defragmentation of system
tablespace:
1) Make sure that there is no user tables exist in ibdata1

2) Iterate through all extent descriptor pages in system tablespace
and note their states.

3) Find the free earlier extent to replace the lastly used
extents in the system tablespace.

4) Iterate through all indexes of system tablespace and defragment
the tree level by level.

5) Iterate the level from left page to right page. If the page
comes under the extent to be replaced then allocate a new page
from the new extent which are mapped during step(2).

6) Copy the old page content to new page

7) Change the associative pages like left, right and parent page

8) Do step (5), (6), (7) in a single mini-transaction

Defragmentation is enabled only when :autoextend exist in
innodb_data_file_path variable.
2025-02-12 10:15:43 +05:30
..
archive cleanup: remove unconditional #ifdef's 2024-11-05 14:00:47 -08:00
blackhole Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
columnstore cleanup: extract transaction-related part of handlerton 2024-11-05 14:00:50 -08:00
connect Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
csv Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
example Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
federated Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
federatedx Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
heap Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
innobase MDEV-35689 InnoDB system tables cannot be optimized or defragmented 2025-02-12 10:15:43 +05:30
maria Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
mroonga MDEV-35837 Move to c++17 2025-01-16 15:08:29 -05:00
myisam Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
myisammrg Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
oqgraph Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
perfschema Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
rocksdb Merge 11.7 into main 2025-01-09 13:46:06 +02:00
sequence cleanup: extract transaction-related part of handlerton 2024-11-05 14:00:50 -08:00
sphinx Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
spider Merge 11.7 into main 2025-01-09 13:46:06 +02:00
test_sql_discovery MDEV-19123 Change default charset from latin1 to utf8mb4 2024-07-11 10:21:07 +04:00