All pages
Powered by GitBook
1 of 11

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

MariaDB Enterprise Server InnoDB Operations

Learn about InnoDB operations in MariaDB Enterprise Server. This section covers critical management tasks, including configuration, performance tuning, and troubleshooting for enterprise-grade deploym

InnoDB - Unmaintained

This section provides information about unmaintained or deprecated features related to InnoDB in MariaDB Server. It is advisable to review this content for compatibility and migration planning.

Using InnoDB Instead of XtraDB

Information about XtraDB, an storage engine used in old MariaDB versions.

XtraDB, previously the default InnoDB replacement in MariaDB, is no longer included in standard distributions. MariaDB now uses InnoDB by default.

The reasons you may want to use InnoDB instead of XtraDB in earlier versions of MariaDB are:

  • You want to benchmark the difference between InnoDB/XtraDB

  • You hit a bug in XtraDB

  • You got a table space crash in XtraDB and recovery doesn't work. In some cases InnoDB may do a better job to recover data.

See Also

This page is licensed: CC BY-SA / Gnu FDL

Compiling with the InnoDB plugin from Oracle

About XtraDB

Information about the XtraDB storage engine that was used in old MariaDB versions.

Percona XtraDB was an enhanced version of the InnoDB storage engine used in MariaDB before MariaDB 10.2, designed to better scale on modern hardware, and it includes a variety of other features useful in high-performance environments.

It is fully backwards compatible, and it identifies itself to MariaDB as "ENGINE=InnoDB" (just like InnoDB), and so can be used as a drop-in replacement for standard InnoDB.

Percona XtraDB includes all of InnoDB's robust, reliable -compliant design and advanced MVCC architecture, and builds on that solid foundation with more features, more tunability, more metrics, and more scalability. In particular, it is designed to scale better on many cores, to use memory more efficiently, and to be more convenient and useful. The new features are especially designed to alleviate some of InnoDB's limitations. We choose features and fixes based on customer requests and on our best judgment of real-world needs as a high-performance consulting company.

XtraDB was also available in MariaDB for Windows.

Percona XtraDB versions in MariaDB

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from []in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

  • XtraDB from in

and

  • and 5.3 include the latest XtraDB version from at the time they were released.

  • version in

  • version 5.1.54-12.5 in

  • version 5.1.52-11.6 in and

  • version 5.1.49-12 in

Notes

  1. Misidentifies itself as 5.6.36-83.0 in

  2. Misidentifies itself as 5.6.36-82.2 from to

  3. Misidentifies itself as 5.6.32-79.0 in

  4. Misidentifies itself as 5.6.36-83.0 in

See Also

More information can be found in the .

This page is licensed: CC BY-SA / Gnu FDL

XtraDB from Percona Server 5.6.38-83.0[1] in

  • XtraDB from Percona Server 5.6.37-82.2[2]in

  • XtraDB from Percona Server 5.6.36-82.1 in

  • XtraDB from Percona Server 5.6.36-82.0 in

  • XtraDB from Percona Server 5.6.35-80.0 in

  • XtraDB from Percona Server 5.6.34-79.1 in

  • XtraDB from Percona Server 5.6.33-79.0[3] in

  • XtraDB from Percona Server 5.6.32-78.1 in

  • XtraDB from Percona Server 5.6.31-77.0 in

  • XtraDB from Percona Server 5.6.30-76.3 in

  • XtraDB from Percona Server 5.6.29-76.2 in

  • XtraDB from Percona Server 5.6.28-76.1 in

  • XtraDB from Percona Server 5.6.26-76.0 in

  • XtraDB from Percona Server 5.6.26-74.0 in

  • XtraDB from Percona Server 5.6.25-73.1 in

  • XtraDB from Percona Server 5.6.24-72.2 in

  • XtraDB from Percona Server 5.6.23-72.1 in

  • XtraDB from Percona Server 5.6.22-72.0 in

  • XtraDB from Percona Server 5.6.21-70.0 in

  • XtraDB from Percona Server 5.6.17-65.0 in

  • XtraDB from Percona Server 5.6.37-82.2[5]in

  • XtraDB from Percona Server 5.6.36-82.1 in

  • XtraDB from Percona Server 5.6.36-82.0 in

  • XtraDB from Percona Server 5.6.35-80.0 in

  • XtraDB from Percona Server 5.6.34-79.1 in

  • XtraDB from Percona Server 5.6.33-79.0[6] in

  • XtraDB from Percona Server 5.6.31-77.0 in

  • XtraDB from Percona Server 5.6.30-76.3 in

  • XtraDB from Percona Server 5.6.29-76.2 in

  • XtraDB from Percona Server 5.6.28-76.1 in

  • XtraDB from Percona Server 5.6.27-76.0 in

  • XtraDB from Percona Server 5.6.26-74.0 in

  • XtraDB from Percona Server 5.6.25-73.1 in

  • XtraDB from Percona Server 5.6.24-72.2 in

  • XtraDB from Percona Server 5.6.23-72.1 in

  • XtraDB from Percona Server 5.6.22-72.0 in

  • XtraDB from Percona Server 5.6.22-71.0 in

  • XtraDB from Percona Server 5.6.21-70.0 in

  • XtraDB from Percona Server 5.6.20-68.0 in

  • XtraDB from Percona Server 5.6.19-67.0 in

  • XtraDB from Percona Server 5.6.17-65.0 in

  • XtraDB from Percona Server 5.6.14-rel62.0 in

  • XtraDB from Percona Server 5.5.55-38.8 in

  • XtraDB from Percona Server 5.5.52-38.3 in

  • XtraDB from Percona Server 5.5.50-38.0 in

  • XtraDB from Percona Server 5.5.49-37.9 in

  • XtraDB from Percona Server 5.5.48-37.8 in

  • XtraDB from Percona Server 5.5.46-37.7 in

  • XtraDB from Percona Server 5.5.46-37.6 in

  • XtraDB from Percona Server 5.5.45-37.4 in

  • XtraDB from Percona Server 5.5.44-37.3 in

  • XtraDB from Percona Server 5.5.42-37.2 in

  • XtraDB from Percona Server 5.5.42-37.1 in

  • XtraDB from Percona Server 5.5.40-36.1 in

  • XtraDB from Percona Server 5.5.38-35.2 in

  • XtraDB from Percona Server 5.5.37-35.0 in

  • XtraDB from Percona Server 5.5.36-34.0 in

  • XtraDB from Percona Server 5.5.35-33.0 in

  • XtraDB from Percona Server 5.5.34-32.0 in

  • XtraDB from Percona Server 5.5.33-31.1 in

  • XtraDB from Percona Server-5.5.32-31.0 in

  • version 5.1.47-11.2 in

  • version 1.0.6-10 in

  • version 1.0.6-9 in ,, and .

  • version 1.0.4-8 in

  • version 1.0.3-8 in

  • version 1.0.3-6 in

  • ↑ Misidentifies itself as 5.6.36-82.2 in

  • ↑ Misidentifies itself as 5.6.32-79.0 in

  • Percona Server 5.6.49-89.0
    Percona Server 5.6.46-86.2
    Percona Server 5.6.43-84.3
    Percona Server 5.6.41-84.1
    Percona Server 5.6.42-84.2
    Percona Server 5.6.41-84.1
    Percona Server 5.6.39-83.1
    Percona Server 5.6.38-83.0
    4
    Percona Server 5.5.61-38.13
    Percona Server 5.5.59-38.11
    Percona Server 5.5.58-38.10
    Percona Server 5.5.55-38.9
    5.1.59-13
    ↑
    ↑
    ↑
    ↑
    Percona documentation
    ACID
    MariaDB 10.1
    MariaDB 10.1.46
    MariaDB 10.1.44
    MariaDB 10.1.39
    MariaDB 10.1.36
    MariaDB 10.0
    MariaDB 10.0.38
    MariaDB 10.0.37
    MariaDB 10.0.35
    MariaDB 10.0.34
    MariaDB 5.5
    MariaDB 5.5.62
    MariaDB 5.5.60
    MariaDB 5.5.59
    MariaDB 5.5.58
    MariaDB 5.2
    MariaDB 5.3
    MariaDB 5.2
    MariaDB 5.1
    MariaDB 5.1
    MariaDB 5.1.60
    MariaDB 5.1.55
    MariaDB 5.2.4
    5.1.53
    MariaDB 5.1.50
    MariaDB 10.1.31
    MariaDB 10.1.27
    MariaDB 10.1.30
    MariaDB 10.1.19
    MariaDB 10.0.34
    MariaDB 10.1.31
    MariaDB 10.1.27
    MariaDB 10.1.26
    MariaDB 10.1.24
    MariaDB 10.1.22
    MariaDB 10.1.20
    MariaDB 10.1.19
    MariaDB 10.1.18
    MariaDB 10.1.17
    MariaDB 10.1.15
    MariaDB 10.1.14
    MariaDB 10.1.12
    MariaDB 10.1.10
    MariaDB 10.1.8
    MariaDB 10.1.7
    MariaDB 10.1.6
    MariaDB 10.1.5
    MariaDB 10.1.4
    MariaDB 10.1.2
    MariaDB 10.1.1
    MariaDB 10.0.33
    MariaDB 10.0.32
    MariaDB 10.0.31
    MariaDB 10.0.30
    MariaDB 10.0.29
    MariaDB 10.0.28
    MariaDB 10.0.27
    MariaDB 10.0.26
    MariaDB 10.0.25
    MariaDB 10.0.24
    MariaDB 10.0.23
    MariaDB 10.0.22
    MariaDB 10.0.21
    MariaDB 10.0.20
    MariaDB 10.0.18
    MariaDB 10.0.17
    MariaDB 10.0.16
    MariaDB 10.0.15
    MariaDB 10.0.14
    MariaDB 10.0.13
    MariaDB 10.0.11
    MariaDB 10.0.7
    MariaDB 5.5.57
    MariaDB 5.5.53
    MariaDB 5.5.51
    MariaDB 5.5.50
    MariaDB 5.5.49
    MariaDB 5.5.48
    MariaDB 5.5.47
    MariaDB 5.5.46
    MariaDB 5.5.45
    MariaDB 5.5.44
    MariaDB 5.5.43
    MariaDB 5.5.40
    MariaDB 5.5.39
    MariaDB 5.5.38
    MariaDB 5.5.37
    MariaDB 5.5.35
    MariaDB 5.5.34
    MariaDB 5.5.33
    MariaDB 5.5.32
    MariaDB 5.1.49
    MariaDB 5.1.47
    MariaDB 5.1.42
    5.1.44
    5.1.44b
    MariaDB 5.1.41 RC
    MariaDB 5.1.39 Beta
    MariaDB 5.1.38 Beta
    MariaDB 10.0.33
    MariaDB 10.0.28

    Configure the InnoDB Redo Log

    A guide to configuring the size and number of InnoDB redo log files in MariaDB Enterprise Server to balance write performance and crash recovery time.

    Overview

    In MariaDB Enterprise Server, the InnoDB storage engine uses a Redo Log. The Redo Log is a transaction log that InnoDB uses to write data to disk in a crash-safe manner.

    Redo Log records are identified using the Log Sequence Number (LSN). The Redo Log is a circular log file that is a constant size. Old Redo Log records are frequently overwritten by new Redo Log records. InnoDB regularly performs checkpoints. During a checkpoint, InnoDB flushes Redo Log records to the InnoDB tablespace files.

    When the server crashes, InnoDB performs crash recovery during server startup using the Redo Log. During crash recovery, InnoDB finds the last checkpoint in the Redo Log and flushes the Redo Log records since the last checkpoint to the InnoDB tablespace files.

    For additional information, see "".

    This page describes how to configure the InnoDB Redo Log.

    Configure the InnoDB Redo Log Size

    The size of the InnoDB Redo Log is configurable. If your server writes data at a very high frequency, then you may need to increase the redo log size, so that InnoDB does not have to perform checkpoints as frequently.

    For the maximum capacity in the Redo Log, the Redo Log size should be the same as the , which is configured by the system variable.

    The method to configure the Redo Log size depends on the server version and whether a server restart are performed:

    Product Versions
    Server Restart?
    Method

    Configure the InnoDB Redo Log Size with SET GLOBAL (ES 10.5 and Later)

    Starting in MariaDB Enterprise Server 10.5, the size of the InnoDB Redo Log can be changed dynamically by setting the system variable using the statement. The statement requires the SUPER privilege.

    The resize operation is performed asynchronously in the background. If the server is restarted before the operation completes, the request may be ignored. To ensure that the change survives server restarts, the system variable should also be set in a configuration file.

    To configure the InnoDB Redo Log with the statement, use the following procedure:

    1. Connect to the server using MariaDB Client as the root@localhost user account or another user account with the SUPER privilege:

    1. Set the system variable to the new size using the statement.

    For example, to set the size to 512 MB:

    And to set the size to 2 GB:

    1. The resize operation is performed asynchronously in the background. Confirm that the resize operation is complete by querying the system variable using the statement. The resize operation is complete when the output shows the new size as the value of the system variable.

    Execute the following statement until it shows the new size:

    1. Choose a configuration file for custom changes to system variables and options. It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variable in the configuration file.

    It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server].

    When set in a configuration file, the value supports units, such as "M", "G", etc.

    For example, to set the size to 512 MB:

    And to set the size to 2 GB:

    Configure the InnoDB Redo Log Size in a Configuration File (ES 10.5) and Later

    Starting in MariaDB Enterprise Server 10.5, the size of the InnoDB Redo Log can be changed by setting the system variable in a configuration file.

    To configure the InnoDB Redo Log in a configuration file, use the following procedure:

    1. Choose a configuration file for custom changes to system variables and options.

    It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variable in the configuration file. It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server]. When set in a configuration file, the value supports units, such as "M", "G", etc.

    For example, to set the size to 512 MB:

    And to set the size to 2 GB:

    1. Starting in MariaDB Community Server 10.5, the server must be restarted for the configuration change to take effect:

    1. Starting in MariaDB Enterprise Server 10.5, the server can use the configuration change without a restart if you use .

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    ES 10.5 and Later

    No

    Configure size with SET GLOBAL

    ES 10.5 and Later CS 10.5 and Later

    Yes

    Configure size in configuration file

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    InnoDB Redo Log
    innodb_buffer_pool_size
    innodb_buffer_pool_size
    innodb_log_file_size
    SET GLOBAL
    SET GLOBAL
    innodb_log_file_size
    SET GLOBAL
    innodb_log_file_size
    SET GLOBAL
    innodb_log_file_size
    SHOW GLOBAL VARIABLES
    innodb_log_file_size
    innodb_log_file_size
    innodb_log_file_size
    SET GLOBAL
    $ mariadb --user=root
    SET GLOBAL innodb_log_file_size=(512 * 1024 * 1024);
    SET GLOBAL innodb_log_file_size=(2 * 1024 * 1024 * 1024);
    SHOW GLOBAL VARIABLES
       LIKE 'innodb_log_file_size';
    [mariadb]
    ...
    innodb_log_file_size=512M
    [mariadb]
    ...
    innodb_log_file_size=2G
    [mariadb]
    ...
    innodb_log_file_size=512M
    [mariadb]
    ...
    innodb_log_file_size=2G
    $ sudo systemctl restart mariadb

    Schema Changes

    An overview of supported online schema change operations in InnoDB, detailing which DDL statements can be performed without locking the table.

    Overview

    In MariaDB Enterprise Server, InnoDB supports many different schema change operations. Many of the operations can be performed online with concurrent DML using little or no locking.

    DDL Statements

    InnoDB schema changes are performed using the following DDL statements:

    About InnoDB Schema Changes and Online DDL

    InnoDB schema changes and online DDL are performed with a wide range of statements:

    Each operation supports a subset of the following algorithms: INSTANT, NOCOPY, INPLACE, or COPY.

    By default, InnoDB will use the most efficient algorithm supported by an operation. This behavior can be changed by using the ALGORITHM clause with the statement or by changing the value of the alter_algorithm system variable.

    Each operation supports a subset of the following locking strategies: NONE, SHARED, or EXCLUSIVE.

    By default, InnoDB will use the most permissive locking strategy supported by an operation. This behavior can be changed by using the LOCK clause with the statement.

    Feature
    Detail
    Resources
    DROP INDEX
  • RENAME TABLE

  • Dropping a column

    Yes

    Reordering columns

    Yes

    Changing a column to NULL

    Yes

    Changing a column to NOT NULL

    Yes

    Adding a new ENUM option

    Yes

    Adding a new SET option

    Yes

    Adding system versioning

    Yes

    Removing system versioning

    Yes

    Setting a column's DEFAULT

    Yes

    Removing a column's DEFAULT

    Yes

    Adding a primary key

    Yes

    Dropping a primary key

    Yes

    Adding an index

    Yes

    Dropping an index

    Yes

    Adding a foreign key

    Yes

    Dropping a foreign key

    Yes

    Setting the next AUTO_INCREMENT value

    Yes

    Setting the row format

    Yes

    Setting the block size for the Compressed row format

    Yes

    Enabling page compression

    Yes

    Setting the page compression level

    Yes

    Disabling page compression

    Yes

    Enabling data-at-rest encryption

    Yes

    Setting the encryption key ID

    Yes

    Disabling data-at-rest encryption

    Yes

    Adding a constraint

    Yes

    Dropping a constraint

    Yes

    Rebuilding the table

    Yes

    Renaming the table

    Yes

    Operations support instant algorithm

    Yes

    InnoDB Schema Changes with the INSTANT Algorithm

    Operations support no-copy algorithm

    Yes

    InnoDB Schema Changes with the NOCOPY Algorithm

    Operations support in-place algorithm

    Yes

    InnoDB Schema Changes with the INPLACE Algorithm

    Adding a column

    Yes

    ALTER TABLE
    CREATE INDEX
    CREATE SPATIAL INDEX
    CREATE UNIQUE INDEX
    ALTER TABLE
    ALTER TABLE

    Configure the InnoDB Undo Log

    Learn how to manage InnoDB undo logs in MariaDB Enterprise Server, including moving them to separate tablespaces and enabling truncation.

    Overview

    The InnoDB undo log is a transaction log used by InnoDB to keep track of multiple row versions for multi-version concurrency control (MVCC). When a row's value changes, InnoDB stores old versions of the row in the Undo Log.

    When transactions are committed and the old row versions are no longer necessary, the InnoDB Purge Threads asynchronously delete old row versions from the Undo Log in the background.

    When a transaction is rolled back, InnoDB uses the Undo Log to rollback the transaction's changes.

    For additional information, see "InnoDB Undo Log".

    This page describes how to configure the InnoDB Undo Log.

    Configure InnoDB Undo Log Tablespaces

    By default, the InnoDB undo log is located in the InnoDB system tablespace, which is defined by the system variable. However, it can be helpful to configure separate undo log tablespaces to spread out I/O load between different files or storage devices.

    InnoDB can be configured to use separate undo log tablespaces by setting the system variable. The separate undo log tablespaces will have file names of the format undoN, where N is an integer.

    When you configure separate undo log tablespaces, you can also configure the separate undo log tablespaces to go to a specific directory by setting the system variable. This is most helpful if you want to put the undo log tablespaces on a separate storage device.

    Separate InnoDB undo log tablespaces must be configured prior to the initialization of the server's InnoDB data directory. If you try to configure separate InnoDB undo log tablespaces when the InnoDB data directory has already been initializes, you will see errors in the error log during startup similar to the following:

    To safely configure separate InnoDB undo log tablespaces:

    1. If you have preexisting data, backup your data with .

    2. Ensure that the server is stopped:

    1. Choose a configuration file for custom changes to system variables and options.

    It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variable in the configuration file.

    It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server].

    For example, to set the number of tablespaces to 8:

    1. If you want your InnoDB undo log tablespaces to be in a specific directory, then also set the system variable in the configuration file:

    For example, to set the directory to /innodb/undo:

    1. If you want your InnoDB undo log tablespaces to be in a specific directory, then also create the directory, and give it the proper permissions:

    1. Delete the current contents of the datadir and innodb_data_home_dir.

    For example, if the default value of /var/lib/mysql is used for both:

    1. Reinitialize the data directory using the MariaDB Install DB command.

    2. Start the server:

    1. Connect to the server using MariaDB Client:

    1. If your server had preexisting data, then reload the backup taken at the beginning of the procedure.

    2. Confirm that the configuration changes were properly applied by checking the values of the system variables using the statement:

    1. Consider also enabling undo log truncation to increase performance of the InnoDB Purge Threads.

    Enable InnoDB Undo Log Truncation

    If a server is configured to have 2 or more separate InnoDB undo log files, then InnoDB undo log truncation can be enabled by setting the system variable using the statement. The statement requires the SUPER privilege.

    When InnoDB undo log truncation is enabled, the InnoDB purge threads can truncate an entire undo log at once, rather than individually freeing each rollback segment within the undo log.

    An undo log is truncated when its size exceeds the system variable.

    The frequency at which the InnoDB purge threads check for undo logs to truncate is configured by setting the innodb_purge_rseg_truncate_frequency system variable using the statement.

    To ensure that the changes survive server restarts, the system variables should also be set in a configuration file.

    To enable InnoDB undo log truncation:

    1. Connect to the server using MariaDB Client as the root@localhost user account or another user account with the SUPER privilege:

    1. Set the system variable to ON using the statement.

    For example:

    1. If you would like to change the size at which undo logs are truncated, then also set the system variable to the new size using the statement.

    For example, to set the size to 2 GB:

    1. If you would like the InnoDB purge threads to check the undo logs more frequently, then also set the system variable to a lower value using the statement.

    For example, to configure the purge threads to check the undo logs for truncation every 64 iterations:

    1. Choose a configuration file for custom changes to system variables and options. It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variables in the configuration file. It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server]. When set in a configuration file, the value supports units, such as "M", "G", etc.

    For example:

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    innodb_data_file_path
    innodb_undo_tablespaces
    innodb_undo_directory
    MariaDB Dump
    innodb_undo_tablespaces
    innodb_undo_directory
    SHOW GLOBAL VARIABLES
    innodb_undo_log_truncate
    SET GLOBAL
    SET GLOBAL
    innodb_max_undo_log_size
    SET GLOBAL
    innodb_undo_log_truncate
    SET GLOBAL
    innodb_max_undo_log_size
    SET GLOBAL
    innodb_purge_rseg_truncate_frequency
    SET GLOBAL
    innodb_max_undo_log_size
    [ERROR] InnoDB: Expected to open innodb_undo_tablespaces=8 but was able to find only 0
    [ERROR] InnoDB: Plugin initialization aborted with error Generic error
    $ sudo systemctl stop mariadb
    [mariadb]
    ...
    innodb_undo_tablespaces=8
    [mariadb]
    ...
    innodb_undo_directory=/innodb/undo
    $ sudo mkdir -p /innodb/undo
    $ sudo chown mysql:mysql /innodb/undo
    $ sudo rm -fr /var/lib/mysql/*
    $ sudo systemctl start mariadb
    $ mariadb --user=root
    SHOW GLOBAL VARIABLES
       WHERE Variable_name IN (
          'innodb_undo_tablespaces',
          'innodb_undo_directory'
       );
    +-------------------------+--------------+
    | Variable_name           | Value        |
    +-------------------------+--------------+
    | innodb_undo_directory   | /innodb/undo |
    | innodb_undo_tablespaces | 8            |
    +-------------------------+--------------+
    $ mariadb --user=root
    SET GLOBAL innodb_undo_log_truncate=ON;
    SET GLOBAL innodb_max_undo_log_size=(2 * 1024 * 1024 * 1024);
    SET GLOBAL innodb_purge_rseg_truncate_frequency=64;
    [mariadb]
    ...
    innodb_undo_log_truncate=ON
    innodb_max_undo_log_size=2G
    innodb_purge_rseg_truncate_frequency=64

    InnoDB Schema Changes

    A detailed reference list of specific schema change operations (like adding columns or indexes) and their compatibility with INSTANT, INPLACE, and NOCOPY algorithms.

    MariaDB Enterprise Server InnoDB Schema Changes with the INPLACE Algorithm

    Changes in enterprise databases and applications are inevitable. Schema changes often block other workloads, incur unique production situations that cannot be fully simulated for testing, and may have unpredictable execution times.

    MariaDB Enterprise Server includes the In-place ALTER functionality for the InnoDB storage engine, such that:

    When possible, schema change operations are performed INPLACE, minimizing impact on other workloads.

    When the alter_algorithm system variable is set to INPLACE, schema change operations will not run unless they can be performed INPLACE, minimizing the risk of unpredictable behavior.

    Additional information is available .

    MariaDB Enterprise Server InnoDB Schema Changes with the INSTANT Algorithm

    Changes in enterprise databases and applications are inevitable. Schema changes often block other workloads, incur unique production situations that cannot be fully simulated for testing, and may have unpredictable execution times.

    MariaDB Enterprise Server includes the Instant ALTER functionality for the InnoDB storage engine, such that:

    When possible, schema change operations are performed INSTANT, minimizing impact on other workloads.

    When the alter_algorithm system variable is set to INSTANT, schema change operations will not run unless they can be performed INSTANT, minimizing the risk of unpredictable behavior.

    Additional information is available .

    MariaDB Enterprise Server InnoDB Schema Changes with the NOCOPY Algorithm

    Changes in enterprise databases and applications are inevitable. Schema changes often block other workloads, incur unique production situations that cannot be fully simulated for testing, and may have unpredictable execution times.

    MariaDB Enterprise Server includes the No-copy ALTER functionality for the InnoDB storage engine, such that:

    When possible, schema change operations are performed NOCOPY, minimizing impact on other workloads.

    When the alter_algorithm system variable is set to NOCOPY, schema change operations will not run unless they can be performed NOCOPY, minimizing the risk of unpredictable behavior.

    Additional information is available .

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    here
    here
    here

    Configure the InnoDB Buffer Pool

    A guide to configuring the size and instances of the InnoDB Buffer Pool to optimize memory usage and cache performance.

    Overview

    In MariaDB Enterprise Server, the InnoDB storage engine uses the Buffer Pool as an in-memory cache. The Buffer Pool caches pages that were recently accessed. If a lot of pages are being accessed sequentially, the Buffer Pool also preemptively caches nearby pages. Pages are evicted using a least recently used (LRU) algorithm.

    The contents of the Buffer Pool can be reloaded at startup, so that InnoDB does not have to function with a "cold" cache after a restart. To support this, the page numbers of all pages in the Buffer Pool can be dumped at shutdown. During startup, the page numbers are read from the dump, and InnoDB uses the page numbers to reload each page from its corresponding data file.

    The size of each page in the Buffer Pool depends on the value of the innodb_page_size system variable.

    Starting with ES 10.5 and CS 10.5, the always has a single instance.

    For additional information, see "".

    This page describes how to configure the InnoDB Buffer Pool.

    Configure the InnoDB Buffer Pool Size

    The size of the InnoDB Buffer Pool can be configured by setting the system variable. On ES nodes that exclusively use the InnoDB storage engine, the InnoDB Buffer Pool should usually be between 50%-75% of the memory available.

    Available Memory
    Recommended InnoDB Buffer Pool Size

    The method to configure the Buffer Pool size depends on whether a server restart are performed:

    Product Versions
    Server Restart?
    Method

    Configure the InnoDB Buffer Pool Size with SET GLOBAL

    The size of the InnoDB buffer pool can be changed dynamically by setting the system variable using the statement. The statement requires the SUPER privilege.

    To ensure that the change survives server restarts, the system variable should also be set in a configuration file.

    To configure the InnoDB Buffer Pool with the statement, use the following procedure:

    1. Connect to the server using MariaDB Client as the root@localhost user account or another user account with the SUPER privilege:

    1. Set the system variable to the new size using the statement.

    For example, to set the size to 2 GB:

    1. Confirm that the resize operation has been completed by querying the status variable using the statement:

    1. Choose a configuration file for custom changes to system variables and options. It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variable in the configuration file. It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server]. When set in a configuration file, the value supports units, such as "M", "G", etc.

    For example, to set the size to 2 GB:

    Configure the InnoDB Buffer Pool Size in a Configuration File

    The size of the InnoDB Buffer Pool can be changed by setting the system variable in a configuration file.

    To configure the InnoDB Buffer Pool in a configuration file, use the following procedure:

    1. Choose a configuration file for custom changes to system variables and options. It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after. Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variable in the configuration file.

    It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server].

    When set in a configuration file, the value supports units, such as "M", "G", etc.

    For example, to set the size to 2 GB:

    1. Restart the server:

    The server can use the configuration change without a restart if you use .

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    256 GB

    128-192 GB

    4 GB

    2 GB

    8 GB

    4-8 GB

    16 GB

    8-12 GB

    32 GB

    16-24 GB

    64 GB

    32-56 GB

    128 GB

    Any ES Any CS

    No

    Configure size with SET GLOBA.

    Any ES Any CS

    No

    Configure size in configuration file

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    Buffer Pool
    InnoDB Buffer Pool
    innodb_buffer_pool_size
    innodb_buffer_pool_size
    SET GLOBAL
    SET GLOBAL
    innodb_buffer_pool_size
    SET GLOBAL
    innodb_buffer_pool_size
    SET GLOBAL
    Innodb_buffer_pool_resize_status
    SHOW GLOBAL STATUS
    innodb_buffer_pool_size
    innodb_buffer_pool_size
    innodb_buffer_pool_size
    SET GLOBAL

    64-96 GB

    $ mariadb --user=root
    SET GLOBAL innodb_buffer_pool_size=(2 * 1024 * 1024 * 1024);
    SHOW GLOBAL STATUS
       LIKE 'Innodb_buffer_pool_resize_status';
    +----------------------------------+----------------------------------------------------+
    | Variable_name                    | Value                                              |
    +----------------------------------+----------------------------------------------------+
    | Innodb_buffer_pool_resize_status | Completed resizing buffer pool at 200904 17:49:48. |
    +----------------------------------+----------------------------------------------------+
    [mariadb]
    ...
    innodb_buffer_pool_size=2G
    [mariadb]
    ...
    innodb_buffer_pool_size=2G
    $ sudo systemctl restart mariadb

    Configure the InnoDB I/O Threads

    Instructions on tuning the number of InnoDB read and write I/O threads to match your system's disk I/O capabilities.

    Overview

    The InnoDB Read I/O Threads handle completion of read I/O requests, and the InnoDB Write I/O Threads handle completion of write I/O requests.

    Starting with MariaDB Enterprise Server 10.5 and MariaDB Community Server 10.5, the InnoDB I/O Threads were replaced by the asynchronous I/O functionality in the InnoDB Background Thread Pool.

    For additional information, see "InnoDB I/O Threads".

    This page describes how to configure the InnoDB I/O Threads.

    Configure the Number of InnoDB I/O Threads

    Starting with ES 10.5 and CS 10.5, the InnoDB I/O Threads have been replaced by the asynchronous I/O functionality in the InnoDB Background Thread Pool. In these versions, the and system variables have been repurposed. The value of each system variable is multiplied by 256 to determine the maximum number of concurrent asynchronous I/O requests that can be completed by the Background Thread Pool.

    For example, if innodb_read_io_threads=2 and innodb_write_io_threads=4 are set, InnoDB are restricted to a maximum of 512 concurrent asynchronous read I/O requests and 1024 concurrent asynchronous write I/O requests.

    Interaction with Asynchronous I/O

    When asynchronous I/O is enabled, the InnoDB I/O Threads do not receive the initial I/O request from query threads. Instead, the query threads submit asynchronous I/O requests directly to the operating system, and after the operating system performs the operation, the InnoDB I/O Threads handle completion of the request.

    Asynchronous I/O is enabled by the system variable, which is enabled by default.

    Affected I/O Operations

    The system variable affects completion of the following types of reads:

    • Linear read-ahead (configured by )

    • Random read-ahead (configured by )

    The system variable affects completion of the following types of writes:

    • Page flushing due to adaptive flushing (configured by and )

    • Page flushing due to buffer pool capacity (configured by [innodb_max_dirty_pages_pct] and [)

    • Page flushing due to LRU page evictions (configured by and )

    Configuration Procedure

    The method to configure the number of I/O threads depends on the server version and whether a server restart are performed:

    Product Versions
    Server Restart?
    Method

    Configure InnoDB's Maximum Number of Asynchronous I/O Requests with SET GLOBAL (ES 10.5) and Later

    Starting with , InnoDB's maximum number of asynchronous I/O requests can be changed dynamically by setting the system variables using the statement. The statement requires the SUPER privilege.

    The value of each system variable is multiplied by 256 to determine the maximum number of asynchronous I/O requests that can be performed by the Background Thread Pool. For example, if you want to allow a maximum of 1024 concurrent asynchronous write I/O requests, the system variable should be set to 4 (since 1024/256=4).

    To ensure that the change survives server restarts, the system variables should also be set in a configuration file.

    To configure InnoDB's maximum number of asynchronous I/O requests with the statement, use the following procedure:

    1. Connect to the server using MariaDB Client as the root@localhost user account or another user account with the SUPER privilege:

    1. Set the and system variables to the new values using the statement.

    For example:

    1. Choose a configuration file for custom changes to system variables and options.

    It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the and system variables in the configuration file.

    It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server].

    For example:

    Configure the Number of InnoDB I/O Threads in a Configuration File

    The number of I/O threads is configured by the and system variables.

    To configure the number of InnoDB I/O Threads in a configuration file, use the following procedure:

    1. Choose a configuration file for custom changes to system variables and options.

    It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the and system variables in the configuration file.

    It needs to be set in a group that are read by , such as [mariadb] or [server].

    For example:

    1. Restart the server:

    Starting with , the server can use the configuration change without a restart if you use .

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    ES 10.5 and Later

    No

    Configure maximum number of asynchronous I/O requests with SET GLOBAL

    Any ES Any CS

    Yes.

    Configure number of I/O threads in configuration file

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    innodb_read_io_threads
    innodb_write_io_threads
    innodb_use_native_aio
    innodb_read_io_threads
    innodb_read_ahead_threshold
    innodb_random_read_ahead
    innodb_write_io_threads
    innodb_adaptive_flushing
    innodb_adaptive_flushing_lwm
    innodb-system-variables/#innodb_max_dirty_pages_pct_lwm|innodb_max_dirty_pages_pct_lwm
    innodb_lru_flush_size
    innodb_lru_scan_depth
    innodb_read_io_threads
    innodb_write_io_threads
    SET GLOBAL
    SET GLOBAL
    innodb_write_io_threads
    innodb_read_io_threads
    innodb_write_io_threads
    SET GLOBAL
    innodb_read_io_threads
    innodb_write_io_threads
    SET GLOBAL
    innodb_read_io_threads
    innodb_write_io_threads
    innodb_read_io_threads
    innodb_write_io_threads
    innodb_read_io_threads
    innodb_write_io_threads
    MariaDB Server
    SET GLOBAL
    MariaDB Enterprise Server 10.5
    MariaDB Enterprise Server 10.5
    $ mariadb --user=root
    SET GLOBAL innodb_read_io_threads=8;
    SET GLOBAL innodb_write_io_threads=8;
    [mariadb]
    ...
    innodb_read_io_threads=8
    innodb_write_io_threads=8
    [mariadb]
    ...
    innodb_read_io_threads=8
    innodb_write_io_threads=8
    $ sudo systemctl restart mariadb

    Configure the InnoDB Purge Threads

    Learn how to adjust the number of background purge threads to efficiently manage undo logs and prevent history list growth.

    Overview

    In MariaDB Enterprise Server, the InnoDB storage engine uses Purge Threads to perform garbage collection in the background. The Purge Threads are related to multi-version concurrency control (MVCC).

    The Purge Threads perform garbage collection of various items:

    The Purge Threads perform garbage collection of the InnoDB Undo Log. When a row is updated in the clustered index, InnoDB updates the values in the clustered index, and the old row version is added to the Undo Log. The Purge Threads scan the Undo Log for row versions that are not needed by open transactions and permanently delete them.

    The Purge Threads perform garbage collection of index records. When an indexed column is updated, InnoDB creates a new index record for the updated value in each affected index, and the old index records are delete-marked. When the primary key column is updated, InnoDB creates a new index record for the updated value in every index, and each old index record is delete-marked. The Purge Threads scan for delete-marked index records and permanently delete them.

    The Purge Threads perform garbage collection of freed overflow pages. , , , , , and related types are sometimes stored on overflow pages. When the value on the overflow page is deleted or updated, the overflow page is no longer needed. The Purge Threads delete these freed overflow pages.

    For additional information, see "".

    This page describes how to configure the InnoDB Purge Threads.

    Configure the Number of InnoDB Purge Threads

    The number of the InnoDB Purge Threads is configurable. If your server deletes or updates rows at a very high frequency, then you may need to increase the number of purge threads.

    The method to configure the number of Purge Threads depends on the server version and whether a server restart are performed:

    Product Versions
    Server Restart?
    Method

    Configure the Number of InnoDB Purge Threads with SET GLOBAL

    This feature is available from MariaDB Enterprise Server 10.5.

    The number of InnoDB purge threads can be changed dynamically by setting the system variable using the statement. The statement requires the SUPER privilege.

    To ensure that the change survives server restarts, the system variable should also be set in a configuration file.

    To configure the number of InnoDB Purge threads with the statement, use the following procedure:

    1. Connect to the server using as the root@localhost user account or another user account with the SUPER privilege:

    1. Set the system variable to the new size using the statement.

    For example:

    1. Choose a configuration file for custom changes to system variables and options. It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the system variable in the configuration file. It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server].

    For example:

    Configure the Number of InnoDB Purge Threads in a Configuration File

    The number of InnoDB Purge Threads can be configured by setting the system variable in a configuration file.

    To configure the number of in a configuration file, use the following procedure:

    1. Choose a configuration file for custom changes to system variables and options. It is not recommended to make custom changes to Enterprise Server's default configuration files, because your custom changes can be overwritten by other default configuration files that are loaded after.

    2. Ensure that your custom changes are read last by creating a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. Ensure that your custom configuration file is read last by using the z- prefix in the file name.

    Some example configuration file paths for different distributions are shown in the following table:

    Distributions
    Example configuration file path
    1. Set the innodb_purge_threads system variable in the configuration file. It needs to be set in a group that are read by MariaDB Server, such as [mariadb] or [server].

    For example:

    1. Restart the server:

    The server can use the configuration change without a restart if you use .

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    ES 10.5 and Later

    No

    Configure maximum number of asynchronous I/O requests with SET GLOBAL

    Any ES Any CS

    Yes.

    Configure number of I/O threads in configuration file

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    CentOS RHEL Rocky Linux SLES

    /etc/my.cnf.d/z-custom-mariadb.cnf

    Debian Ubuntu

    /etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf

    BLOB
    CHAR
    TEXT
    VARCHAR
    VARBINARY
    InnoDB Purge Threads
    innodb_purge_threads
    SET GLOBAL
    SET GLOBAL
    innodb_purge_threads
    SET GLOBAL
    MariaDB Client
    innodb_purge_threads
    SET GLOBAL
    innodb_purge_threads
    innodb_purge_threads
    innodb_purge_threads
    SET GLOBAL
    $ mariadb --user=root
    SET GLOBAL innodb_purge_threads=8;
    [mariadb]
    ...
    innodb_purge_threads=8
    [mariadb]
    ...
    innodb_purge_threads=8
    $ sudo systemctl restart mariadb