[MDEV-31462] ibdata1 shrinking Created: 2023-06-12  Updated: 2023-06-26  Resolved: 2023-06-26

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 11.2.1

Type: Task Priority: Major
Reporter: Alex Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: innodb, performance

Issue Links:
Duplicate
duplicates MDEV-14795 InnoDB system tablespace cannot be sh... Closed

 Description   

I think it is a good idea to have a way to shrink ibdata1 file when innodb_file_per_table is ON.
Maybe not online, but an offline tool to do that.



 Comments   
Comment by Daniel Black [ 2023-06-13 ]

In the commit 3b4b512d8e42bb3d33cf78789754cd10ff310646, Marko made the comment:

To truncate such "contaminated" or "bloated" undo log tablespaces (when using innodb_undo_tablespaces=2 or more) you can execute the following SQL:

    
    BEGIN;INSERT mysql.innodb_table_stats VALUES('','',DEFAULT,0,0,0);ROLLBACK;
    SET GLOBAL innodb_undo_log_truncate=ON, innodb_fast_shutdown=0;
    SHUTDOWN;

The first line creates a dummy InnoDB transaction, to ensure that there will be some history to be purged during shutdown and that the undo tablespaces will be truncated.

Sure, its not the full ibdata1 space, but might be what you need.

Comment by Marko Mäkelä [ 2023-06-26 ]

This feature request seems to duplicate MDEV-14795.

Generated at Thu Feb 08 10:24:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.