All pages
Powered by GitBook
1 of 56

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

InnoDB

Discover InnoDB, the default storage engine for MariaDB Server. Learn about its transaction-safe capabilities, foreign key support, and high performance for demanding workloads.

InnoDB Doublewrite Buffer

The doublewrite buffer is a storage area where InnoDB writes pages before writing them to the data file, preventing data corruption from partial page writes.

The InnoDB doublewrite buffer was implemented to recover from half-written pages. This can happen when there's a power failure while InnoDB is writing a page to disk. On reading that page, InnoDB can discover the corruption from the mismatch of the page checksum. However, in order to recover, an intact copy of the page would be needed.

The double write buffer provides such a copy.

Whenever InnoDB flushes a page to disk, it is first written to the double write buffer. Only when the buffer is safely flushed to disk will InnoDB write the page to the final destination. When recovering, InnoDB scans the double write buffer and for each valid page in the buffer checks if the page in the data file is valid too.

Doublewrite Buffer Settings

To turn off the doublewrite buffer, set the system variable to 0. This is safe on filesystems that write pages atomically - that is, a page write fully succeeds or fails. But with other filesystems, it is not recommended for production systems. An alternative option is atomic writes. See for more details.

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

innodb_doublewrite
atomic write support

InnoDB Monitors

InnoDB Monitors, such as the Standard, Lock, and Tablespace monitors, provide detailed internal state information to the error log for diagnostics.

The InnoDB Monitor refers to particular kinds of monitors included in MariaDB and since the early versions of MySQL.

There are four types: the standard InnoDB monitor, the InnoDB Lock Monitor, InnoDB Tablespace Monitor and the InnoDB Table Monitor.

Standard InnoDB Monitor

The standard InnoDB Monitor returns extensive InnoDB information, particularly lock, semaphore, I/O and buffer activity:

To enable the standard InnoDB Monitor, from , set the innodb_status_output system variable to 1. Before , running the following statement was the method used:

To disable the standard InnoDB monitor, either set the system variable to zero, or, before , drop the table

The CREATE TABLE and DROP TABLE method of enabling and disabling the InnoDB Monitor has been deprecated, and may be removed in a future version of MariaDB.

For a description of the output, see .

InnoDB Lock Monitor

The InnoDB Lock Monitor displays additional lock information.

To enable the InnoDB Lock Monitor, the standard InnoDB monitor must be enabled. Then, from , set the system variable to 1. Before , running the following statement was the method used:

To disable the standard InnoDB monitor, either set the system variable to zero, or, before , drop the table

The CREATE TABLE and DROP TABLE method of enabling and disabling the InnoDB Lock Monitor has been deprecated, and may be removed in a future version of MariaDB.

InnoDB Tablespace Monitor

The InnoDB Tablespace Monitor is deprecated, and may be removed in a future version of MariaDB.

Enabling the Tablespace Monitor outputs a list of file segments in the shared tablespace to the error log, and validates the tablespace allocation data structures.

To enable the Tablespace Monitor, run the following statement:

To disable it, drop the table:

InnoDB Table Monitor

The InnoDB Table Monitor is deprecated, and may be removed in a future version of MariaDB.

Enabling the Table Monitor outputs the contents of the InnoDB internal data dictionary to the error log every fifteen seconds.

To enable the Table Monitor, run the following statement:

To disable it, drop the table:

SHOW ENGINE INNODB STATUS

The statement can be used to obtain the standard InnoDB Monitor output when required, rather than sending it to the error log. It will also display the InnoDB Lock Monitor information if the system variable is set to 1.

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

Binary Log Group Commit and InnoDB Flushing Performance

Understand how group commit works with InnoDB to improve performance by reducing the number of disk syncs required during transaction commits.

Overview

When both innodb_flush_log_at_trx_commit=1 (the default) is set and the binary log is enabled, there is now one less sync to disk inside InnoDB during commit (2 syncs shared between a group of transactions instead of 3).

Durability of commits is not decreased — this is because even if the server crashes before the commit is written to disk by InnoDB, it are recovered from the binary log at next server startup (and it is guaranteed that sufficient information is synced to disk so that such a recovery is always possible).

Switching to Old Flushing Behavior

The old behavior, with 3 syncs to disk per (group) commit (and consequently lower performance), can be selected with the new option. There is normally no benefit to doing this, however there are a couple of edge cases to be aware of.

Non-durable Binary Log Settings

If is set and the is enabled, but is set, then commits are not guaranteed durable inside InnoDB after commit. This is because if is set and if the server crashes, then transactions that were not flushed to the binary log prior to the crash are missing from the binary log.

In this specific scenario, can be set to ensure that transactions are durable in InnoDB, even if they are not necessarily durable from the perspective of the binary log.

One should be aware that if is set, then a crash is nevertheless likely to cause transactions to be missing from the binary log. This will cause the binary log and InnoDB to be inconsistent with each other. This is also likely to cause any to become inconsistent, since transactions are replicated through the . Thus it is recommended to set . With the improvements introduced in , this setting has much less penalty in recent versions compared to older versions of MariaDB and MySQL.

Recent Transactions Missing from Backups

and only see transactions that have been flushed to the . With the improvements, there may be a small delay (defined by the system variable) between when a commit happens and when the commit are included in a backup.

Note that the backup will still be fully consistent with itself and the . This problem is normally not an issue in practice. A backup usually takes a long time to complete (relative to the 1 second or so that is normally set to), and a backup usually includes a lot of transactions that were committed during the backup. With this in mind, it is not generally noticeable if the backup does not include transactions that were committed during the last 1 second or so of the backup process. It is just mentioned here for completeness.

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

MariaDB Enterprise Server InnoDB I/O Threads

Learn about the specialized I/O threads in MariaDB Enterprise Server's InnoDB engine that handle asynchronous read and write operations efficiently.

Overview

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.

Feature Summary

Feature
Detail
Resources

Basic Configuration

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

InnoDB Data Scrubbing

This feature allows for the secure deletion of data by overwriting deleted records in tablespaces and logs to prevent data recovery.

Most of the background and redo log scrubbing code has been removed in . See and .

Sometimes there is a requirement that when some data is deleted, it is really gone. This might be the case when one stores user's personal information or some other sensitive data. Normally though, when a row is deleted, the space is only marked as free on the page. It may eventually be overwritten, but there is no guarantee when that will happen. A copy of the deleted rows may also be present in the log files.

Support for data scrubbing: Background threads periodically scan tablespaces and logs and remove all data that should be deleted. The number of background threads for tablespace scans is set by . Log scrubbing happens in a separate thread.

To configure scrubbing one can use the following variables:

InnoDB File Format

Learn about the different file formats supported by InnoDB, such as Antelope and Barracuda, and how they impact table features and storage.

Setting a Table's File Format

A table's tablespace is tagged with the lowest InnoDB file format that supports the table's . So, even if the Barracuda file format is enabled, tables that use the COMPACT or REDUNDANT row formats are tagged with the Antelope file format in the table.

InnoDB Introduction

An overview of the InnoDB storage engine, detailing its support for ACID transactions, row-level locking, and crash recovery.

Overview

MariaDB Enterprise Server uses the InnoDB storage engine by default. InnoDB is a general purpose transactional storage engine that is performant, ACID-compliant, and well-suited for most workloads.

Benefits

InnoDB Lock Modes

InnoDB employs Row-Level Locking with Shared (S) and Exclusive (X) locks, along with Intention locks, to manage concurrent transaction access.

Locks are acquired by a transaction to prevent concurrent transactions from modifying, or even reading, some rows or ranges of rows. This is done to make sure that concurrent write operations never collide.

supports a number of lock modes.

Shared and Exclusive Locks

The two standard row-level locks are share locks(S) and exclusive locks(X).

A shared lock is obtained to read a row, and allows other transactions to read the locked row, but not to write to the locked row. Other transactions may also acquire their own shared locks.

CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;

InnoDB Troubleshooting

Troubleshoot InnoDB issues in MariaDB Server. Find solutions and best practices for common problems, ensuring your InnoDB-based applications run smoothly and efficiently.

InnoDB Row Formats

Explore InnoDB row formats in MariaDB Server. Understand different formats like Compact, Dynamic, and Compressed, and how they impact storage efficiency and performance for your data.

InnoDB Tablespaces

Manage InnoDB tablespaces in MariaDB Server. Understand their role in data organization, performance, and recovery, including file-per-table and shared tablespaces.

Quantity

Set by and

Thread

InnoDB I/O Threads

Storage Engine

InnoDB

Purpose

Reading data from disk / Writing data to disk

Availability

MariaDB Enterprise Server

Seconds

Check at this intervall if tablespaces needs scrubbing. Deprecated and ignored.

Boolean

Enable scrubbing of compressed data by background threads. Deprecated and ignored.

Seconds

Scrub spaces that were last scrubbed longer than this many seconds ago. Deprecated and ignored.

Boolean

Enable scrubbing of uncompressed data by background threads. Deprecated and ignored.

Boolean

Enable scrubbing of uncompressed data.

Redo log scrubbing did not fully work as intended, and was deprecated and ignored in (MDEV-21870). If old log contents should be kept secret, enabling innodb_encrypt_log or setting a smaller innodb_log_file_size could help.

The Information Schema INNODB_TABLESPACES_SCRUBBING table contains scrubbing information.

Thanks

  • Scrubbing was donated to the MariaDB project by Google.

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

MDEV-15528
MDEV-21870
InnoDB
innodb-encryption-threads
Supported File Formats

The InnoDB storage engine supports two different file formats:

  • Antelope

  • Barracuda

Antelope

In and before, the default file format is Antelope. In and later, the Antelope file format is deprecated.

Antelope is the original InnoDB file format. It supports the COMPACT and REDUNDANT row formats, but not the DYNAMIC or COMPRESSED row formats.

Barracuda

In and before, the Barracuda file format is only supported if the innodb_file_per_table system variable is set to ON. In and later, the default file format is Barracuda and Antelope is deprecated.

Barracuda is a newer InnoDB file format. It supports the COMPACT, REDUNDANT, DYNAMIC and COMPRESSED row formats. Tables with large BLOB or TEXT columns in particular could benefit from the dynamic row format.

Future Formats

InnoDB might use new file formats in the future. Each format will have an identifier from 0 to 25, and a name. The names have already been decided, and are animal names listed in an alphabetical order: Antelope, Barracuda, Cheetah, Dragon, Elk, Fox, Gazelle, Hornet, Impala, Jaguar, Kangaroo, Leopard, Moose, Nautilus, Ocelot, Porpoise, Quail, Rabbit, Shark, Tiger, Urchin, Viper, Whale, Xenops, Yak and Zebra.

Checking a Table's File Format.

The information_schema.INNODB_SYS_TABLES table can be queried to see the file format used by a table.

A table's tablespace is tagged with the lowest InnoDB file format that supports the table's row format. So, even if the Barracuda file format is enabled, tables that use the COMPACT or REDUNDANT row formats are tagged with the Antelope file format in the information_schema.INNODB_SYS_TABLES table.

Compatibility

Each tablespace is tagged with the id of the most recent file format used by one of its tables. All versions of InnoDB can read tables that use an older file format. However, it can not read from more recent formats. For this reason, each time InnoDB opens a table it checks the tablespace's format, and returns an error if a newer format is used.

This check can be skipped via the innodb_file_format_check variable. Beware that, is InnoDB tries to repair a table in an unknown format, the table are corrupted! This happens on restart if innodb_file_format_check is disabled and the server crashed, or it was closed with fast shutdown.

To downgrade a table from the Barracuda format to Antelope, the table's ROW_FORMAT can be set to a value supported by Antelope, via an ALTER TABLE statement. This recreates the indexes.

The Antelope format can be used to make sure that tables work on MariaDB and MySQL servers which are older than 5.5.

See Also

  • InnoDB Storage Formats

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

row format
information_schema.INNODB_SYS_TABLES
The InnoDB storage engine:
  • Is available with all versions of and MariaDB Community Server.

  • Is a general purpose storage engine.

  • Is transactional and well-suited for online transactional processing (OLTP) workloads.

  • Is ACID-compliant.

  • Performs well for mixed read-write workloads.

  • Supports online DDL.

Feature Summary

Feature
Detail
Resources

Storage Engine

InnoDB

Availability

All ES and CS versions

Workload Optimization

Transactional

Table Orientation

Row

Examples

Creating an InnoDB Table

Resources

Architecture

  • Background Thread Pool

  • Buffer Pool

  • I/O Threads

  • Purge Threads

Operations

  • Configure Page Compression

  • Configure the Buffer Pool

  • Configure the I/O Threads

  • Configure the Purge Threads

MariaDB documentation

  • InnoDB

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

An exclusive lock is obtained to write to a row, and stops other transactions from locking the same row. It's specific behavior depends on the isolation level; the default (REPEATABLE READ), allows other transactions to read from the exclusively locked row.

Intention Locks

InnoDB also permits table locking, and to allow locking at both table and row level to co-exist gracefully, a series of locks called intention locks exist.

An intention shared lock(IS) indicates that a transaction intends to set a shared lock.

An intention exclusive lock(IX) indicates that a transaction intends to set an exclusive lock.

Whether a lock is granted or not can be summarised as follows:

  • An X lock is not granted if any other lock (X, S, IX, IS) is held.

  • An S lock is not granted if an X or IX lock is held. It is granted if an S or IS lock is held.

  • An IX lock is not granted if in X or S lock is held. It is granted if an IX or IS lock is held.

  • An IS lock is not granted if an X lock is held. It is granted if an S, IX or IS lock is held.

AUTO_INCREMENT Locks

Locks are also required for auto-increments - see AUTO_INCREMENT handling in InnoDB.

Gap Locks

With the default isolation level, REPEATABLE READ, and, until , the default setting of the innodb_locks_unsafe_for_binlog variable, a method called gap locking is used. When InnoDB sets a shared or exclusive lock on a record, it's actually on the index record. Records will have an internal InnoDB index even if they don't have a unique index defined. At the same time, a lock is held on the gap before the index record, so that another transaction cannot insert a new index record in the gap between the record and the preceding record.

The gap can be a single index value, multiple index values, or not exist at all depending on the contents of the index.

If a statement uses all the columns of a unique index to search for unique row, gap locking is not used.

Similar to the shared and exclusive intention locks described above, there can be a number of types of gap locks. These include the shared gap lock, exclusive gap lock, intention shared gap lock and intention exclusive gap lock.

Gap locks are disabled if the innodb_locks_unsafe_for_binlog system variable is set (until ), or the isolation level is set to READ COMMITTED.

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

InnoDB
SHOW ENGINE INNODB STATUS
innodb_status_output_locks
SHOW ENGINE INNODB STATUS
innodb_status_output_locks
innodb_flush_log_at_trx_commit=3
innodb_flush_log_at_trx_commit=1
binary log
sync_binlog=0
sync_binlog=0
innodb_flush_log_at_trx_commit=3
sync_binlog=0
replication slaves
binary log
sync_binlog=1
group commit
mariadb-backup
Percona XtraBackup
redo log
group commit
binlog_commit_wait_usec
binary log
binlog_commit_wait_usec

InnoDB Change Buffering

Learn about the change buffer, an optimization that delays secondary index writes to reduce I/O overhead for non-unique index modifications.

The change buffer has been disabled by default from , MariaDB 10.6.7, and (MDEV-27734), was deprecated and ignored from (MDEV-27735), and was removed in (MDEV-29694).

Benchmarks attached to MDEV-19514 show that the change buffer sometimes reduces performance, and in the best case seem to bring a few per cent improvement to throughput. However, such improvement could come with a price: If the buffered changes are never merged (MDEV-19514, motivated by the reduction of random crashes and the removal of an innodb_force_recovery option that can inflict further corruption), then the InnoDB system tablespace can grow out of control (MDEV-21952).

INSERT, UPDATE, and DELETE statements can be particularly heavy operations to perform, as all indexes need to be updated after each change. For this reason these changes are often buffered.

Pages are modified in the , and not immediately on disk. After all the records that cover the changes to a data page have been written to the InnoDB redo log, the changed page may be written (''flushed'') to a data file. Pages that have been modified in memory and not yet flushed are called dirty pages.

The Change Buffer is an optimization that allows some data to be modified even though the data page does not exist in the buffer pool. Instead of modifying the data in its final destination, we would insert a record into a special Change Buffer that resides in the system tablespace. When the page is read into the buffer pool for any reason, the buffered changes are applied to it.

The Change Buffer only contains changes to secondary index leaf pages.

In the days of old, only inserted rows could be buffered, so this buffer was called Insert Buffer. The old name still appears in several places, for example in the output of .

Inserts to UNIQUE secondary indexes cannot be buffered unless is used. This may sometimes allow duplicates to be inserted into the UNIQUE secondary index. Much of the time, the UNIQUE constraint would be checked because the change buffer could only be used if the index page is not located in the buffer pool.

When rows are deleted, a flag is set, thus rows are not immediately deleted. Delete-marked records may be purged after the transaction has been committed and any read views that were created before the commit have been closed. Delete-mark and purge buffering of any secondary indexes is allowed.

ROLLBACK never makes use of the change buffer; it would force a merge of any changes that were buffered during the execution of the transaction.

The Change Buffer is an optimization because:

  • Some random-access page reads are transformed into modifications of change buffer pages.

  • A change buffer page can be modified several times in memory and be flushed to disk only once.

  • Dirty pages are flushed together, so the number of IO operations is lower.

If the server crashes or is shut down, the Change Buffer might not be empty. The Change Buffer resides in the InnoDB system tablespace, covered by the write-ahead log, so they can be applied at server restart. A shutdown with will merge all buffered changes.

There is no background task that merges the change buffer to the secondary index pages. Changes are only merged on demand.

The Change Buffer was removed in because it has been a prominent source of corruption bugs that have been extremely hard to reproduce.

The main server system variable here is , which determines which form of change buffering, if any, to use.

The following settings are available:

  • inserts

    • Only buffer insert operations

  • deletes

    • Only buffer delete operations

Modifying the value of this variable only affects the buffering of new operations. The merging of already buffered changes is not affected.

The system variable determines the maximum size of the change buffer, expressed as a percentage of the buffer pool.

See Also

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

InnoDB Page Flushing

Learn about the background processes that flush dirty pages from the buffer pool to disk, including adaptive flushing algorithms to optimize I/O.

Page Flushing with InnoDB Page Cleaner Threads

InnoDB page cleaner threads flush dirty pages from the InnoDB buffer pool. These dirty pages are flushed using a least-recently used (LRU) algorithm.

innodb_max_dirty_pages_pct

The variable specifies the maximum percentage of unwritten (dirty) pages in the . If this percentage is exceeded, flushing will take place.

innodb_max_dirty_pages_pct_lwm

The variable determines the low-water mark percentage of dirty pages that will enable preflushing to lower the dirty page ratio. The value 0 (the default) means that there are no separate background flushing so long as:

  • the share of dirty pages does not exceed

  • the last checkpoint age (LSN difference since the latest checkpoint) does not exceed (minus some safety margin)

  • the is not running out of space, which could trigger eviction flushing

To make flushing more eager, set to a higher value, for example SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.001;

Page Flushing with Multiple InnoDB Page Cleaner Threads

The system variable makes it possible to use multiple InnoDB page cleaner threads. It is deprecated and ignored now as the original reasons for splitting the buffer pool have mostly gone away.

The number of InnoDB page cleaner threads can be configured by setting the system variable. The system variable can be set in a server in an prior to starting up the server:

The system variable can be changed dynamically with :

This system variable's default value is either 4 or the configured value of the system variable, whichever is lower.

Page Flushing with a Single InnoDB Page Cleaner Thread

Since the original reasons for splitting the buffer pool have mostly gone away, only a single InnoDB page cleaner thread is supported.

Page Flushing with Multi-threaded Flush Threads

InnoDB's multi-thread flush feature can be enabled by setting the system variable. The number of threads cane be configured by setting the system variable. This system variable can be set in a server in an prior to starting up the server:

The system variable's default value is 8. The maximum value is 64. In multi-core systems, it is recommended to set its value close to the configured value of the system variable. However, it is also recommended to use your own benchmarks to find a suitable value for your particular application.

Note

InnoDB's multi-thread flush feature is deprecated. Use multiple InnoDB page cleaner threads instead.

Configuring the InnoDB I/O Capacity

Increasing the amount of I/O capacity available to InnoDB can also help increase the performance of page flushing.

The amount of I/O capacity available to InnoDB can be configured by setting the system variable. This system variable can be changed dynamically with :

This system variable can also be set in a server in an prior to starting up the server:

The maximum amount of I/O capacity available to InnoDB in an emergency defaults to either 2000 or twice , whichever is higher, or can be directly configured by setting the system variable. This system variable can be changed dynamically with :

This system variable can also be set in a server in an prior to starting up the server:

See Also

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

AUTO_INCREMENT Handling in InnoDB

This page explains how InnoDB manages AUTO_INCREMENT columns, including initialization behavior, gap handling, and potential restart effects.

AUTO_INCREMENT Lock Modes

The system variable determines the lock mode when generating values for tables. These modes allow to make significant performance optimizations in certain circumstances.

The system variable may be removed in a future release. See for more information.

InnoDB Buffer Pool

A comprehensive guide to the InnoDB Buffer Pool, the key memory area for caching data and indexes, including configuration and resizing tips.

The InnoDB storage engine in MariaDB Enterprise Server utilizes the Buffer Pool as a crucial in-memory cache. This Buffer Pool stores recently accessed data pages, enabling faster retrieval for subsequent requests. Recognizing patterns of access, InnoDB also employs predictive prefetching, caching nearby pages when sequential access is detected. To manage memory efficiently, a least recently used (LRU) algorithm is used to evict older, less frequently accessed pages.

To optimize server restarts, the Buffer Pool's contents can be preserved across shutdowns. At shutdown, the page numbers of all pages residing in the Buffer Pool are recorded. Upon the next startup, InnoDB reads this dump of page numbers and reloads the corresponding data pages from their respective data files, effectively avoiding a "cold" cache scenario.

The size of each individual page within the Buffer Pool is determined by the setting of the innodb_page_size system variable.

InnoDB Asynchronous I/O

Explore how InnoDB uses asynchronous I/O on various operating systems to handle multiple read and write requests concurrently without blocking.

From , uses asynchronous I/O to read from and write to disk asynchronously. This forms part of the InnoDB Background Thread Pool.

Stages

Each asynchronous IO operation goes through multiple stages:

  1. SUBMITTED – The IO operation is initiated.

[mariadb]
...
innodb_read_io_threads=8
innodb_write_io_threads=8
SET GLOBAL innodb_read_io_threads=8;
SET GLOBAL innodb_write_io_threads=8;

SHOW GLOBAL VARIABLES
   LIKE 'innodb_%_io_threads';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| innodb_read_io_threads  | 8     |
| innodb_write_io_threads | 8     |
+-------------------------+-------+
CREATE DATABASE hq_sales;
CREATE TABLE hq_sales.invoices (
   invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
   branch_id INT NOT NULL,
   customer_id INT,
   invoice_date DATETIME(6),
   invoice_total DECIMAL(13, 2),
   payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
   PRIMARY KEY(invoice_id)
) ENGINE = InnoDB;
SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA='hq_sales'
AND TABLE_NAME='invoices';
+--------------+------------+--------+
| TABLE_SCHEMA | TABLE_NAME | ENGINE |
+--------------+------------+--------+
| hq_sales     | invoices   | InnoDB |
+--------------+------------+--------+
DROP TABLE innodb_monitor;
CREATE TABLE innodb_lock_monitor (a INT) ENGINE=INNODB;
DROP TABLE innodb_lock_monitor;
CREATE TABLE innodb_tablespace_monitor (a INT) ENGINE=INNODB;
DROP TABLE innodb_tablespace_monitor;
CREATE TABLE innodb_table_monitor (a INT) ENGINE=INNODB;
DROP TABLE innodb_table_monitor;

InnoDB Architecture for MariaDB Enterprise Server

Understand InnoDB's architecture for MariaDB Enterprise Server. This section details its components and their interactions, focusing on performance, scalability, and reliability for enterprise workloa

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_read_io_threads
innodb_write_io_threads
Configure the InnoDB I/O Threads
How the Buffer Pool Works

The buffer pool attempts to keep frequently-used blocks in the buffer, and so essentially works as two sublists, a new sublist of recently-used information, and an old sublist of older information. By default, 37% of the list is reserved for the old list.

When new information is accessed that doesn't appear in the list, it is placed at the top of the old list, the oldest item in the old list is removed, and everything else bumps back one position in the list.

When information is accessed that appears in the old list, it is moved to the top the new list, and everything above moves back one position.

innodb_buffer_pool_size

The most important server system variable is innodb_buffer_pool_size. This size should contain most of the active data set of your server so that SQL request can work directly with information in the buffer pool cache. Starting at several gigabytes of memory is a good starting point if you have that RAM available. Once warmed up to its normal load there should be very few innodb_buffer_pool_reads compared to innodb_buffer_pool_read_requests. Look how these values change over a minute. If the change in innodb_buffer_pool_reads is less than 1% of the change in innodb_buffer_pool_read_requests then you have a good amount of usage. If you are getting the status variable innodb_buffer_pool_wait_free increasing then you don't have enough buffer pool (or your flushing isn't occurring frequently enough).

The larger the size, the longer it takes to initialize. On a 64-bit server with a 10GB memory pool, this can take five seconds or longer.

Make sure that the size is not too large, because this can cause swapping, which more than undoes the benefits of a large buffer pool.

The buffer pool can be set dynamically. See Setting Innodb Buffer Pool Size Dynamically.

Buffer Pool Changes

From MariaDB 10.11.12 / 11.4.6 / 11.8.2, there are significant changes to the InnoDB buffer pool behavior.

MariaDB server deprecates and ignores the innodb_buffer_pool_chunk_size . Now, the buffer pool size is changed in arbitrary 1-megabyte increments, all the way up to innodb_buffer_pool_size_max, which must be specified at startup.

If innodb_buffer_pool_size_max is 0 or not specified, it defaults to the innodb_buffer_pool_size value.

The innodb_buffer_pool_size_auto_min variable specifies the minimum size the buffer pool can be shrunk to by a memory pressure event. When a memory pressure event occurs, MariaDB server attempts to shrink innodb_buffer_pool_size halfway between its current value and the innodb_buffer_pool_size_auto_min value. If innodb_buffer_pool_size_auto_min is not specified or 0, its default value is adjusted to innodb_buffer_pool_size — in other words, memory pressure events are disregarded by default.

The minimum innodb_buffer_pool_size is 320 pages (256*5/4). With the default value of innodb_page_size=16k, this corresponds to 5 MiB. However, since innodb_buffer_pool_size includes the memory allocated for the block descriptors, the minimum is effectively innodb_buffer_pool_size=6m.

When the buffer pool is shrunk, InnoDB tries to inform the operating system that the underlying memory for part of the virtual address range is no longer needed and may be zeroed out. On many POSIX-like systems this is done by madvise(MADV_DONTNEED) where available (Linux, FreeBSD, NetBSD, OpenBSD, Dragonfly BSD, IBM AIX, Apple macOS). On Microsoft Windows, VirtualFree(MEM_DECOMMIT) is invoked. On many systems, there is also MADV_FREE, which would be a deferred variant of MADV_DONTNEED, not freeing the virtual memory mapping immediately. We prefer immediate freeing so that the resident set size of the process reflects the current innodb_buffer_pool_size value. Shrinking the buffer pool is a rarely executed intensive operation, and the immediate configuration of the MMU mappings should not incur significant additional penalty.

The Innodb_buffer_pool_resize_status variable is removed. Issuing SET GLOBAL innodb_buffer_pool_size blocks until the buffer pool has been resized or the operation was aborted by a KILL or SHUTDOWN command, a client disconnect, or an interrupt.

innodb_old_blocks_pct and innodb_old_blocks_time

The default 37% reserved for the old list can be adjusted by changing the value of innodb_old_blocks_pct. It can accept anything between 5% and 95%.

The innodb_old_blocks_time variable specifies the delay before a block can be moved from the old to the new sublist. 0 means no delay, while the default has been set to 1000.

Before changing either of these values from their defaults, make sure you understand the impact and how your system currently uses the buffer. Their main reason for existence is to reduce the impact of full table scans, which are usually infrequent, but large, and previously could clear everything from the buffer. Setting a non-zero delay could help in situations where full table scans are performed in quick succession.

Temporarily changing these values can also be useful to avoid the negative impact of a full table scan, as explained in InnoDB logical backups.

Dumping and Restoring the Buffer Pool

When the server starts, the buffer pool is empty. As it starts to access data, the buffer pool will slowly be populated. As more data are accessed, the most frequently accessed data are put into the buffer pool, and old data may be evicted. This means that a certain period of time is necessary before the buffer pool is really useful. This period of time is called the warmup.

InnoDB can dump the buffer pool before the server shuts down, and restore it when it starts again. If this feature is used, no warmup is necessary. Use the innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_at_startup system variables to enable or disable the buffer pool dump at shutdown and the restore at startup respectively.

It is also possible to dump the InnoDB buffer pool at any moment while the server is running, and it is possible to restore the last buffer pool dump at any moment. To do this, the special innodb_buffer_pool_dump_now and innodb_buffer_pool_load_now system variables can be set to ON. When selected, their value is always OFF.

A buffer pool restore, both at startup or at any other moment, can be aborted by setting innodb_buffer_pool_load_abort to ON.

The file which contains the buffer pool dump is specified via the innodb_buffer_pool_filename system variable.

See Also

  • InnoDB Change Buffering

  • Information Schema INNODB_BUFFER_POOL_STATS Table

  • Setting Innodb Buffer Pool Size Dynamically

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

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.

innodb_max_dirty_pages_pct
buffer pool
innodb_max_dirty_pages_pct_lwm
innodb_max_dirty_pages_pct
innodb_log_file_size
buffer pool
innodb_page_cleaners
innodb_page_cleaners
option group
option file
SET GLOBAL
innodb_buffer_pool_instances
innodb_use_mtflush
innodb_mtflush_threads
option group
option file
innodb_mtflush_threads
innodb_buffer_pool_instances
innodb_io_capacity
SET GLOBAL
option group
option file
innodb_io_capacity
innodb_io_capacity_max
SET GLOBAL
option group
option file
Significant performance boost with new MariaDB page compression on FusionIO
[mariadb]
...
innodb_page_cleaners=8
SET GLOBAL innodb_page_cleaners=8;
[mariadb]
...
innodb_use_mtflush = ON
innodb_mtflush_threads = 8
SET GLOBAL innodb_io_capacity=20000;
[mariadb]
...
innodb_io_capacity=20000
SET GLOBAL innodb_io_capacity_max=20000;
[mariadb]
...
innodb_io_capacity_max=20000

changes

  • Buffer both insert and delete operations

  • purges

    • Buffer the actual physical deletes that occur in the background

  • all

    • Buffer inserts, deletes and purges. Default setting from until , MariaDB 10.6.6, and .

  • none

    • Don't buffer any operations. Default from , MariaDB 10.6.7, and .

  • buffer pool
    SHOW ENGINE INNODB STATUS
    unique_checks=0
    innodb_fast_shutdown=0
    innodb_change_buffering
    innodb_change_buffer_max_size
    InnoDB Buffer Pool
    Traditional Lock Mode

    When innodb_autoinc_lock_mode is set to 0, InnoDB uses the traditional lock mode.

    In this mode, InnoDB holds a table-level lock for all INSERT statements until the statement completes.

    Consecutive Lock Mode

    When innodb_autoinc_lock_mode is set to 1, InnoDB uses the consecutive lock mode.

    In this mode, InnoDB holds a table-level lock for all bulk INSERT statements (such as LOAD DATA or INSERT ... SELECT) until the end of the statement. For simple INSERT statements, no table-level lock is held. Instead, a lightweight mutex is used which scales significantly better. This is the default setting.

    Interleaved Lock Mode

    When innodb_autoinc_lock_mode is set to 2, InnoDB uses the interleaved lock mode.

    In this mode, InnoDB does not hold any table-level locks at all. This is the fastest and most scalable mode, but is not safe for statement-based replication.

    Setting AUTO_INCREMENT Values

    The AUTO_INCREMENT value for an InnoDB table can be set for a table by executing the ALTER TABLE statement and specifying the AUTO_INCREMENT table option:

    However, in and before, InnoDB stores the table's AUTO_INCREMENT counter in memory. In these versions, when the server restarts, the counter is re-initialized to the highest value found in the table. This means that the above operation can be undone if the server is restarted before any rows are written to the table.

    In and later, the AUTO_INCREMENT counter is persistent, so this restriction is no longer present. Persistent, however, does not mean transactional. Gaps may still occur in some cases, such as if a INSERT IGNORE statement fails, or if a user executes ROLLBACK or ROLLBACK TO SAVEPOINT.

    For example:

    If the server is restarted at this point, then the AUTO_INCREMENT counter will revert to 101, which is the persistent value set as part of the failed INSERT IGNORE.

    See Also

    • AUTO_INCREMENT

    • AUTO_INCREMENT FAQ

    • LAST_INSERT_ID

    • Sequences - an alternative to auto_increment available from

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

    innodb_autoinc_lock_mode
    AUTO_INCREMENT
    InnoDB
    InnoDB
    innodb_autoinc_lock_mode
    MDEV-19577
  • For asynchronous writes, this typically occurs in the buffer pool flushing code.

  • For asynchronous reads, this may happen during buffer pool loading at startup or in prefetching logic.

    1. COMPLETED_IN_OS – The operating system notifies InnoDB that the I/O operation is complete.

    • If using libaio or io_uring, a dedicated thread handles this notification.

    • The completed IO operation is then submitted to InnoDB’s internal thread pool (tpool).

    1. EXECUTING_COMPLETION_TASK – A tpool thread processes the completion task for the IO operation.

    2. COMPLETED – The IO operation is fully handled.

    Resource Constraints and Queuing Mechanisms

    Waiting for IO Slots

    The total number of pending asynchronous IO operations is limited by:

    where number_of_IO_threads refers to either innodb_io_read_threads or innodb_io_write_threads.

    Each IO operation is associated with an IO slot, which contains necessary metadata such as the file handle, operation type, offset, length, and any OS error codes. Initially, all total_count slots are free, but as pending IO requests accumulate, slots get occupied. If all slots are in use, additional IO requests must wait for a free slot.

    Queuing Mechanism

    The number of completion tasks (EXECUTING_COMPLETION_TASK stage) that can run in parallel is also limited by innodb_io_read_threads or innodb_io_write_threads. If too many IO operations complete simultaneously, they cannot all be processed in parallel and must be queued, respecting the thread limit.

    Variables

    From , a number of status variables were added to give insight into the above operations:

    • innodb_async_reads_pending – Number of read IO operations currently in progress (from SUBMITTED to COMPLETED).

    • innodb_async_reads_tasks_running – Number of read IO operations currently in the EXECUTING_COMPLETION_TASK state.

    • innodb_async_reads_total_count – Total number of read completion tasks that have finished execution.

    • innodb_async_reads_queue_size – Current size of the queue (see Queuing Mechanism).

    • – Total wait time for a free IO slot (see Waiting for IO Slots).

    • – Total number of read operations that were queued (see ). Includes those still waiting and making up innodb_async_reads_queue_size.

    Similar variables exist for write operations:

    • innodb_async_writes_pending

    • innodb_async_writes_tasks_running

    • innodb_async_reads_total_count

    • innodb_async_writes_queue_size

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

    InnoDB

    Boolean

    Enable redo log scrubbing. Deprecated and ignored.

    innodb-scrub-log-speed

    Bytes/sec

    Redo log scrubbing speed in bytes/sec. Deprecated and ignored.

    innodb-background-scrub-data-check-interval
    innodb-background-scrub-data-compressed
    innodb-background-scrub-data-interval
    innodb-background-scrub-data-uncompressed
    innodb-immediate-scrub-data-uncompressed
    innodb-scrub-log

    Default Row Format

    Dynamic

    InnoDB Row Formats InnoDB Dynamic Row Format

    ACID-compliant

    Yes

    XA Transactions

    Yes

    Primary Keys

    Yes

    InnoDB Primary Keys

    Auto-Increment

    Yes

    InnoDB AUTO_INCREMENT Columns

    Sequences

    Yes

    InnoDB Sequences

    Foreign Keys

    Yes

    InnoDB Foreign Keys

    Indexes

    Yes

    InnoDB Indexes

    Secondary Indexes

    Yes

    InnoDB Secondary Indexes

    Unique Indexes

    Yes

    InnoDB Unique Indexes

    Full-text Search

    Yes

    InnoDB Full-text Indexes

    Spatial Indexes

    Yes

    InnoDB Spatial Indexes

    Compression

    Yes

    Configure InnoDB Page Compression

    Data-at-Rest Encryption

    Yes

    High Availability (HA)

    Yes

    • MariaDB Replication •

    Main Memory Caching

    Yes

    InnoDB Buffer Pool

    Transaction Logging

    Yes

    • InnoDB Redo Log (Crash Safety) • InnoDB Undo Log (MVCC)

    Garbage Collection

    Yes

    InnoDB Purge Threads

    Online Schema changes

    Yes

    InnoDB Schema Changes

    Non-locking Reads

    Yes

    Row Locking

    Yes

    Redo Log
    Row Formats
    Undo Log
    Configure the Redo Log
    Configure the Undo Log
    Schema Changes
    MariaDB Enterprise Server

    InnoDB Limitations

    A list of constraints and limits within the InnoDB engine, including maximum table size, column counts, and index key lengths.

    The InnoDB storage engine has the following limitations.

    Limitations on Schema

    • InnoDB tables can have a maximum of 1,017 columns. This includes virtual generated columns.

    • InnoDB tables can have a maximum of 64 secondary indexes.

    • A multicolumn index on InnoDB can use a maximum of 32 columns. If you attempt to create a multicolumn index that uses more than 32 columns, MariaDB returns an Error 1070.

    Limitations on Size

    • With the exception of variable-length columns (that is, , , and ), rows in InnoDB have a maximum length of roughly half the page size for 4KB, 8KB, 16KB and 32KB page sizes.

    • The maximum size for and columns is 4GB. This also applies to and .

    • MariaDB imposes a row-size limit of 65,535 bytes for the combined sizes of all columns. If the table contains or columns, these only count for 9 - 12 bytes in this calculation, given that their content is stored separately.

    InnoDB Page Size
    Maximum Tablespace Size

    Page Sizes

    Using the system variable, you can configure the size in bytes for InnoDB pages. Pages default to 16KB. There are certain limitations on how you use this variable.

    • MariaDB instances using one page size cannot use data files or log files from an instance using a different page size.

    • When using a Page Size of 4KB or 8KB, the maximum index key length is lowered proportionately.

    InnoDB Page Size
    Index Key Length

    Limitations on Tables

    InnoDB has the following table-specific limitations.

    • When you issue a statement, InnoDB doesn't regenerate the table, rather it deletes each row from the table one by one.

    • When running MariaDB on Windows, InnoDB stores databases and tables in lowercase. When moving databases and tables in a binary format from Windows to a Unix-like system or from a Unix system to Windows, you need to rename these to use lowercase.

    • When using cascading , operations in the cascade don't activate triggers.

    Table Analysis

    When running twice on a table in which statements or transactions are running, MariaDB blocks the second until the statement or transaction is complete. This occurs because the statement or transaction blocks the second statement from reloading the table definition, which it must do since the old one was marked as obsolete after the first statement.

    Table Status

    statements do not provide accurate statistics for InnoDB, except for the physical table size.

    The InnoDB storage engine does not maintain internal row counts. Transactions isolate writes, which means that concurrent transactions will not have the same row counts.

    Auto-incrementing Columns

    • When defining an index on an auto-incrementing column, it must be defined in a way that allows the equivalent of SELECT MAX(col) lookups on the table.

    • Restarting MariaDB may cause InnoDB to reuse old auto-increment values, such as in the case of a transaction that was rolled back.

    • When auto-incrementing columns run out of values, statements generate duplicate-key errors.

    Transactions and Locks

    • You can modify data on a maximum of 96 * 1023 concurrent transactions that generate undo records.

    • Of the 128 rollback segments, InnoDB assigns 32 to non-redo logs for transactions that modify temporary tables and related objects, reducing the maximum number of concurrent data-modifying transactions to 96,000, from 128.000.

    • The limit is 32,000 concurrent transactions when all data-modifying transactions also modify temporary tables.

    • Issuing a statement sets two locks on each table when the system variable is enabled (the default).

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

    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

    ALTER TABLE tab AUTO_INCREMENT=100;
    CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, i INT, UNIQUE (i)) ENGINE=InnoDB;
    
    INSERT INTO t1 (i) VALUES (1),(2),(3);
    INSERT IGNORE INTO t1 (pk, i) VALUES (100,1);
    Query OK, 0 rows affected, 1 warning (0.099 sec)
    
    SELECT * FROM t1;
    +----+------+
    | pk | i    |
    +----+------+
    |  1 |    1 |
    |  2 |    2 |
    |  3 |    3 |
    +----+------+
    
    SHOW CREATE TABLE t1\G
    *************************** 1. row ***************************
           Table: t1
    Create Table: CREATE TABLE `t1` (
      `pk` int(11) NOT NULL AUTO_INCREMENT,
      `i` int(11) DEFAULT NULL,
      PRIMARY KEY (`pk`),
      UNIQUE KEY `i` (`i`)
    ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
    # Restart server
    SHOW CREATE TABLE t1\G
    *************************** 1. row ***************************
           Table: t1
    Create Table: CREATE TABLE `t1` (
      `pk` int(11) NOT NULL AUTO_INCREMENT,
      `i` int(11) DEFAULT NULL,
      PRIMARY KEY (`pk`),
      UNIQUE KEY `i` (`i`)
    ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
    total_count = number_of_IO_threads * 256

    32-bit operating systems have a maximum file size limit of 2GB. When working with large tables using this architecture, configure InnoDB to use smaller data files.

  • The maximum size for the combined InnoDB log files is 512GB.

  • With tablespaces, the minimum size is 10MB, the maximum varies depending on the InnoDB Page Size.

  • When you commit or roll back a transaction, any locks set in the transaction are released. You don't need to issue LOCK TABLES statements when the autocommit variable is enabled, as InnoDB would immediately release the table locks.

  • 4KB

    16TB

    8KB

    32TB

    16KB

    64TB

    32KB

    128TB

    64KB

    256TB

    4KB

    768B

    8KB

    1536B

    16KB

    3072B

    VARBINARY
    VARCHAR
    BLOB
    TEXT
    BLOB
    TEXT
    LONGBLOB
    LONGTEXT
    BLOB
    TEXT
    innodb_page_size
    DELETE
    foreign keys
    ANALYZE TABLE
    ANALYZE TABLE
    ANALYZE TABLE
    SHOW TABLE STATUS
    INSERT
    LOCK TABLES
    innodb_table_locks
    Compiling with the InnoDB plugin from Oracle
    innodb_async_reads_wait_slot_sec
    innodb_async_reads_total_enqueues
    Queuing Mechanism
    innodb_async_writes_wait_slot_sec
    innodb_async_writes_total_enqueues

    InnoDB Purge

    The purge process is a garbage collection mechanism that removes old row versions from the undo log that are no longer required for MVCC.

    When a transaction updates a row in an InnoDB table, InnoDB's MVCC implementation keeps old versions of the row in the InnoDB undo log. The old versions are kept at least until all transactions older than the transaction that updated the row are no longer open. At that point, the old versions can be deleted. InnoDB has purge process that is used to delete these old versions.

    InnoDB Purge Threads

    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 . 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. In ES 10.5 and later, if the remaining clustered index record is the oldest possible row version, the Purge Thread resets the record's hidden DB_TRX_ID field to 0.

    • 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.

    Feature Summary

    Feature
    Detail
    Resources

    Configuring the Purge Threads

    The number of purge threads can be set by configuring the system variable. This system variable can be specified as a command-line argument to or it can be specified in a relevant server in an :

    Optimizing Purge Performance

    Configuring the Purge Batch Size

    The purge batch size is defined as the number of records that must be written before triggering purge. The purge batch size can be set by configuring the system variable. This system variable can be specified as a command-line argument to or it can be specified in a relevant server in an :

    Configuring the Max Purge Lag

    If purge operations are lagging on a busy server, then this can be a tough situation to recover from. As a solution, InnoDB allows you to set the max purge lag. The max purge lag is defined as the maximum number of that can be waiting to be purged from the history until InnoDB begins delaying DML statements.

    The max purge lag can be set by configuring the system variable. This system variable can be changed dynamically with :

    This system variable can also be specified as a command-line argument to or it can be specified in a relevant server in an :

    The maximum delay can be set by configuring the system variable. This system variable can be changed dynamically with :

    This system variable can also be specified as a command-line argument to or it can be specified in a relevant server in an :

    Configuring the Purge Rollback Segment Truncation Frequency

    The purge rollback segment truncation frequency is defined as the number of purge loops that are run before unnecessary rollback segments are truncated. The purge rollback segment truncation frequency can be set by configuring the system variable. This system variable can be changed dynamically with :

    This system variable can also be specified as a command-line argument to or it can be specified in a relevant server in an :

    Configuring the Purge Undo Log Truncation

    Purge undo log truncation occurs when InnoDB truncates an entire tablespace, rather than deleting individual records.

    Purge undo log truncation can be enabled by configuring the system variable. This system variable can be changed dynamically with :

    This system variable can also be specified as a command-line argument to or it can be specified in a relevant server in an :

    An tablespace is truncated when it exceeds the maximum size that is configured for tablespaces. The maximum size can be set by configuring the system variable. This system variable can be changed dynamically with :

    This system variable can also be specified as a command-line argument to or it can be specified in a relevant server in an :

    Purge's Effect on Row Metadata

    An InnoDB table's clustered index has three hidden system columns that are automatically generated. These hidden system columns are:

    • DB_ROW_ID - If the table has no other PRIMARY KEY or no other UNIQUE KEY defined as NOT NULL that can be promoted to the table's PRIMARY KEY, then InnoDB will use a hidden system column called DB_ROW_ID. InnoDB will automatically generated the value for the column from a global InnoDB-wide 48-bit sequence (instead of being table-local).

    • DB_TRX_ID - The transaction ID of either the transaction that last changed the row or the transaction that currently has the row locked.

    If a row's last record is purged, this can obviously effect the value of the row's DB_ROLL_PTR column, because there would no longer be any record for the pointer to reference.

    The purge process will set a row's DB_TRX_ID column to 0 after all of the row's associated records have been deleted. This change allows InnoDB to perform an optimization: if a query wants to read a row, and if the row's DB_TRX_ID column is set to 0, then it knows that no other transaction has the row locked. Usually, InnoDB needs to lock the transaction system's mutex in order to safely check whether a row is locked, but this optimization allows InnoDB to confirm that the row can be safely read without any heavy internal locking.

    This optimization can speed up reads, but it come at a noticeable cost at other times. For example, it can cause the purge process to use more I/O after inserting a lot of rows, since the value of each row's DB_TRX_ID column will have to be reset.

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

    InnoDB Undo Log

    The undo log stores the "before" image of data modified by active transactions, supporting rollbacks and consistent read views.

    Overview

    When a transaction writes data, it always inserts them in the table indexes or data (in the buffer pool or in physical files). No private copies are created. The old versions of data being modified by active InnoDB transactions are stored in the undo log. The original data can then be restored, or viewed by a consistent read.

    Implementation Details

    Before a row is modified, a diff is copied into the undo log. Each normal row contains a pointer to the most recent version of the same row in the undo log. Each row in the undo log contains a pointer to previous version, if any. So, each modified row has a history chain.

    Rows are never physically deleted until a transaction ends. If they were deleted, the restore in ROLLBACK would be impossible. Thus, rows are simply marked for deletion.

    Each transaction uses a view of the records. The determines how this view is created. For example, READ UNCOMMITTED usually uses the current version of rows, even if they are not committed (dirty reads). Other isolation levels require that the most recent committed version of rows is searched in the undo log. READ COMMITTED uses a different view for each table, while REPEATABLE READ and SERIALIZABLE use the same view for all tables.

    There is also a global history list of the data. When a transaction is committed, its history is added to this history list. The order of the list is the chronological order of the commits.

    The purge thread deletes the rows in the undo log which are not needed by any existing view. The rows for which a most recent version exists are deleted, as well as the delete-marked rows.

    If InnoDB needs to restore an old version, it will simply replace the newer version with the older one. When a transaction inserts a new row, there is no older version. However, in that case, the restore can be done by deleting the inserted rows.

    Effects of Long-Running Transactions

    Understanding how the undo log works helps with understanding the negative effects long transactions.

    • Long transactions generate several old versions of the rows in the undo log. Those rows will probably be needed for a longer time, because other long transactions will need them. Since those transactions will generate more modified rows, a sort of combinatorial explosion can be observed. Thus, the undo log requires more space.

    • Transaction may need to read very old versions of the rows in the history list, thus their performance will degrade.

    Of course read-only transactions do not write more entries in the undo log; however, they delay the purging of existing entries.

    Also, long transactions can more likely result in deadlocks, but this problem is not related to the undo log.

    Feature Summary

    Feature
    Detail
    Resources

    Configuration

    System variables affecting undo logs include:

    The undo log is not a log file that can be viewed on disk in the usual sense, such as the or , but rather an area of storage.

    Before , the undo log is usually part of the physical system tablespace, but from , the and system variables can be used to split into different tablespaces and store in a different location (perhaps on a different storage device). From , multiple undo tablespaces are enabled by default, and the default is changed to 3 so that the space occupied by possible bursts of undo log records can be reclaimed after is set.

    Each insert or update portion of the undo log is known as a rollback segment. The system variable allowed to reduce the number of rollback segments from the usual 128, to limit the number of concurrently active write transactions. was deprecated and ignored in and removed in , as it always makes sense to use the maximum number of rollback segments.

    The related status variable stores the total number of available InnoDB undo logs.

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

    MariaDB Enterprise Server InnoDB Background Thread Pool

    This page details the dedicated thread pool in MariaDB Enterprise Server that manages InnoDB background tasks, improving scalability and performance.

    Overview

    Starting with MariaDB Enterprise Server 10.5 and MariaDB Community Server 10.5, InnoDB uses the InnoDB Background Thread Pool to perform internal operations in the background. In previous versions, the internal operations were performed by dedicated threads. By using the InnoDB Background Thread Pool instead of many dedicated threads, InnoDB can reduce context switching and use system resources more effectively.

    The InnoDB Background Thread Pool performs internal operations in multiple categories: tasks, timers, and asynchronous I/O.

    Tasks are used to perform internal operations that are triggered by some event. In ES 10.5 and later and CS 10.5 and later, the following threads have been replaced by tasks with the InnoDB Background Thread Pool:

    • The InnoDB Buffer Pool Resize Thread

    • The InnoDB Buffer Pool Dump Thread

    • The InnoDB Full-Text Search (FTS) Optimization Thread

    Timers are used to perform internal operations that are triggered periodically. In ES 10.5 and later and CS 10.5 and later, the following threads have been replaced by timers with the InnoDB Background Thread Pool:

    • The InnoDB Master Thread

    • The InnoDB Defragmentation Thread

    • The InnoDB Monitor Thread

    • The InnoDB Error Monitor Thread

    Asynchronous I/O is used to read from and write to disk asynchronously. In ES 10.5 and later and CS 10.5 and later, the following threads have been replaced by asynchronous I/O with the InnoDB Background Thread Pool:

    • The

    Feature Summary

    Feature
    Detail
    Resources

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

    InnoDB REDUNDANT Row Format

    Information on the legacy REDUNDANT row format, primarily maintained for backward compatibility with older MySQL versions.

    The REDUNDANT row format is the original non-compacted row format.

    The REDUNDANT row format was the only available row format before MySQL 5.0.3. In that release, this row format was retroactively named the REDUNDANT row format. In the same release, the COMPACT row format was introduced as the new default row format.

    Using the REDUNDANT Row Format

    • Redundant row format should not be used in modern versions of MariaDB Server.

    • Redundant row format does not store large columns as efficiently as the Dynamic row format.

    • Redundant row format limits indexing column values to 767 bytes, which is significant smaller than the Dynamic row format.

    The easiest way to create an InnoDB table that uses the REDUNDANT row format is by setting the table option to REDUNDANT in a or statement.

    It is recommended to set the system variable to ON when using this format.

    The REDUNDANT row format is supported by both the Antelope and the Barracuda , so tables with this row format can be created regardless of the value of the system variable.

    For example:

    Index Prefixes with the REDUNDANT Row Format

    The REDUNDANT row format supports index prefixes up to 767 bytes.

    Overflow Pages with the REDUNDANT Row Format

    All InnoDB row formats can store certain kinds of data in overflow pages. This allows for the maximum row size of an InnoDB table to be larger than the maximum amount of data that can be stored in the row's main data page. See for more information about the other factors that can contribute to the maximum row size for InnoDB tables.

    In the REDUNDANT row format variable-length columns, such as columns using the , , and data types, can be partially stored in overflow pages.

    InnoDB only considers using overflow pages if the table's row size is greater than half of . If the row size is greater than this, then InnoDB chooses variable-length columns to be stored on overflow pages until the row size is less than half of .

    For , , and columns, only values longer than 767 bytes are considered for storage on overflow pages. Bytes that are stored to track a value's length do not count towards this limit. This limit is only based on the length of the actual column's data.

    Fixed-length columns greater than 767 bytes are encoded as variable-length columns, so they can also be stored in overflow pages if the table's row size is greater than half of . Even though a column using the data type can hold at most 255 characters, a column can still exceed 767 bytes in some cases. For example, a char(255) column can exceed 767 bytes if the is utf8mb4.

    If a column is chosen to be stored on overflow pages, then the first 767 bytes of the column's value and a 20-byte pointer to the column's first overflow page are stored on the main page. Each overflow page is the size of [innodb-system-variables#innodb_page_size|innodb_page_size]]. If a column is too large to be stored on a single overflow page, then it is stored on multiple overflow pages. Each overflow page contains part of the data and a 20-byte pointer to the next overflow page, if a next page exists.

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

    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.

    InnoDB Data Dictionary Troubleshooting

    Learn how to resolve inconsistencies between the InnoDB internal data dictionary and the file system, such as orphan .frm or .ibd files.

    Can't Open File

    If InnoDB returns something like the following error:

    it may be that an orphan .frm file exists. Something like the following may also appear in the error log:

    If this is the case, as the text describes, delete the orphan .frm file on the filesystem.

    Could not find a valid tablespace file

    In this case the table definition, the .frm file, is missing and the InnoDB dictionary expects it to be there. To remove the InnoDB dictionary entry, the existence of the file needs to faked and then dropped. The existence of the file is faked by creating the tablename.frm and potential the database directory if it is missing. Then a DROP TABLE or DROP DATABASE can be executed which will remove the InnoDB dictionary entry.

    Use the query to identify potentially other tablespaces that are known but missing with:

    Removing Orphan Intermediate Tables

    An orphan intermediate table may prevent you from dropping the tablespace even if it is otherwise empty, and generally takes up unnecessary space.

    It may come about if MariaDB exits in the middle of an operation. They are listed in the table, and always start with an #sql-ib prefix. The accompanying .frm file also begins with #sql-, but has a different name.

    To identify orphan tables, run:

    When is set, the #sql-*.ibd file will also be visible in the database directory.

    To remove an orphan intermediate table:

    • Rename the #sql-*.frm file (in the database directory) to match the base name of the orphan intermediate table, for example:

    • Drop the table, for example:

    See Also

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

    ERROR 1016: Can't open file: 'x.ibd'. (errno: 1)
    InnoDB: Cannot find table test/x from the internal data dictionary
    InnoDB: of InnoDB though the .frm file for the table exists. Maybe you
    InnoDB: have deleted and recreated InnoDB data files but have forgotten
    InnoDB: to delete the corresponding .frm files of InnoDB tables?

    Thread Pool

    InnoDB Background Thread Pool

    Storage Engine

    InnoDB

    Purpose

    Handles background tasks for InnoDB

    Availability

    • ES 10.5+ • CS 10.5+

    MariaDB Enterprise Server

    InnoDB I/O Threads
    here
    here
    here

    InnoDB Online DDL

    Perform online DDL operations with InnoDB in MariaDB Server. Learn how to alter tables without blocking read/write access, ensuring high availability for your applications.

    ROW_FORMAT
    CREATE TABLE
    ALTER TABLE
    innodb_strict_mode
    file formats
    innodb_file_format
    Maximum Row Size
    VARBINARY
    VARCHAR
    BLOB
    TEXT
    innodb_page_size
    innodb_page_size
    VARBINARY
    VARCHAR
    BLOB
    TEXT
    innodb_page_size
    CHAR
    CHAR
    character set
    ALTER TABLE ... ALGORITHM=INPLACE
    INFORMATION_SCHEMA.INNODB_SYS_TABLES
    innodb_file_per_table
    InnoDB Troubleshooting Overview
    SET SESSION innodb_strict_mode=ON;
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
    SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'dbname/%';
    SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE '%#sql%';
    mv #sql-36ab_2.frm #sql-ib87-856498050.frm
    DROP TABLE `#mysql50##sql-ib87-856498050`;

    Quantity

    Set by

  • DB_ROLL_PTR - A pointer to the InnoDB undo log that contains the row's previous record. The value of DB_ROLL_PTR is only valid if DB_TRX_ID belongs to the current read view. The oldest valid read view is the purge view.

  • Thread

    InnoDB Purge Threads

    Storage Engine

    InnoDB

    Purpose

    Garbage Collection of: • InnoDB Undo Log • Delete-marked secondary index records • Freed overflow pages

    Availability

    All ES and CS versions

    MariaDB Enterprise Server

    InnoDB Undo Log
    BLOB
    CHAR
    TEXT
    VARCHAR
    VARBINARY
    innodb_purge_threads
    mariadbd
    option group
    option file
    InnoDB undo log
    innodb_purge_batch_size
    mariadbd
    option group
    option file
    InnoDB undo log
    innodb_max_purge_lag
    SET GLOBAL
    mariadbd
    option group
    option file
    innodb_max_purge_lag_delay
    SET GLOBAL
    mariadbd
    option group
    option file
    innodb_purge_rseg_truncate_frequency
    SET GLOBAL
    mariadbd
    option group
    option file
    InnoDB undo log
    InnoDB undo log
    innodb_undo_log_truncate
    SET GLOBAL
    mariadbd
    option group
    option file
    InnoDB undo log
    InnoDB undo log
    innodb_max_undo_log_size
    SET GLOBAL
    mariadbd
    option group
    option file
    InnoDB undo log
    InnoDB undo log
    InnoDB undo log

    Location

    By default, located in InnoDB system tablespace When

    innodb_undo_tablespaces is set, located in directory set by (Defaults to )

    Quantity

    Set by

    Size

    10 MB per tablespace by default (grows as needed)

    innodb_undo_tablespaces
  • innodb_purge_batch_size

  • innodb_purge_rseg_truncate_frequency

  • Transaction Log

    InnoDB Undo Log

    Storage Engine

    InnoDB

    Purpose

    Multi-Version Concurrency Control (MVCC)

    Availability

    All ES and CS versions

    MariaDB Enterprise Server

    transaction isolation level
    innodb_max_undo_log_size
    innodb_undo_directory
    innodb_undo_log_truncate
    innodb_undo_logs
    error log
    slow query log
    innodb_undo_directory
    innodb_undo_tablespaces
    innodb_undo_tablespaces
    innodb_undo_log_truncate
    innodb_undo_logs
    innodb_undo_logs
    MariaDB 10.6
    innodb_available_undo_logs

    Instant ADD COLUMN for InnoDB

    A focused guide on the Instant ADD COLUMN feature, explaining how it works by modifying metadata and its advantages over traditional table-rebuilding methods.

    Normally, adding a column to a table requires the full table to be rebuilt. The complexity of the operation is proportional to the size of the table, or O(n·m) where n is the number of rows in the table and m is the number of indexes.

    In and later, the ALTER TABLE statement supports online DDL for storage engines that have implemented the relevant online DDL algorithms and locking strategies.

    The InnoDB storage engine has implemented online DDL for many operations. These online DDL optimizations allow concurrent DML to the table in many cases, even if the table needs to be rebuilt.

    See InnoDB Online DDL Overview for more information about online DDL with InnoDB.

    Allowing concurrent DML during the operation does not solve all problems. When a column was added to a table with the older in-place optimization, the resulting table rebuild could still significantly increase the I/O and memory consumption and cause replication lag.

    In contrast, with the new instant ALTER TABLE ... ADD COLUMN, all that is needed is an O(1) operation to insert a special hidden record into the table, and an update of the data dictionary. For a large table, instead of taking several hours, the operation would be completed in the blink of an eye. The ALTER TABLE ... ADD COLUMN operation is only slightly more expensive than a regular , due to locking constraints.

    In the past, some developers may have implemented a kind of "instant add column" in the application by encoding multiple columns in a single or column. MariaDB was an early example of that. A more recent example is and related string manipulation functions.

    Adding real columns has the following advantages over encoding columns into a single "expandable" column:

    • Efficient storage in a native binary format

    • Data type safety

    • Indexes can be built natively

    • Constraints are available: UNIQUE, CHECK, FOREIGN KEY

    With instant , you can enjoy all the benefits of structured storage without the drawback of having to rebuild the table.

    Instant is available for both old and new InnoDB tables. Basically you can just upgrade from MySQL 5.x or MariaDB and start adding columns instantly.

    Columns instantly added to a table exist in a separate data structure from the main table definition, similar to how InnoDB separates BLOB columns. If the table ever becomes empty, (such as from or statements), InnoDB incorporates the instantly added columns into the main table definition. See for more information.

    The operation is also crash safe. If the server is killed while executing an instant , when the table is restored InnoDB integrates the new column, flattening the table definition.

    Limitations

    • In , instant only applies when the added columns appear last in the table. The place specifier LAST is the default. If AFTER col is specified, then col must be the last column, or the operation will require the table to be rebuilt. In , this restriction was lifted.

    • If the table contains a hidden FTS_DOC_ID column due to a , then instant will not be possible.

    • InnoDB data files after instant

    Example

    The above example illustrates that when the added columns are declared NOT NULL, a DEFAULT value must be available, either implied by the data type or set explicitly by the user. The expression need not be constant, but it must not refer to the columns of the table, such as DEFAULT u+1 (a MariaDB extension). The DEFAULT current_timestamp() would be evaluated at the time of the ALTER TABLE and apply to each row, like it does for non-instant ALTER TABLE. If a subsequent ALTER TABLE changes the DEFAULT value for subsequent INSERT, the values of the columns in existing records will naturally be unaffected.

    The design was brainstormed in April by engineers from MariaDB Corporation, Alibaba and Tencent. A prototype was developed by Vin Chen (陈福荣) from the Tencent Game DBA Team.

    See Also

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

    InnoDB Temporary Tablespaces

    This page explains how InnoDB manages temporary tablespaces for non-compressed temporary tables, including configuration and sizing options.

    When the user creates a temporary table using the CREATE TEMPORARY TABLE statement and the engine is set as InnoDB, MariaDB creates a temporary tablespace file. When the table is not compressed, MariaDB writes to a shared temporary tablespace as defined by the innodb_temp_data_file_path system variable. MariaDB does not allow the creation of ROW_FORMAT=COMPRESSED temporary tables. All temporary tables are uncompressed. MariaDB deletes temporary tablespaces when the server shuts down gracefully and is recreated when it starts again. It cannot be placed on a raw device.

    Internal temporary tablespaces, (that is, temporary tables that cannot be kept in memory) use either Aria or MyISAM, depending on the aria_used_for_temp_tables system variable. You can set the default storage engine for user-created temporary tables using the default_tmp_storage_engine system variable.

    Prior to , temporary tablespaces existed as part of the InnoDB system tablespace or were file-per-table depending on the configuration of the innodb_file_per_table system variable.

    Syntax for the value of the innodb_temp_data_file_path variable

    The options for is one path or a set of paths, separated by ';'.

    The syntax for each path is:

    size can have extensions 'G' (Gigabytes), 'M' (Megabytes) or 'K' (Kilobytes). If no extension is given, then megabytes is assumed.

    • The first size argument is the initial size of the temporary table space.

    • autoextend means that the file size will automatically increase if needed.

    • max can be used to limit the total size of the temporary file if autoextend is used.

    Only the last path can have the autoextend , max and autoshrink options.

    Sizing Temporary Tablespaces

    In order to size temporary tablespaces, use the system variable. This system variable can be specified as a command-line argument to or it can be specified in a relevant server in an :

    This system variable's syntax is the same as the system variable. That is, a file name, size and option. By default, it writes a 12MB autoextending file to ibtmp1 in the data directory.

    To increase the size of the temporary tablespace, you can add a path to an additional tablespace file to the value of the system variable. Providing additional paths allows you to spread the temporary tablespace between multiple tablespace files. The last file can have the autoextend attribute, which ensures that you won't run out of space:

    Unlike normal tablespaces, temporary tablespaces are deleted when you stop MariaDB. To shrink temporary tablespaces to their minimum sizes, restart the server.

    Shrinking the Tablespace

    From , the temporary tablespace can be shrunk by setting to ON:

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

    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.

    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.

    [mariadb]
    ...
    innodb_purge_threads=8
    SET GLOBAL innodb_purge_threads=8;
    
    SHOW GLOBAL VARIABLES
       LIKE 'innodb_purge_threads';
    +----------------------+-------+
    | Variable_name        | Value |
    +----------------------+-------+
    | innodb_purge_threads | 8     |
    +----------------------+-------+
    [mariadb]
    ...
    innodb_purge_batch_size = 50
    SET GLOBAL innodb_max_purge_lag=1000;
    [mariadb]
    ...
    innodb_max_purge_lag = 1000
    SET GLOBAL innodb_max_purge_lag_delay=100;
    [mariadb]
    ...
    innodb_max_purge_lag_delay = 100
    SET GLOBAL innodb_purge_rseg_truncate_frequency=64;
    [mariadb]
    ...
    innodb_purge_rseg_truncate_frequency = 64
    SET GLOBAL innodb_undo_log_truncate=ON;
    [mariadb]
    ...
    innodb_undo_log_truncate = ON
    SET GLOBAL innodb_max_undo_log_size='64M';
    [mariadb]
    ...
    innodb_max_undo_log_size = 64M
    innodb_purge_threads
    Configure the InnoDB Purge Threads

    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

    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_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
    $ mariadb --user=root
    SET GLOBAL innodb_purge_threads=8;
    [mariadb]
    ...
    innodb_purge_threads=8
    [mariadb]
    ...
    innodb_purge_threads=8
    $ sudo systemctl restart mariadb
    DEFAULT values can be specified
  • Triggers can be written more easily

  • cannot be imported to older versions of MariaDB or MySQL without first being rebuilt.
  • After using Instant ALTER TABLE ... ADD COLUMN, any table-rebuilding operation such as ALTER TABLE … FORCE will incorporate instantaneously added columns into the main table body.

  • Instant ALTER TABLE ... ADD COLUMN is not available for ROW_FORMAT=COMPRESSED.

  • In , ALTER TABLE … DROP COLUMN requires the table to be rebuilt. In , this restriction was lifted.

  • INSERT
    TEXT
    BLOB
    Dynamic Columns
    JSON
    ALTER TABLE ... ADD COLUMN
    ALTER TABLE ... ADD COLUMN
    TRUNCATE
    DELETE
    InnoDB Online DDL Operations with ALGORITHM=INSTANT: Non-canonical Storage Format Caused by Some Operations
    ALTER TABLE ... ADD COLUMN
    ALTER TABLE ... ADD COLUMN
    FULLTEXT INDEX
    ALTER TABLE ... ADD COLUMN
    ALTER TABLE ... ADD COLUMN
    Other INSTANT operations in InnoDB

    autoshrink means that the file will shrink to original size when possible.

    innodb_temp_data_file_path
    innodb_temp_data_file_path
    mysqld
    option group
    option file
    innodb_data_file_path
    innodb_temp_data_file_path
    innodb_truncate_temporary_tablespace_now
    innodb_undo_tablespaces
    innodb_undo_directory
    datadir
    innodb_undo_tablespaces
    Configure the InnoDB Undo Log

    InnoDB System Tablespaces

    This page explains the InnoDB system tablespace (ibdata1), which stores the data dictionary, doublewrite buffer, and undo logs, and how to resize it.

    When InnoDB needs to store general information relating to the system as a whole, rather than a specific table, the specific file it writes to is the system tablespace. By default, this is the ibdata1 file located in the data directory, (as defined by either the datadir or innodb_data_home_dir system variables). InnoDB uses the system tablespace to store the data dictionary, change buffer, and undo logs.

    You can define the system tablespace filename or filenames, size and other options by setting the innodb_data_file_path system variable. This system variable can be specified as a command-line argument to mariadbd or it can be specified in a relevant server option group in an option file:

    This system variable defaults to the file ibdata1, and it defaults to a minimum size of 12M, and it defaults with the autoextend attribute enabled.

    Changing Sizes

    InnoDB defaults to allocating 12M to the ibdata1 file for the system tablespace. While this is sufficient for most use cases, it may not be for all. You may find after using MariaDB for a while that the allocation is too small for the system tablespace or it grows too large for your disk. Fortunately, you can adjust this size as need later.

    Increasing the Size

    When setting the system variable, you can define a size for each file given. In cases where you need a larger system tablespace, add the autoextend option to the last value.

    Under this configuration, when the last system tablespace grows beyond the size allocation, InnoDB increases the size of the file by increments. To control the allocation increment, set the system variable.

    Decreasing the Size

    MariaDB starting with

    From , when MariaDB starts up, unused InnoDB tablespace can be reclaimed, reducing the file size (). This is disabled by default and is enabled by adding the :autoshrink attribute to the system variable, e.g.:

    Alternatively, starting with , the shrinking can be set to happen during a slow shutdown (e.g. after SET GLOBAL innodb_fast_shutdown=0) (). Technically, how this works is:

    1. Find the last used extent in the system tablespace by iterating through the BITMAP in the extent descriptor page.

    2. Check whether the tablespace is being used within fixed size, and if the last used extent is less than the fixed size, then set the desired target size to fixed size.

    3. Flush all pages belonging to the system tablespace in flush list.

    4. Truncate the truncated pages from FSP_FREE and FSP_FREE_FRAG list.

    MariaDB until

    In cases where the InnoDB system tablespace has grown too large, before , the process to reduce it in size is a little more complicated than increasing the size. MariaDB does not allow you to remove data from the tablespace file itself. Instead you need to delete the tablespace files themselves, then restore the database from backups. The backup utility produces backup files containing the SQL statements needed to recreate the database. As a result, it restores a database with the bare minimum data rather than any additional information that might have built up in the tablespace file. Use mariadb-dump to backup all of your InnoDB database tables, including the system tables in the mysql database that use InnoDB. You can find out what they are using the Information Schema.

    If you only use InnoDB, you may find it easier to back up all databases and tables.

    Then stop the MariaDB Server and remove the InnoDB tablespace files. In the data directory or the InnoDB data home directory, delete all the ibdata and ib_log files as well as any file with an .ibd or .frm extension. Once this is done, restart the server and import the dump file:

    Using Raw Disk Partitions

    Instead of having InnoDB write to the file system, you can set it to use raw disk partitions. On Windows and some Linux distributions, this allows you to perform non-buffered I/O without the file system overhead. Note that in many use cases this may not actually improve performance. Run tests to verify if there are any real gains for your application usage.

    To enable a raw disk partition, first start MariaDB with the newraw option set on the tablespace:

    When the MariaDB Server starts, it initializes the partition. Don't create or change any data, (any data written to InnoDB at this stage are lost on restart). Once the server has successful started, stop it then edit the configuration file again, changing the newraw keyword to raw.

    When you start MariaDB again, it'll read and write InnoDB data to the given disk partition instead of the file system.

    Raw Disk Partitions on Windows

    When defining a raw disk partition for InnoDB on the Windows operating system, use the same procedure as defined above, but when defining the path for the system variable, use ./ at the start:

    The given path is synonymous with the Windows syntax for accessing the physical drive.

    System Tables within the InnoDB System Tablespace

    InnoDB creates some system tables within the InnoDB System Tablespace:

    • SYS_DATAFILES

    • SYS_FOREIGN

    • SYS_FOREIGN_COLS

    • SYS_TABLESPACES

    These tables cannot be queried. However, you might see references to them in some places, such as in the table in the database.

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

    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 .

    For additional information, see "".

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

    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 system variable.

    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 "".

    This page describes how to configure the InnoDB Undo Log.

    CREATE TABLE t(id INT PRIMARY KEY, u INT UNSIGNED NOT NULL UNIQUE)
    ENGINE=InnoDB;
    
    INSERT INTO t(id,u) VALUES(1,1),(2,2),(3,3);
    
    ALTER TABLE t ADD COLUMN
    (d DATETIME DEFAULT current_timestamp(),
     p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'),
     t TEXT CHARSET utf8 DEFAULT 'The quick brown fox jumps over the lazy dog');
    
    UPDATE t SET t=NULL WHERE id=3;
    
    SELECT id,u,d,ST_AsText(p),t FROM t;
    
    SELECT variable_value FROM information_schema.global_status
    WHERE variable_name = 'innodb_instant_alter_column';
    path:size[:autoextend][:max:size][:autoshrink]
    [mariadb]
    ...
    innodb_temp_data_file_path=ibtmp1:32M:autoextend
    [mariadb]
    ...
    innodb_temp_data_file_path=ibtmp1:32M;ibtmp2:32M:autoextend
    SET GLOBAL innodb_truncate_temporary_tablespace_now=1;
    [mariadb]
    ...
    innodb_data_file_path=ibdata1:50M:autoextend

    Configure InnoDB Undo Log Tablespaces

    By default, the InnoDB undo log is located in the InnoDB system tablespace, which is defined by the innodb_data_file_path 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 innodb_undo_tablespaces 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 innodb_undo_directory 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 MariaDB Dump.

    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

    CentOS RHEL Rocky Linux SLES

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

    Debian Ubuntu

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

    1. Set the innodb_undo_tablespaces 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 innodb_undo_directory 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 SHOW GLOBAL VARIABLES 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 innodb_undo_log_truncate system variable using the SET GLOBAL statement. The SET GLOBAL 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 innodb_max_undo_log_size 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 SET GLOBAL 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 innodb_undo_log_truncate system variable to ON using the SET GLOBAL statement.

    For example:

    1. If you would like to change the size at which undo logs are truncated, then also set the innodb_max_undo_log_size system variable to the new size using the SET GLOBAL 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 innodb_purge_rseg_truncate_frequency system variable to a lower value using the SET GLOBAL 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

    CentOS RHEL Rocky Linux SLES

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

    Debian Ubuntu

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

    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 innodb_max_undo_log_size value supports units, such as "M", "G", etc.

    For example:

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

    InnoDB Undo Log
    [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

    Reset the bitmap in descriptor pages for the truncated pages.

  • Update the FSP_SIZE and FSP_FREE_LIMIT in header page.

  • In case of multiple files, calculate the truncated last file size and do the truncation in last file.

  • SYS_VIRTUAL

  • SYS_ZIP_DICT

  • SYS_ZIP_DICT_COLS

  • innodb_data_file_path
    innodb_autoextend_increment
    MDEV-14795
    innodb_data_file_path
    MDEV-32452
    mariadb-dump
    innodb_data_file_path
    INNODB_SYS_TABLES
    information_schema
    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 innodb_read_io_threads and innodb_write_io_threads 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 innodb_use_native_aio system variable, which is enabled by default.

    Affected I/O Operations

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

    • Linear read-ahead (configured by innodb_read_ahead_threshold)

    • Random read-ahead (configured by innodb_random_read_ahead)

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

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

    • Page flushing due to buffer pool capacity (configured by [innodb_max_dirty_pages_pct] and [innodb-system-variables/#innodb_max_dirty_pages_pct_lwm|innodb_max_dirty_pages_pct_lwm)

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

    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

    ES 10.5 and Later

    No

    Any ES Any CS

    Yes.

    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 innodb_read_io_threadsinnodb_write_io_threads system variables using the SET GLOBAL statement. The SET GLOBAL 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 innodb_write_io_threads system variable should be set to 4 (since 1024/256=4).

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

    To configure InnoDB's maximum number of asynchronous I/O requests with the SET GLOBAL 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 innodb_read_io_threads and innodb_write_io_threads system variables to the new values using the SET GLOBAL 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

    CentOS RHEL Rocky Linux SLES

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

    Debian Ubuntu

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

    1. Set the innodb_read_io_threads and innodb_write_io_threads 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 innodb_read_io_threads and innodb_write_io_threads 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

    CentOS RHEL Rocky Linux SLES

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

    Debian Ubuntu

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

    1. Set the innodb_read_io_threads and innodb_write_io_threads 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:

    1. Restart the server:

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

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

    InnoDB Background Thread Pool
    InnoDB I/O Threads
    Starting with ES 10.5 and CS 10.5, the Buffer Pool always has a single instance.

    For additional information, see "InnoDB Buffer Pool".

    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 innodb_buffer_pool_size 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

    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

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

    Product Versions
    Server Restart?
    Method

    Any ES Any CS

    No

    .

    Any ES Any CS

    No

    Configure the InnoDB Buffer Pool Size with SET GLOBAL

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

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

    To configure the InnoDB Buffer Pool with the SET GLOBAL 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 innodb_buffer_pool_size system variable to the new size using the SET GLOBAL statement.

    For example, to set the size to 2 GB:

    1. Confirm that the resize operation has been completed by querying the Innodb_buffer_pool_resize_status status variable using the SHOW GLOBAL STATUS 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

    CentOS RHEL Rocky Linux SLES

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

    Debian Ubuntu

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

    1. Set the innodb_buffer_pool_size 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 innodb_buffer_pool_size 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

    CentOS RHEL Rocky Linux SLES

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

    Debian Ubuntu

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

    1. Set the innodb_buffer_pool_size 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 SET GLOBAL.

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

    innodb_page_size

    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 COMPACT Row Format

    Detailed information on the COMPACT row format, which reduces storage space by roughly 20% compared to REDUNDANT, handling NULLs and variable-length columns efficiently.

    NoteCOMPACT was the default row format in prior versions of MariaDB. MariaDB has since transitioned to DYNAMIC as the default row format.

    The COMPACT row format is similar to the REDUNDANT row format, but it stores data in a more compact manner that requires about 20% less storage.

    InnoDB Troubleshooting Overview

    A starting point for diagnosing InnoDB issues, recommending checks on error logs, deadlocks, and table integrity using various tools.

    As with most errors, first take a look at the contents of the . If dealing with a deadlock, setting the option (off by default) will output details of all deadlocks to the error log.

    It can also help to enable the various relating to the problem you are experiencing. There are four types: the standard InnoDB monitor, the InnoDB Lock Monitor, InnoDB Tablespace Monitor and the InnoDB Table Monitor.

    Running will help determine whether there are errors in the table.

    For problems with the InnoDB Data Dictionary, see .

    See Also

    [mariadb]
    ...
    innodb_data_file_path=ibdata1:12M;ibdata2:50M:autoextend
    [mariadb]
    ...
    innodb_data_file_path=ibdata1:12M;ibdata2:50M:autoextend:autoshrink
    SELECT TABLE_NAME FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = 'mysql' AND ENGINE = 'InnoDB';
    $ mariadb-dump -u root -p --all-databases > full-backup.sql
    $ mysql -u root -p < full-backup.sql
    [mariadb]
    ...
    innodb_data_file_path=/dev/sdc:10Gnewraw
    [mariadb]
    ...
    innodb_data_file_path=/dev/sdc:10Graw
    [mariadb]
    ...
    innodb_data_file_path=//./E::10Graw
    $ 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
    $ 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

    64-96 GB

    256 GB

    128-192 GB

    Configure size with SET GLOBA
    Configure size in configuration file
  • InnoDB Data Dictionary Troubleshooting

  • InnoDB Recovery Modes

  • Error Codes

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

    MariaDB error log
    innodb_print_all_deadlocks
    InnoDB Monitors
    CHECK TABLE
    InnoDB Data Dictionary Troubleshooting
    Using the COMPACT Row Format
    • If you performed a physical upgrade from older version of MariaDB Server or MySQL to a newer MariaDB Server version, then some of your tables may still use COMPACT row format.

    • Compact row format does not store large columns as efficiently as the Dynamic row format.

    • Compact row format limits indexing column values to 767 bytes, which is significant smaller than the Dynamic row format.

    The easiest way to create an InnoDB table that uses the COMPACT row format is by setting the ROW_FORMAT table option to COMPACT in a CREATE TABLE or ALTER TABLE statement.

    It is recommended to set the innodb_strict_mode system variable to ON when using this row format.

    The COMPACT row format is supported by both the Antelope and the Barracuda file formats, so tables with this row format can be created regardless of the value of the innodb_file_format system variable.

    For example:

    Index Prefixes with the COMPACT Row Format

    The COMPACT row format supports index prefixes up to 767 bytes.

    Overflow Pages with the COMPACT Row Format

    All InnoDB row formats can store certain kinds of data in overflow pages. This allows for the maximum row size of an InnoDB table to be larger than the maximum amount of data that can be stored in the row's main data page. See Maximum Row Size for more information about the other factors that can contribute to the maximum row size for InnoDB tables.

    In the COMPACT row format variable-length columns, such as columns using the VARBINARY, VARCHAR, BLOB and TEXT data types, can be partially stored in overflow pages.

    InnoDB only considers using overflow pages if the table's row size is greater than half of innodb_page_size. If the row size is greater than this, then InnoDB chooses variable-length columns to be stored on overflow pages until the row size is less than half of innodb_page_size.

    For VARBINARY, VARCHAR, BLOB and TEXT columns, only values longer than 767 bytes are considered for storage on overflow pages. Bytes that are stored to track a value's length do not count towards this limit. This limit is only based on the length of the actual column's data.

    Fixed-length columns greater than 767 bytes are encoded as variable-length columns, so they can also be stored in overflow pages if the table's row size is greater than half of innodb_page_size. Even though a column using the CHAR data type can hold at most 255 characters, a CHAR column can still exceed 767 bytes in some cases. For example, a char(255) column can exceed 767 bytes if the character set is utf8mb4.

    If a column is chosen to be stored on overflow pages, then the first 767 bytes of the column's value and a 20-byte pointer to the column's first overflow page are stored on the main page. Each overflow page is the size of innodb_page_size. If a column is too large to be stored on a single overflow page, then it is stored on multiple overflow pages. Each overflow page contains part of the data and a 20-byte pointer to the next overflow page, if a next page exists.

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

    SET SESSION innodb_strict_mode=ON;
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB ROW_FORMAT=COMPACT;

    InnoDB schema changes are performed using the following DDL statements:

    • ALTER TABLE

    • CREATE INDEX

    • CREATE SPATIAL INDEX

    • CREATE UNIQUE INDEX

    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 ALTER TABLE 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 ALTER TABLE statement.

    Feature
    Detail
    Resources

    Operations support instant algorithm

    Yes

    Operations support no-copy algorithm

    Yes

    Operations support in-place algorithm

    Yes

    InnoDB Schema Changes with the INPLACE Algorithm

    Adding a column

    Yes

    Configure maximum number of asynchronous I/O requests with SET GLOBAL
    Configure number of I/O threads in configuration file

    InnoDB Versions

    This page is outdated. It's left in place because release notes for old MariaDB versions refer to it (MariaDB < 10.3).

    This page is outdated. It's left in place because release notes for old MariaDB versions refer to it (MariaDB < 10.3).

    The InnoDB implementation has diverged substantially from the InnoDB in MySQL. Therefore, in these versions, the InnoDB version is no longer associated with a MySQL release version.

    The default InnoDB implementation is based on InnoDB from MySQL 5.7. See Why MariaDB uses InnoDB instead of XtraDB from MariaDB 10.2 for more information.

    Note

    XtraDB is a performance enhanced fork of InnoDB. For compatibility reasons, the still retain their original innodb prefixes. If the documentation says that something applies to InnoDB, then it usually also applies to the XtraDB fork, unless explicitly stated otherwise. In these versions, it is still possible to use InnoDB instead of XtraDB. See for more information.

    Divergences

    Some examples of divergences between MariaDB's InnoDB and MySQL's InnoDB are:

    • (which is based on MySQL 5.6) included encryption and variable-size page compression before MySQL 5.7 introduced them.

    • (based on MySQL 5.7) introduced persistent AUTO_INCREMENT () in a GA release before MySQL 8.0.

    • (based on MySQL 5.7) introduced instant ADD COLUMN () before MySQL.

    InnoDB Versions Included in MariaDB Releases

    InnoDB Version
    Introduced

    InnoDB Version
    Introduced

    InnoDB Version
    Introduced

    InnoDB Version
    Introduced

    See Also

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

    InnoDB Redo Log

    The redo log is a disk-based transaction log used during crash recovery to replay incomplete transactions and ensure data durability.

    Directly editing or moving the redo logs can cause corruption, and should never normally be attempted.

    Overview

    The InnoDB storage engine in MariaDB Enterprise Server employs a Redo Log to ensure data is written to disk reliably, even in the event of a crash. This is achieved by the Redo Log acting as a transaction log.

    Redo Log records are uniquely identified by a Log Sequence Number (LSN). The Redo Log consists of circular log files of a fixed size, where older records are routinely overwritten by newer ones.

    InnoDB periodically performs checkpoints. During a checkpoint operation, InnoDB writes (flushes) the Redo Log records to the InnoDB tablespace files.

    In the event of a server crash, InnoDB utilizes the Redo Log for crash recovery during the subsequent server startup. It locates the last checkpoint within the Redo Log and then replays the Redo Log records generated since that checkpoint, effectively flushing these pending changes to the InnoDB tablespace files.

    The redo log files are typically named ib_logfileN, where N is an integer. However, starting with , there is a single redo log file, consistently named ib_logfile0. The location of these redo log files is determined by the innodb_log_group_home_dir system variable, if configured. If this variable is not set, the redo log files are created in the directory specified by the datadir system variable. The redo log plays a crucial role during crash recovery and in the background process of flushing transactions to the tablespaces.

    Feature Summary

    Feature
    Detail
    Resources

    Basic Configuration

    Flushing Effects on Performance and Consistency

    The system variable determines how often the transactions are flushed to the redo log, and it is important to achieve a good balance between speed and reliability.

    Binary Log Group Commit and Redo Log Flushing

    When both (the default) is set and the is enabled, there is one less sync to disk inside InnoDB during commit (2 syncs shared between a group of transactions instead of 3). See for more information.

    Redo Log Group Capacity

    The redo log group capacity is the total combined size of all InnoDB redo logs. The relevant factors are:

    • From , there is 1 redo log.

    • The size of each redo log file is configured by the system variable. This can safely be set to a much higher value from . Before , resizing required the server to be restarted. From the variable can be set dynamically.

    The redo log group capacity is determined by the following calculation:

    innodb_log_group_capacity = *

    For example, if is set to 2G and is set to 2, then we would have the following:

    • innodb_log_group_capacity = *

    • = 2G * 2

    • = 4G

    Changing the Redo Log Group Capacity

    MariaDB starting with

    The number of redo log files is fixed.

    The size of redo log files can be changed with the following process:

    • Stop the server.

    • To change the log file size, configure .

    • Start the server.

    Log Sequence Number (LSN)

    Records within the InnoDB redo log are identified via a log sequence number (LSN).

    Checkpoints

    When InnoDB performs a checkpoint, it writes the LSN of the oldest dirty page in the to the InnoDB redo log. If a page is the oldest dirty page in the , then that means that all pages with lower LSNs have been flushed to the physical InnoDB tablespace files. If the server were to crash, then InnoDB would perform crash recovery by only applying log records with LSNs that are greater than or equal to the LSN of the oldest dirty page written in the last checkpoint.

    Checkpoints are one of the tasks performed by the InnoDB master background thread. This thread schedules checkpoints 7 seconds apart when the server is very active, but checkpoints can happen more frequently when the server is less active.

    Dirty pages are not actually flushed from the buffer pool to the physical InnoDB tablespace files during a checkpoint. That process happens asynchronously on a continuous basis by InnoDB's write I/O background threads configured by the system variable. If you want to make this process more aggressive, then you can decrease the value of the system variable. You may also need to better tune InnoDB's I/O capacity on your system by setting the system variable.

    Determining the Checkpoint Age

    The checkpoint age is the amount of data written to the InnoDB redo log since the last checkpoint.

    Determining the Checkpoint Age in InnoDB

    MariaDB starting with

    reintroduced the status variable for determining the checkpoint age.

    The checkpoint age can also be determined by the process shown below.

    To determine the InnoDB checkpoint age, do the following:

    • Query .

    • Find the LOG section:

    • Perform the following calculation:

    innodb_checkpoint_age = Log sequence number - Last checkpoint at

    In the example above, that would be:

    • innodb_checkpoint_age = Log sequence number - Last checkpoint at

    • = 252794398789379 - 252792767756840

    • = 1631032539 bytes

    Determining the Redo Log Occupancy

    The redo log occupancy is the percentage of the InnoDB redo log capacity that is taken up by dirty pages that have not yet been flushed to the physical InnoDB tablespace files in a checkpoint. Therefore, it's determined by the following calculation:

    innodb_log_occupancy = /

    For example, if is 1.5G and is 4G, then we would have the following:

    • innodb_log_occupancy = /

    • = 1.5G / 4G

    • = 0.375

    If the calculated value for redo log occupancy is too close to 1.0, then the InnoDB redo log capacity may be too small for the current workload.

    Updates

    A number of redo log improvements were made in :

    • Autosize innodb_buffer_pool_chunk_size ().

    • Improve the redo log for concurrency ().

    • Remove FIL_PAGE_FILE_FLUSH_LSN ().

    Before , created a zero-length ib_logfile0 as a dummy placeholder. From (), the size of that dummy file was increased to 12304 (0x3010) bytes, and all updates of FIL_PAGE_FILE_FLUSH_LSN in the first page of the system tablespace are removed.

    From , if the server is started up with a zero-sized ib_logfile0, it is assumed that an upgrade is being performed after a backup had been prepared. The start LSN will then be read from FIL_PAGE_FILE_FLUSH_LSN, and a new log file are created starting from exactly that LSN.

    Manually creating a zero-sized ib_logfile0 without manually updating the FIL_PAGE_FILE_FLUSH_LSN in the system tablespace to a recent enough LSN may result in error messages such as "page LSN is in the future". If a log was discarded while some changes had already been written to data pages, all sort of corruption may occur.

    If the database was initialized with a server that never updates the FIL_PAGE_FILE_FLUSH_LSN field, then any server startup attempts with a zero-size ib_logfile0 are refused because of an invalid LSN. If that field was ever updated with a valid LSN by an older server, this safety mechanism cannot work, and the server may "rewind" to an earlier LSN.

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

    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

    DROP INDEX
    RENAME TABLE
    InnoDB Schema Changes with the INSTANT Algorithm
    InnoDB Schema Changes with the NOCOPY Algorithm

    InnoDB 5.7.18

    InnoDB 5.7.14

    InnoDB 5.6.36

    InnoDB 5.6.35

    InnoDB 5.6.33

    InnoDB 5.6.32

    InnoDB 5.6.31

    InnoDB 5.6.30

    InnoDB 5.6.29

    InnoDB 5.6.36

    InnoDB 5.6.35

    InnoDB 5.6.33

    InnoDB 5.6.32

    InnoDB 5.6.31

    InnoDB 5.6.30

    InnoDB 5.6.29

    InnoDB 5.6.28

    InnoDB 5.6.27

    InnoDB 5.6.26

    InnoDB 5.6.25

    InnoDB 5.6.24

    InnoDB 5.6.23

    InnoDB 5.6.22

    InnoDB 5.6.21

    InnoDB 5.6.20

    InnoDB 5.6.19

    InnoDB 5.6.17

    InnoDB 5.6.15

    InnoDB 5.6.14

    No longer reported

    InnoDB 5.7.20

    InnoDB 5.7.19

    InnoDB 5.7.14

    InnoDB 5.7.29

    InnoDB 5.7.23

    InnoDB 5.7.22

    InnoDB 5.7.21

    InnoDB 5.7.20

    InnoDB 5.7.19

    InnoDB 5.6.49

    InnoDB 5.6.47

    InnoDB 5.6.44

    InnoDB 5.6.42

    InnoDB 5.6.39

    InnoDB 5.6.37

    InnoDB 5.6.43

    InnoDB 5.6.42

    InnoDB 5.6.40

    InnoDB 5.6.39

    InnoDB 5.6.38

    InnoDB 5.6.37

    system variables
    Using InnoDB instead of XtraDB
    MDEV-6076
    MDEV-11369
    Why MariaDB uses InnoDB instead of XtraDB from MariaDB 10.2
    XtraDB Versions

    Location

    Set by (Defaults to )

    Quantity

    1 (ES 10.5+, CS 10.5+)

    Size

    Set by (default varies)

    = 1631032539 byes / (1024 * 1024 * 1024) (GB/bytes)
  • = 1.5 GB of redo log written since last checkpoint

  • Transaction Log

    InnoDB Redo Log

    Storage Engine

    InnoDB

    Purpose

    Crash Safety

    Availability

    All ES and CS versions

    MariaDB Enterprise Server

    innodb_flush_log_at_trx_commit
    innodb_flush_log_at_trx_commit=1
    binary log
    Binary Log Group Commit and InnoDB Flushing Performance
    innodb_log_file_size
    innodb_log_file_size
    innodb_log_files_in_group
    innodb_log_file_size
    innodb_log_files_in_group
    innodb_log_file_size
    innodb_log_files_in_group
    innodb_log_file_size
    InnoDB buffer pool
    InnoDB buffer pool
    innodb_write_io_threads
    innodb_max_dirty_pages_pct
    innodb_io_capacity
    Innodb_checkpoint_age
    SHOW ENGINE INNODB STATUS
    innodb_checkpoint_age
    innodb_log_group_capacity
    innodb_checkpoint_age
    innodb_log_group_capacity
    innodb_checkpoint_age
    innodb_log_group_capacity
    MDEV-25342
    MDEV-14425
    MDEV-27199
    mariadb-backup --prepare
    MDEV-14425

    InnoDB Strict Mode

    InnoDB Strict Mode enforces stricter SQL compliance, returning errors instead of warnings for invalid CREATE TABLE options or potential data loss.

    strict mode is similar to . When it is enabled, certain InnoDB warnings become errors instead.

    Configuring InnoDB Strict Mode

    InnoDB strict mode is enabled by default.

    InnoDB strict mode can be enabled or disabled by configuring the server system variable.

    Its global value can be changed dynamically with :

    Its value for the current session can also be changed dynamically with

    InnoDB File-Per-Table Tablespaces

    Learn how to configure InnoDB to store each table in its own .ibd file, enabling features like table compression and easier space reclamation.

    When you create a table using the , data written to that table is stored on the file system in a data file called a tablespace. Tablespace files contain both the data and indexes.

    When is set, InnoDB uses one tablespace file per InnoDB table. These tablespace files have the .ibd extension. When is set, InnoDB stores all tables in the .

    InnoDB versions in MySQL 5.7 and above also support an additional type of tablespace called that are created with . However, InnoDB versions in MariaDB Server do not support general tablespaces or .

    [mariadb]
    ...
    innodb_log_file_size=2G
    SET GLOBAL innodb_log_file_size=(2 * 1024 * 1024 * 1024);
    
    SHOW GLOBAL VARIABLES
       LIKE 'innodb_log_file_size';
    +----------------------+------------+
    | Variable_name        | Value      |
    +----------------------+------------+
    | innodb_log_file_size | 2147483648 |
    +----------------------+------------+
    ---
    LOG
    ---
    Log sequence number 252794398789379
    Log flushed up to 252794398789379
    Pages flushed up to 252792767756840
    Last checkpoint at 252792767756840
    0 pending log flushes, 0 pending chkp writes
    23930412 log i/o's done, 2.03 log i/o's/second
    :

    It can also be set in a server option group in an option file prior to starting up the server:

    InnoDB Strict Mode Errors

    Wrong Create Options

    If InnoDB strict mode is enabled, and if a DDL statement is executed and invalid or conflicting table options are specified, then an error is raised. The error will only be a generic error that says the following:

    However, more details about the error can be found by executing SHOW WARNINGS.

    For example, the error is raised in the following cases:

    • The KEY_BLOCK_SIZE table option is set to a non-zero value, but the ROW_FORMAT table option is set to some row format other than the COMPRESSED row format:

    • The KEY_BLOCK_SIZE table option is set to a non-zero value, but the configured value is larger than either 16 or the value of the innodb_page_size system variable, whichever is smaller.

    • The KEY_BLOCK_SIZE table option is set to a non-zero value, but the innodb_file_per_table system variable is not set to ON.

    • The KEY_BLOCK_SIZE table option is set to a non-zero value, but it is not set to one of the supported values: [1, 2, 4, 8, 16].

    • The ROW_FORMAT table option is set to the COMPRESSED row format, but the innodb_file_per_table system variable is not set to ON.

    • The ROW_FORMAT table option is set to a value, but it is not set to one of the values supported by InnoDB: REDUNDANT, COMPACT, DYNAMIC, and COMPRESSED.

    • Either the KEY_BLOCK_SIZE table option is set to a non-zero value or the ROW_FORMAT table option is set to the COMPRESSED row format, but the innodb_page_size system variable is set to a value greater than 16k.

    • The DATA DIRECTORY table option is set, but the innodb_file_per_table system variable is not set to ON.

    • The DATA DIRECTORY table option is set, but the table is a temporary table.

    • The INDEX DIRECTORY table option is set.

    • The PAGE_COMPRESSED table option is set to 1, so InnoDB page compression is enabled, but the ROW_FORMAT table option is set to some row format other than the COMPACT or DYNAMIC row formats.

    • The PAGE_COMPRESSED table option is set to 1, so InnoDB page compression is enabled, but the innodb_file_per_table system variable is not set to ON.

    • The PAGE_COMPRESSED table option is set to 1, so InnoDB page compression is enabled, but the KEY_BLOCK_SIZE table option is also specified.

    • The PAGE_COMPRESSION_LEVEL table option is set, but the PAGE_COMPRESSED table option is set to 0, so InnoDB page compression is disabled.

    COMPRESSED Row Format

    If InnoDB strict mode is enabled, and if a table uses the COMPRESSED row format, and if the table's KEY_BLOCK_SIZE is too small to contain a row, then an error is returned by the statement.

    Row Size Too Large

    If InnoDB strict mode is enabled, and if a table exceeds its row format's maximum row size, then InnoDB will return an error.

    See Troubleshooting Row Size Too Large Errors with InnoDB for more information.

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

    InnoDB
    SQL strict mode
    innodb_strict_mode
    SET GLOBAL
    SET SESSION
    SET GLOBAL innodb_strict_mode=ON;
    SET SESSION innodb_strict_mode=ON;
    [mariadb]
    ...
    innodb_strict_mode=ON
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    KEY_BLOCK_SIZE=4
    ROW_FORMAT=DYNAMIC;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.   |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    KEY_BLOCK_SIZE=16;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8.                 |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET GLOBAL innodb_file_per_table=OFF;
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    KEY_BLOCK_SIZE=4;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.             |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    KEY_BLOCK_SIZE=5;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+-----------------------------------------------------------------------+
    | Level   | Code | Message                                                               |
    +---------+------+-----------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: invalid KEY_BLOCK_SIZE = 5. Valid values are [1, 2, 4, 8, 16] |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options")    |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB       |
    +---------+------+-----------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET GLOBAL innodb_file_per_table=OFF;
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    ROW_FORMAT=COMPRESSED;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.      |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    ROW_FORMAT=PAGE;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: invalid ROW_FORMAT specifier.                              |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    ROW_FORMAT=COMPRESSED;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+-----------------------------------------------------------------------+
    | Level   | Code | Message                                                               |
    +---------+------+-----------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options")    |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB       |
    +---------+------+-----------------------------------------------------------------------+
    3 rows in set (0.00 sec)
    SET GLOBAL innodb_file_per_table=OFF;
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    DATA DIRECTORY='/mariadb';
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: DATA DIRECTORY requires innodb_file_per_table.             |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TEMPORARY TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    DATA DIRECTORY='/mariadb';
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: DATA DIRECTORY cannot be used for TEMPORARY tables.        |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    INDEX DIRECTORY='/mariadb';
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning | 1478 | InnoDB: INDEX DIRECTORY is not supported                           |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    PAGE_COMPRESSED=1
    ROW_FORMAT=COMPRESSED;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning |  140 | InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=COMPRESSED       |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET GLOBAL innodb_file_per_table=OFF;
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    PAGE_COMPRESSED=1;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning |  140 | InnoDB: PAGE_COMPRESSED requires innodb_file_per_table.            |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    PAGE_COMPRESSED=1
    KEY_BLOCK_SIZE=4;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning |  140 | InnoDB: PAGE_COMPRESSED table can't have key_block_size            |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       id INT PRIMARY KEY,
       str VARCHAR(50)
    )
    PAGE_COMPRESSED=0
    PAGE_COMPRESSION_LEVEL=9;
    ERROR 1005 (HY000): Can't create table `db1`.`tab` (errno: 140 "Wrong create options")
    
    SHOW WARNINGS;
    +---------+------+--------------------------------------------------------------------+
    | Level   | Code | Message                                                            |
    +---------+------+--------------------------------------------------------------------+
    | Warning |  140 | InnoDB: PAGE_COMPRESSION_LEVEL requires PAGE_COMPRESSED            |
    | Error   | 1005 | Can't create table `db1`.`tab` (errno: 140 "Wrong create options") |
    | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB    |
    +---------+------+--------------------------------------------------------------------+
    3 rows in set (0.000 sec)
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT OR BLOB may help. IN current row format, BLOB prefix of 0 bytes IS stored inline.
    File-Per-Table Tablespace Locations

    By default, InnoDB's file-per-table tablespaces are created in the system's data directory, which is defined by the datadir system variable. The system variable innodb_data_home_dir will not change the location of file-per-table tablespaces.

    In the event that you have a specific tablespace that you need stored in a dedicated path, you can set the location using the DATA DIRECTORY table option when you create the table.

    For instance,

    MariaDB then creates a database directory on the configured path and the file-per-table tablespace are created inside that directory. On Unix-like operating systems, you can see the file using the ls command:

    Note, the system user that runs the MariaDB Server process (which is usually mysql) must have write permissions on the given path.

    Copying Transportable Tablespaces

    InnoDB's file-per-table tablespaces are transportable, which means that you can copy a file-per-table tablespace from one MariaDB Server to another server. You may find this useful in cases where you need to transport full tables between servers and don't want to use backup tools like mariadb-backup or mariadb-dump. In fact, this process can even be used with mariadb-backup in some cases, such as when restoring partial backups or when restoring individual tables or partitions from a backup.

    Copying Transportable Tablespaces for Non-partitioned Tables

    You can copy the transportable tablespace of a non-partitioned table from one server to another by exporting the tablespace file from the original server, and then importing the tablespace file into the new server.

    MariaDB starting with

    The workflow is simplified starting from . On the source server, simply do:

    On the destination server, simply do:

    Exporting Transportable Tablespaces for Non-partitioned Tables

    You can export a non-partitioned table by locking the table and copying the table's .ibd and .cfg files from the relevant tablespace location for the table to a backup location. For example, the process would go like this:

    • First, use the FLUSH TABLES ... FOR EXPORT statement on the target table:

    This forces the server to close the table and provides your connection with a read lock on the table.

    • Then, while your connection still holds the lock on the table, copy the tablespace file and the metadata file to a safe directory:

    • Then, once you've copied the files, you can release the lock with UNLOCK TABLES:

    Importing Transportable Tablespaces for Non-partitioned Tables

    You can import a non-partitioned table by discarding the table's original tablespace, copying the table's .ibd and .cfg files from the backup location to the relevant tablespace location for the table, and then telling the server to import the tablespace.

    For example, the process would go like this:

    • First, on the destination server, you need to create a copy of the table. Use the same CREATE TABLE statement that was used to create the table on the original server.

    • Then, use ALTER TABLE ... DISCARD TABLESPACE to discard the new table's tablespace:

    • Then, copy the .ibd and .cfg files from the original server to the relevant directory on the target MariaDB Server.

    File-per-table tablespaces can be imported with just the .ibd file in many cases. If you do not have the tablespace's .cfg file for whatever reason, then it is usually worth trying to import the tablespace with just the .ibd file.

    • Then, once the files are in the proper directory on the target server, use ALTER TABLE ... IMPORT TABLESPACE to import the new table's tablespace:

    Copying Transportable Tablespaces for Partitioned Tables

    Currently, MariaDB does not directly support the transport of tablespaces from partitioned tables. See MDEV-10568 for more information about that. It is still possible to transport partitioned tables if we use a workaround. You can copy the transportable tablespaces of a partitioned table from one server to another by exporting the tablespace file of each partition from the original server, and then importing the tablespace file of each partition into the new server.

    Exporting Transportable Tablespaces for Partitioned Tables

    You can export a partitioned table by locking the table and copying the .ibd and .cfg files of each partition from the relevant tablespace location for the partition to a backup location. For example, the process would go like this:

    • First, let's create a test table with some data on the original server:

    • Then, we need to export the partitioned tablespace from the original server, which follows the same process as exporting non-partitioned tablespaces. That means that we need to use the FLUSH TABLES ... FOR EXPORT statement on the target table:

    This forces the server to close the table and provides your connection with a read lock on the table.

    • Then, if we grep the database directory in the data directory for the newly created t2 table, we can see a number of .ibd and .cfg files for the table:

    • Then, while our connection still holds the lock on the table, we need to copy the tablespace files and the metadata files to a safe directory:

    • Then, once we've copied the files, we can release the lock with UNLOCK TABLES:

    Importing Transportable Tablespaces for Partitioned Tables

    You can import a partitioned table by creating a placeholder table, discarding the placeholder table's original tablespace, copying the partition's .ibd and .cfg files from the backup location to the relevant tablespace location for the placeholder table, and then telling the server to import the tablespace. At that point, the server can exchange the tablespace for the placeholder table with the one for the partition. For example, the process would go like this:

    • First, we need to copy the saved tablespace files from the original server to the target server:

    • Then, we need to import the partitioned tablespaces onto the target server. The import process for partitioned tables is more complicated than the import process for non-partitioned tables. To start with, if it doesn't already exist, then we need to create a partitioned table on the target server that matches the partitioned table on the original server:

    • Then, using this table as a model, we need to create a placeholder of this table with the same structure that does not use partitioning. This can be done with a CREATE TABLE... AS SELECT statement:

    This statement will create a new table called t2_placeholder that has the same schema structure as t2, but it does not use partitioning and it contains no rows.

    For Each Partition

    From this point forward, the rest of our steps need to happen for each individual partition. For each partition, we need to do the following process:

    • First, we need to use ALTER TABLE ... DISCARD TABLESPACE to discard the placeholder table's tablespace:

    • Then, copy the .ibd and .cfg files for the next partition to the relevant directory for the t2_placeholder table on the target MariaDB Server:

    File-per-table tablespaces can be imported with just the .ibd file in many cases. If you do not have the tablepace's .cfg file for whatever reason, then it is usually worth trying to import the tablespace with just the .ibd file.

    • Then, once the files are in the proper directory on the target server, we need to use ALTER TABLE ... IMPORT TABLESPACE to import the new table's tablespace:

    The placeholder table now contains data from the p0 partition on the source server.

    • Then, it's time to transfer the partition from the placeholder to the target table. This can be done with an ALTER TABLE... EXCHANGE PARTITION statement:

    The target table now contains the first partition from the source table.

    • Repeat this procedure for each partition you want to import. For each partition, we need to discard the placeholder table's tablespace, and then import the partitioned table's tablespace into the placeholder table, and then exchange the tablespaces between the placeholder table and the partition of our target table.

    When this process is complete for all partitions, the target table will contain the imported data:

    • Then, we can remove the placeholder table from the database:

    Known Problems with Copying Transportable Tablespaces

    Differing Storage Formats for Temporal Columns

    added the mysql56_temporal_format system variable, which enables a new MySQL 5.6-compatible storage format for the TIME, DATETIME and TIMESTAMP data types.

    If a file-per-tablespace file contains columns that use one or more of these temporal data types and if the tablespace file's original table was created with a certain storage format for these columns, then the tablespace file can only be imported into tables that were also created with the same storage format for these columns as the original table. Otherwise, you will see errors like the following:

    See MDEV-15225 for more information.

    See the pages for the TIME, DATETIME and TIMESTAMP data types to determine how to update the storage format for temporal columns in tables that were created before or that were created with mysql56_temporal_format=OFF.

    Differing ROW_FORMAT Values

    InnoDB file-per-table tablespaces can use different row formats. A specific row format can be specified when creating a table either by setting the ROW_FORMAT table option or by the setting the innodb_default_row_format system variable. See Setting a Table's Row Format for more information on how to set an InnoDB table's row format.

    If a file-per-tablespace file was created with a certain row format, then the tablespace file can only be imported into tables that were created with the same row format as the original table. Otherwise, you will see errors like the following:

    The error message is a bit more descriptive in and later:

    Be sure to check a tablespace's row format before moving it from one server to another. Keep in mind that the default row format can change between major versions of MySQL or MariaDB. See Checking a Table's Row Format for information on how to check an InnoDB table's row format.

    See MDEV-15049 and MDEV-16851 for more information.

    Foreign Key Constraints

    DISCARD on a table with foreign key constraints is only possible after disabling foreign_key_checks:

    IMPORT on the other hand does not enforce foreign key constraints. So when importing tablespaces, referential integrity can only be guaranteed to import all tables bound by foreign key constraint at the same time, from an EXPORT of those tables taken with the same transactional state.

    Tablespace Encryption

    MariaDB supports data-at-rest encryption for the InnoDB storage engine. When enabled, the Server encrypts data before writing it to the tablespace and decrypts reads from the tablespace before returning result-sets. This means that a malicious user attempting to exfiltrate sensitive data won't be able to import the tablespace onto a different server as shown above without the encryption key.

    For more information on data encryption, see Encrypting Data for InnoDB.

    See Also

    • Geoff Montee:Importing InnoDB Partitions in MySQL 5.6 and MariaDB 10.0/10.1

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

    InnoDB storage engine
    innodb_file_per_table=ON
    innodb_file_per_table=OFF
    InnoDB system tablespace
    general tablespaces
    CREATE TABLESPACE
    CREATE TABLESPACE
    innodb_log_group_home_dir
    datadir
    Configure the InnoDB Redo Log
    innodb_log_file_size
    Configure the InnoDB Redo Log

    InnoDB Online DDL Overview

    An introduction to InnoDB's online DDL capabilities, detailing the ALGORITHM and LOCK clauses for controlling performance and concurrency during schema changes.

    InnoDB tables support online DDL, which permits concurrent DML and uses optimizations to avoid unnecessary table copying.

    The ALTER TABLE statement supports two clauses that are used to implement online DDL:

    • ALGORITHM - This clause controls how the DDL operation is performed.

    • LOCK - This clause controls how much concurrency is allowed while the DDL operation is being performed.

    Alter Algorithms

    InnoDB supports multiple algorithms for performing DDL operations. This offers a significant performance improvement over previous versions. The supported algorithms are:

    • DEFAULT - This implies the default behavior for the specific operation.

    • COPY

    • INPLACE

    Specifying an Alter Algorithm

    The set of alter algorithms can be considered as a hierarchy. The hierarchy is ranked in the following order, with least efficient algorithm at the top, and most efficient algorithm at the bottom:

    • COPY

    • INPLACE

    • NOCOPY

    • INSTANT

    When a user specifies an alter algorithm for a DDL operation, MariaDB does not necessarily use that specific algorithm for the operation. It interprets the choice in the following way:

    • If the user specifies COPY, then InnoDB uses the COPY algorithm.

    • If the user specifies any other algorithm, then InnoDB interprets that choice as the least efficient algorithm that the user is willing to accept. This means that if the user specifies INPLACE, then InnoDB will use the most efficient algorithm supported by the specific operation from the set (INPLACE, NOCOPY, INSTANT). Likewise, if the user specifies NOCOPY

    There is also a special value that can be specified:

    • If the user specifies DEFAULT, then InnoDB uses its default choice for the operation. The default choice is to use the most efficient algorithm supported by the operation. The default choice will also be used if no algorithm is specified. Therefore, if you want InnoDB to use the most efficient algorithm supported by an operation, then you usually do not have to explicitly specify any algorithm at all.

    Specifying an Alter Algorithm Using the ALGORITHM Clause

    InnoDB supports the clause.

    The clause can be used to specify the least efficient algorithm that the user is willing to accept. It is supported by the and statements.

    For example, if a user wanted to add a column to a table, but only if the operation used an algorithm that is at least as efficient as the INPLACE, then they could execute the following:

    The above operation should use the INSTANT algorithm, because the ADD COLUMN operation supports the INSTANT algorithm, and the INSTANT algorithm is more efficient than the INPLACE algorithm.

    Specifying an Alter Algorithm Using System Variables

    The system variable can be used to pick the least efficient algorithm that the user is willing to accept.

    For example, if a user wanted to add a column to a table, but only if the operation used an algorithm that is at least as efficient as the INPLACE, then they could execute the following:

    The above operation would actually use the INSTANT algorithm, because the ADD COLUMN operation supports the INSTANT algorithm, and the INSTANT algorithm is more efficient than the INPLACE algorithm. <>

    Supported Alter Algorithms

    The supported algorithms are described in more details below.

    DEFAULT Algorithm

    The default behavior, which occurs if ALGORITHM=DEFAULT is specified, or if ALGORITHM is not specified at all, usually only makes a copy if the operation doesn't support being done in-place at all. In this case, the most efficient available algorithm will usually be used.

    This means that, if an operation supports the INSTANT algorithm, then it will use that algorithm by default. If an operation does not support the INSTANT algorithm, but it does support the NOCOPY algorithm, then it will use that algorithm by default. If an operation does not support the NOCOPY algorithm, but it does support the INPLACE algorithm, then it will use that algorithm by default.

    COPY Algorithm

    The COPY algorithm refers to the original algorithm.

    When the COPY algorithm is used, MariaDB essentially does the following operations:

    This algorithm is very inefficient, but it is generic, so it works for all storage engines.

    If the COPY algorithm is specified with the clause or with the system variable, then the COPY algorithm are used even if it is not necessary. This can result in a lengthy table copy. If multiple operations are required that each require the table to be rebuilt, then it is best to specify all operations in a single statement, so that the table is only rebuilt once.

    Using the COPY Algorithm with InnoDB

    If the COPY algorithm is used with an table, then the following statements apply:

    • The table are rebuilt using the current values of the , , and system variables.

    • The operation will have to create a temporary table to perform the table copy. This temporary table are in the same directory as the original table, and it's file name are in the format #sql${PID}_${THREAD_ID}_${TMP_TABLE_COUNT}, where ${PID} is the process ID of mysqld, ${THREAD_ID} is the connection ID, and ${TMP_TABLE_COUNT} is the number of temporary tables that the connection has open. Therefore, the may contain files with file names like #sql1234_12_1.ibd

    INPLACE Algorithm

    The COPY algorithm can be incredibly slow, because the whole table has to be copied and rebuilt. The INPLACE algorithm was introduced as a way to avoid this by performing operations in-place and avoiding the table copy and rebuild, when possible.

    When the INPLACE algorithm is used, the underlying storage engine uses optimizations to perform the operation while avoiding the table copy and rebuild. However, INPLACE is a bit of a misnomer, since some operations may still require the table to be rebuilt for some storage engines. Regardless, several operations can be performed without a full copy of the table for some storage engines.

    A more accurate name for the algorithm would have been the ENGINE algorithm, since the decides how to implement the algorithm.

    If an operation supports the INPLACE algorithm, then it can be performed using optimizations by the underlying storage engine, but it may rebuilt.

    If the INPLACE algorithm is specified with the clause or with the system variable and if the operation does not support the INPLACE algorithm, then an error are raised:

    In this case, raising an error is preferable, if the alternative is for the operation to make a copy of the table, and perform unexpectedly slowly.

    Using the INPLACE Algorithm with InnoDB

    If the INPLACE algorithm is used with an table, then the following statements apply:

    • The operation might have to write sort files in the directory defined by the system variable.

    • The operation might also have to write a temporary log file to track data changes by executed during the operation. The maximum size for this log file is configured by the system variable.

    • Some operations require the table to be rebuilt, even though the algorithm is inaccurately called "in-place". This includes operations such as adding or dropping columns, adding a primary key, changing a column to , etc.

    Operations Supported by InnoDB with the INPLACE Algorithm

    With respect to the allowed operations, the INPLACE algorithm supports a subset of the operations supported by the COPY algorithm, and it supports a superset of the operations supported by the NOCOPY algorithm.

    See for more information.

    NOCOPY Algorithm

    The NOCOPY algorithm is supported. The INPLACE algorithm can sometimes be surprisingly slow in instances where it has to rebuild the clustered index, because when the clustered index has to be rebuilt, the whole table has to be rebuilt. The NOCOPY algorithm was introduced as a way to avoid this.

    If an operation supports the NOCOPY algorithm, then it can be performed without rebuilding the clustered index.

    If the NOCOPY algorithm is specified with the clause or with the system variable and if the operation does not support the NOCOPY algorithm, then an error are raised:

    In this case, raising an error is preferable, if the alternative is for the operation to rebuild the clustered index, and perform unexpectedly slowly.

    Operations Supported by InnoDB with the NOCOPY Algorithm

    With respect to the allowed operations, the NOCOPY algorithm supports a subset of the operations supported by the INPLACE algorithm, and it supports a superset of the operations supported by the INSTANT algorithm.

    See for more information.

    INSTANT Algorithm

    The INSTANT algorithm is supported. The INPLACE algorithm can sometimes be surprisingly slow in instances where it has to modify data files. The INSTANT algorithm was introduced as a way to avoid this.

    If an operation supports the INSTANT algorithm, then it can be performed without modifying any data files.

    If the INSTANT algorithm is specified with the clause or with the system variable and if the operation does not support the INSTANT algorithm, then an error are raised:

    In this case, raising an error is preferable, if the alternative is for the operation to modify data files, and perform unexpectedly slowly.

    Operations Supported by InnoDB with the INSTANT Algorithm

    With respect to the allowed operations, the INSTANT algorithm supports a subset of the operations supported by the NOCOPY algorithm.

    See for more information.

    Alter Locking Strategies

    InnoDB supports multiple locking strategies for performing DDL operations. This offers a significant performance improvement over previous versions. The supported locking strategies are:

    • DEFAULT - This implies the default behavior for the specific operation.

    • NONE

    • SHARED

    Regardless of which locking strategy is used to perform a DDL operation, InnoDB will have to exclusively lock the table for a short time at the start and end of the operation's execution. This means that any active transactions that may have accessed the table must be committed or aborted for the operation to continue. This applies to most DDL statements, such as , , , , , etc.

    Specifying an Alter Locking Strategy

    Specifying an Alter Locking Strategy Using the LOCK Clause

    The statement supports the clause.

    The clause can be used to specify the locking strategy that the user is willing to accept. It is supported by the and statements.

    For example, if a user wanted to add a column to a table, but only if the operation is non-locking, then they could execute the following:

    If the clause is not explicitly set, then the operation uses LOCK=DEFAULT.

    Specifying an Alter Locking Strategy Using ALTER ONLINE TABLE

    is equivalent to LOCK=NONE. Therefore, the statement can be used to ensure that your operation allows all concurrent DML.

    Supported Alter Locking Strategies

    The supported algorithms are described in more details below.

    To see which locking strategies InnoDB supports for each operation, see the pages that describe which operations are supported for each algorithm:

    DEFAULT Locking Strategy

    The default behavior, which occurs if LOCK=DEFAULT is specified, or if LOCK is not specified at all, acquire the least restrictive lock on the table that is supported for the specific operation. This permits the maximum amount of concurrency that is supported for the specific operation.

    NONE Locking Strategy

    The NONE locking strategy performs the operation without acquiring any lock on the table. This permits all concurrent DML.

    If this locking strategy is not permitted for an operation, then an error is raised.

    SHARED Locking Strategy

    The SHARED locking strategy performs the operation after acquiring a read lock on the table. This permit read-only concurrent DML.

    If this locking strategy is not permitted for an operation, then an error is raised.

    EXCLUSIVE Locking Strategy

    The EXCLUSIVE locking strategy performs the operation after acquiring a write lock on the table. This does not permit concurrent DML.

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

    InnoDB COMPRESSED Row Format

    Learn about the COMPRESSED row format, which compresses data and index pages using algorithms like zlib to minimize storage footprint at the cost of CPU.

    An alternative (and usually superior) way to compress InnoDB tables is by using . See .

    The COMPRESSED row format is similar to the COMPACT row format, but tables using the COMPRESSED row format can store even more data on overflow pages than tables using the COMPACT row format. This results in more efficient data storage than tables using the COMPACT row format, especially for tables containing columns using the , , and data types.

    The COMPRESSED row format also supports compression of all data and index pages.

    InnoDB Recovery Modes

    Understand the different `innodb_force_recovery` levels, which allow you to start the server in read-only modes to recover data after a crash.

    The InnoDB recovery mode is a mode used for recovering from emergency situations. You should ensure you have a backup of your database before making changes in case you need to restore it. The server system variable sets the recovery mode. A mode of 0 is normal use, while the higher the mode, the more stringent the restrictions. Higher modes incorporate all limitations of the lower modes.

    The recovery mode should never be set to a value other than zero except in an emergency situation.

    Please note that recovery mode does not repair corruption. The corrupted files remain corrupted regardless of recovery mode. The sole purpose of recovery mode is to allow read access to the data, if at all possible.

    Generally, it is best to start with a recovery mode of 1, and increase in single increments if needs be. With a recovery mode < 4, only corrupted pages should be lost. With 4, secondary indexes could be corrupted. With 5, results could be inconsistent and secondary indexes could be corrupted (even if they were not with 4). A value of 6 leaves pages in an obsolete state, which might cause more corruption.

    Until , mode 0 was the only mode permitting changes to the data. From , write transactions are permitted with mode 3

    CREATE TABLE test.t1 (
       id INT PRIMARY KEY AUTO_INCREMENT,
       name VARCHAR(50)
    ) ENGINE=InnoDB
    DATA DIRECTORY = "/data/contact";
    # ls -al /data/contact/test
    drwxrwx--- 2 mysql mysql  4096 Dec 8 18:46 .
    drwxr-xr-x 3 mysql mysql  4096 Dec 8 18:46 ..
    -rw-rw---- 1 mysql mysql 98304 Dec 8 20:41 t1.ibd
    FLUSH TABLES t1 FOR EXPORT;
    # scp /data/contacts/test/t1.ibd target-server.com:/var/lib/mysql/test/
    # scp /data/contacts/test/t1.cfg target-server.com:/var/lib/mysql/test/
    # scp /data/contacts/test/t1.frm target-server.com:/var/lib/mysql/test/
    UNLOCK TABLES;
    ALTER TABLE t1 IMPORT TABLESPACE;
    FLUSH TABLES test.t1 FOR EXPORT;
    # cp /data/contacts/test/t1.ibd /data/saved-tablespaces/
    # cp /data/contacts/test/t1.cfg /data/saved-tablespaces/
    UNLOCK TABLES;
    CREATE TABLE test.t1 (
       id INT PRIMARY KEY AUTO_INCREMENT,
       name VARCHAR(50)
    ) ENGINE=InnoDB;
    ALTER TABLE test.t1 DISCARD TABLESPACE;
    # scp /data/tablespaces/t1.ibd target-server.com:/var/lib/mysql/test/
    # scp /data/tablespaces/t1.cfg target-server.com:/var/lib/mysql/test/
    ALTER TABLE test.t1 IMPORT TABLESPACE;
    CREATE TABLE test.t2 (
       employee_id INT,
       name VARCHAR(50)
    ) ENGINE=InnoDB
    PARTITION BY RANGE (employee_id) (
       PARTITION p0 VALUES LESS THAN (6),
       PARTITION p1 VALUES LESS THAN (11),
       PARTITION p2 VALUES LESS THAN (16),
       PARTITION p3 VALUES LESS THAN MAXVALUE
    );
    
    INSERT INTO test.t2 (name, employee_id) VALUES
       ('Geoff Montee', 1), 
       ('Chris Calendar', 6),
       ('Kyle Joiner', 11), 
       ('Will Fong', 16);
    FLUSH TABLES test.t2 FOR EXPORT;
    # ls -l /var/lib/mysql/test/ | grep t2
    total 428
    -rw-rw---- 1 mysql mysql 827 Dec 5 16:08 t2.frm
    -rw-rw---- 1 mysql mysql 48 Dec 5 16:08 t2.par
    -rw-rw---- 1 mysql mysql 579 Dec 5 18:47 t2#P#p0.cfg
    -rw-r----- 1 mysql mysql 98304 Dec 5 16:43 t2#P#p0.ibd
    -rw-rw---- 1 mysql mysql 579 Dec 5 18:47 t2#P#p1.cfg
    -rw-rw---- 1 mysql mysql 98304 Dec 5 16:08 t2#P#p1.ibd
    -rw-rw---- 1 mysql mysql 579 Dec 5 18:47 t2#P#p2.cfg
    -rw-rw---- 1 mysql mysql 98304 Dec 5 16:08 t2#P#p2.ibd
    -rw-rw---- 1 mysql mysql 579 Dec 5 18:47 t2#P#p3.cfg
    -rw-rw---- 1 mysql mysql 98304 Dec 5 16:08 t2#P#p3.ibd
    $ mkdir /tmp/backup
    $ sudo cp /var/lib/mysql/test/t2*.ibd /tmp/backup
    $ sudo cp /var/lib/mysql/test/t2*.cfg /tmp/backup
    UNLOCK TABLES;
    $ scp /tmp/backup/t2* user@target-host:/tmp/backup
    CREATE TABLE test.t2 (
       employee_id INT,
       name VARCHAR(50)
    ) ENGINE=InnoDB
    PARTITION BY RANGE (employee_id) (
       PARTITION p0 VALUES LESS THAN (6),
       PARTITION p1 VALUES LESS THAN (11),
       PARTITION p2 VALUES LESS THAN (16),
       PARTITION p3 VALUES LESS THAN MAXVALUE
    );
    CREATE TABLE test.t2_placeholder LIKE test.t2;
    ALTER TABLE test.t2_placeholder REMOVE PARTITIONING;
    ALTER TABLE test.t2_placeholder DISCARD TABLESPACE;
    # cp /tmp/backup/t2#P#p0.cfg /var/lib/mysql/test/t2_placeholder.cfg
    # cp /tmp/backup/t2#P#p0.ibd /var/lib/mysql/test/t2_placeholder.ibd
    # chown mysql:mysql /var/lib/mysql/test/t2_placeholder*
    ALTER TABLE test.t2_placeholder IMPORT TABLESPACE;
    SELECT * FROM test.t2_placeholder;
    
    +-------------+--------------+
    | employee_id | name         |
    +-------------+--------------+
    |           1 | Geoff Montee |
    +-------------+--------------+
    ALTER TABLE test.t2 EXCHANGE PARTITION p0 WITH TABLE test.t2_placeholder;
    SELECT * FROM test.t2;
    
    +-------------+--------------+
    | employee_id | name         |
    +-------------+--------------+
    |           1 | Geoff Montee |
    +-------------+--------------+
    SELECT * FROM test.t2;
    
    +-------------+----------------+
    | employee_id | name           |
    +-------------+----------------+
    |           1 | Geoff Montee   |
    |           6 | Chris Calendar |
    |          11 | Kyle Joiner    |
    |          16 | Will Fong      |
    +-------------+----------------+
    DROP TABLE test.t2_placeholder;
    ALTER TABLE dt_test IMPORT TABLESPACE;
    ERROR 1808 (HY000): Schema mismatch (Column dt precise type mismatch.)
    ALTER TABLE t0 IMPORT TABLESPACE;
    ERROR 1808 (HY000): Schema mismatch (Expected FSP_SPACE_FLAGS=0x21, .ibd file contains 0x0.)
    ALTER TABLE t0 IMPORT TABLESPACE;
    ERROR 1808 (HY000): Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x0; .cfg file uses ROW_FORMAT=REDUNDANT)
    SET SESSION foreign_key_checks=0;
    ALTER TABLE t0 DISCARD TABLESPACE;
    NOCOPY
  • INSTANT

  • , then InnoDB will use the most efficient algorithm supported by the specific operation from the set (
    NOCOPY
    ,
    INSTANT
    ).
    .
  • The operation inserts one record at a time into each index, which is very inefficient.

  • InnoDB does not use a sort buffer.

  • The table copy operation creates a lot fewer InnoDB undo log writes. See MDEV-11415 for more information.

  • The table copy operation creates a lot of InnoDB redo log writes.

  • If the operation requires the table to be rebuilt, then the operation might have to create temporary tables.
    • It may have to create a temporary intermediate table for the actual table rebuild operation.

      • This temporary table are in the same directory as the original table, and it's file name are in the format #sql${PID}_${THREAD_ID}_${TMP_TABLE_COUNT}, where ${PID} is the process ID of mysqld, ${THREAD_ID} is the connection ID, and ${TMP_TABLE_COUNT} is the number of temporary tables that the connection has open. Therefore, the datadir may contain files with file names like #sql1234_12_1.ibd.

    • When it replaces the original table with the rebuilt table, it may also have to rename the original table using a temporary table name.

      • The system variable is set to OFF, then the format will actually be #sql-ib${TABLESPACE_ID}-${RAND}, where ${TABLESPACE_ID} is the table's tablespace ID within InnoDB and ${RAND} is a randomly initialized number. Therefore, the may contain files with file names like #sql-ib230291-1363966925.ibd.

  • The storage needed for the above items can add up to the size of the original table, or more in some cases.

  • Some operations are instantaneous, if they only require the table's metadata to be changed. This includes operations such as renaming a column, changing a column's DEFAULT value, etc.

  • EXCLUSIVE
    ALGORITHM
    ALGORITHM
    ALTER TABLE
    CREATE INDEX
    alter_algorithm
    ALTER TABLE
    ALGORITHM
    alter_algorithm
    ALTER TABLE
    ALTER TABLE
    InnoDB
    innodb_file_per_table
    innodb_file_format
    innodb_default_row_format
    datadir
    storage engine
    ALTER TABLE
    ALGORITHM
    alter_algorithm
    ALTER TABLE
    InnoDB
    innodb_tmpdir
    DML queries
    innodb_online_alter_log_max_size
    NULL
    InnoDB Online DDL Operations with ALGORITHM=INPLACE
    ALTER TABLE
    ALGORITHM
    alter_algorithm
    ALTER TABLE
    InnoDB Online DDL Operations with ALGORITHM=NOCOPY
    ALTER TABLE
    ALGORITHM
    alter_algorithm
    ALTER TABLE
    InnoDB Online DDL Operations with ALGORITHM=INSTANT
    ALTER TABLE
    CREATE INDEX
    DROP INDEX
    OPTIMIZE TABLE
    RENAME TABLE
    ALTER TABLE
    LOCK
    LOCK
    ALTER TABLE
    CREATE INDEX
    LOCK
    ALTER ONLINE TABLE
    ALTER ONLINE TABLE
    ALTER TABLE
    InnoDB Online DDL Operations with ALGORITHM=INPLACE
    InnoDB Online DDL Operations with ALGORITHM=NOCOPY
    InnoDB Online DDL Operations with ALGORITHM=INSTANT
    Supported Block Sizes

    The Compressed row format supports the following block sizes:

    Block Size
    KEY_BLOCK_SIZE Value

    1 KB

    1

    2 KB

    2

    4 KB

    4

    8 KB

    8

    16 KB

    16

    If the KEY_BLOCK_SIZE table option is not specified, the block size defaults to half of innodb_page_size. With the default 16 KB page size, the block size defaults to 8 KB.

    For compression to be effective, the chosen block size should be smaller than the servers value of the innodb_page_size system variable.

    Supported Index Prefix Limits

    The limit for indexing column values depends on the innodb_page_size value:

    Page Size
    Index Prefix Limit

    16k

    3072 bytes

    8k

    1536 bytes

    4k

    768 bytes

    Using the COMPRESSED Row Format

    The Compressed row format does not efficiently use the InnoDB buffer pool, so it is not the recommended way to achieve InnoDB table compression. For more information about how to compress InnoDB tables, see Configure InnoDB Page Compression.

    An InnoDB table that uses the COMPRESSED row format can be created by setting the ROW_FORMAT table option to COMPRESSED and by setting the KEY_BLOCK_SIZE table option to one of the following values in a CREATE TABLE or ALTER TABLE statement, where the units are in KB.

    16k is the default value of the innodb_page_size system variable, so using 16 will usually result in minimal compression unless one of the following is true:

    • The table has many columns that can be stored in overflow pages, such as columns that use the VARBINARY, VARCHAR, BLOB and TEXT data types.

    • The server is using a non-default innodb_page_size value that is greater than 16k.

    The value of the innodb_page_size system variable can be set to 32k and 64k. This is especially useful because the larger page size permits more columns using the VARBINARY, VARCHAR, BLOB and TEXT data types. Regardless, even when the value of the innodb_page_size system variable is set to some value higher than 16k, 16 is still the maximum value for the KEY_BLOCK_SIZE table option for InnoDB tables using the COMPRESSED row format.

    The COMPRESSED row format cannot be set as the default row format with the innodb_default_row_format system variable.

    The COMPRESSED row format is only supported by the Barracuda file format. In earlier versions, the COMPRESSED row format is only supported if the InnoDB file format is Barracuda. Therefore, the innodb_file_format system variable must be set to Barracuda to use these row formats in those versions.

    In earlier versions, the COMPRESSED row format is also only supported if the table is in a file per-table tablespace. Therefore, the innodb_file_per_table system variable must be set to ON to use this row format in those versions.

    It is also recommended to set the innodb_strict_mode system variable to ON when using this row format.

    InnoDB automatically uses the COMPRESSED row format for a table if the KEY_BLOCK_SIZE table option is set to some value in a CREATE TABLE or ALTER TABLE statement:

    If the KEY_BLOCK_SIZE table option is not set to some value, but the ROW_FORMAT table option is set to COMPRESSED in a CREATE TABLE or ALTER TABLE statement, then InnoDB uses a default value of 8 for the KEY_BLOCK_SIZE table option:

    Create an InnoDB Table with the Compressed Row Format using ROW_FORMAT

    The default block size for tables that use the Compressed row format is half of innodb_page_size. With the default 16 KB page size, the block size defaults to 8 KB. A compressed table with the default block size can be created by setting the ROW_FORMAT table option to COMPRESSED:

    Step-by-Step Procedure

    1. Connect to the server using MariaDB Client:

    1. Confirm that the default storage engine is InnoDB by checking the default_storage_engine system variable using the SHOW SESSION VARIABLES statement:

    1. Create the table using the CREATE TABLE statement, and specify the Compressed row format using the ROW_FORMAT table option:

    1. Confirm that the table uses the Compressed row format with an 8 KB block size by querying the information_schema.INNODB_SYS_TABLES table:

    Create an InnoDB Table with the Compressed Row Format using KEY_BLOCK_SIZE

    The default block size for tables that use the Compressed row format is half of innodb_page_size. With the default 16 KB page size, the block size defaults to 8 KB. A compressed table with a non-default block size can be created by setting the KEY_BLOCK_SIZE table option to the desired block size.

    Step-by-Step Procedure

    1. Connect to the server using MariaDB Client:

    1. Confirm that the default storage engine is InnoDB by checking the default_storage_engine system variable using the SHOW SESSION VARIABLES statement:

    1. Create the table using the CREATE TABLE statement, and specify the block size using the KEY_BLOCK_SIZE table option, which implies the Compressed row format:

    1. Confirm that the table uses the Compressed row format with an 8 KB block size by querying the information_schema.INNODB_SYS_TABLES table:

    Compression with the COMPRESSED Row Format

    The COMPRESSED row format supports compression of all data and index pages.

    To avoid compressing and uncompressing pages too many times, InnoDB tries to keep both compressed and uncompressed pages in the buffer pool when there is enough room. This results in a bigger cache. When there is not enough room, an adaptive LRU algorithm is used to decide whether compressed or uncompressed pages should be evicted from the buffer: for CPU-bound workloads, the compressed pages are evicted first; for I/O-bound workloads, the uncompressed pages are evicted first. Of course, when necessary, both the compressed and uncompressed version of the same data can be evicted from the buffer.

    Each compressed page has an uncompressed modification log, stored within the page itself. InnoDB writes small changes into it. When the space in the modification log runs out, the page is uncompressed, changes are applied, and the page is recompressed again. This is done to avoid some unnecessary decompression and compression operations.

    Sometimes a compression failure might happen, because the data has grown too much to fit the page. When this happens, the page (and the index node) is split into two different pages. This process can be repeated recursively until the data fit the pages. This can be CPU-consuming on some busy servers which perform many write operations.

    Before writing a compressed page into a data file, InnoDB writes it into the redo log. This ensures that the redo log can always be used to recover tables after a crash, even if the compression library is updated and some incompatibilities are introduced. But this also means that the redo log will grow faster and might need more space, or the frequency of checkpoints might need to increase.

    Monitoring Performance of the COMPRESSED Row Format

    The following INFORMATION_SCHEMA tables can be used to monitor the performances of InnoDB compressed tables:

    • INNODB_CMP and INNODB_CMP_RESET

    • INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET

    • INNODB_CMPMEM and INNODB_CMPMEM_RESET

    Index Prefixes with the COMPRESSED Row Format

    The COMPRESSED row format supports index prefixes up to 3072 bytes. In and before, the innodb_large_prefix system variable is used to configure the maximum index prefix length. In these versions, if innodb_large_prefix is set to ON, then the maximum prefix length is 3072 bytes, and if it is set to OFF, then the maximum prefix length is 767 bytes.

    Overflow Pages with the COMPRESSED Row Format

    All InnoDB row formats can store certain kinds of data in overflow pages. This allows for the maximum row size of an InnoDB table to be larger than the maximum amount of data that can be stored in the row's main data page. See Maximum Row Size for more information about the other factors that can contribute to the maximum row size for InnoDB tables.

    In the COMPRESSED row format variable-length columns, such as columns using the VARBINARY, VARCHAR, BLOB and TEXT data types, can be completely stored in overflow pages.

    InnoDB only considers using overflow pages if the table's row size is greater than half of innodb_page_size. If the row size is greater than this, then InnoDB chooses variable-length columns to be stored on overflow pages until the row size is less than half of innodb_page_size.

    For BLOB and TEXT columns, only values longer than 40 bytes are considered for storage on overflow pages. For VARBINARY and VARCHAR columns, only values longer than 255 bytes are considered for storage on overflow pages. Bytes that are stored to track a value's length do not count towards these limits. These limits are only based on the length of the actual column's data.

    These limits differ from the limits for the COMPACT row format, where the limit is 767 bytes for all types.

    Fixed-length columns greater than 767 bytes are encoded as variable-length columns, so they can also be stored in overflow pages if the table's row size is greater than half of innodb_page_size. Even though a column using the CHAR data type can hold at most 255 characters, a CHAR column can still exceed 767 bytes in some cases. For example, a char(255) column can exceed 767 bytes if the character set is utf8mb4.

    If a column is chosen to be stored on overflow pages, then the entire value of the column is stored on overflow pages, and only a 20-byte pointer to the column's first overflow page is stored on the main page. Each overflow page is the size of innodb_page_size. If a column is too large to be stored on a single overflow page, then it is stored on multiple overflow pages. Each overflow page contains part of the data and a 20-byte pointer to the next overflow page, if a next page exists.

    This behavior differs from the behavior of the COMPACT row format, which always stores the column prefix on the main page. This allows tables using the COMPRESSED row format to contain a high number of columns using the VARBINARY, VARCHAR, BLOB and TEXT data types.

    Read-Only

    MariaDB starting with 10.6

    From MariaDB 10.6.0 until MariaDB 10.6.5, tables that are of the COMPRESSED row format are read-only by default. This was intended to be the first step towards removing write support and deprecating the feature. This plan has been scrapped, and from MariaDB 10.6.6, COMPRESSED tables are no longer read-only by default. From MariaDB 10.6.0 to MariaDB 10.6.5, set the innodb_read_only_compressed variable to OFF to make the tables writable.

    See Also

    • InnoDB Page Compression

    • Storage-Engine Independent Column Compression

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

    InnoDB Page Compression
    Comparison with the COMPRESSED Row Format
    VARBINARY
    VARCHAR
    BLOB
    TEXT
    or less.

    To recover the tables, you can execute SELECTs to dump data, and DROP TABLE (when write transactions are permitted) to remove corrupted tables.

    The following modes are available:

    Recovery Modes

    Recovery mode behaviour differs between versions (server/storage/innobase/include/srv0srv.h).

    Mode
    Description

    0

    The default mode while InnoDB is running normally. Write transactions are permitted with innodb_force_recovery<=4.

    1

    (SRV_FORCE_IGNORE_CORRUPT) allows the server to keep running even if corrupt pages are detected. It does so by making redo log based recovery ignore certain errors, such as missing data files or corrupted data pages. Any redo log for affected files or pages are skipped. You can facilitate dumping tables by getting the SELECT * FROM table_name statement to jump over corrupt indexes and pages.

    2

    (SRV_FORCE_NO_BACKGROUND) stops the master thread from running, preventing a crash that occurs during a purge. No purge are performed, so the undo logs will keep growing.

    3

    (SRV_FORCE_NO_TRX_UNDO) does not roll back DML transactions after the crash recovery. Does not affect rollback of currently active DML transactions. Will also prevent some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented.

    4

    (SRV_FORCE_NO_DDL_UNDO) does not roll back transactions after the crash recovery. Does not affect rollback of currently active transactions. Will also prevent some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented.

    5

    Mode
    Description
    Mode
    Description

    Note also that XtraDB (<= ) by default will crash the server when it detects corrupted data in a single-table tablespace. This behaviour can be changed - see the innodb_corrupt_table_action system variable.

    Fixing Things

    Try to set innodb_force_recovery to 1 and start mariadb. If that fails, try a value of "2". If a value of 2 works, then there is a chance the only corruption you have experienced is within the innodb "undo logs". If that gets mariadb started, you should be able to dump your database with mariadb-dump. You can verify any other issues with any tables by running mariadb-check --all-databases.

    If you were able to successfully dump your databases, or had previously known good backups, drop your database(s) from the mariadb command line like "DROP DATABASE yourdatabase". Stop mariadb. Go to /var/lib/mysql (or whereever your mysql data directory is located) and "rm -i ib*". Start mariadb, create the database(s) you dropped ("CREATE DATABASE yourdatabase"), and then import your most recent dumps: "mysql < mydatabasedump.sql"

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

    innodb_force_recovery

    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 , 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.

    InnoDB DYNAMIC Row Format

    The DYNAMIC row format, default in modern MariaDB versions, optimizes storage for large BLOB/TEXT columns by storing them on separate overflow pages.

    DYNAMIC is the default InnoDB row format.

    The DYNAMIC row format is similar to the COMPACT row format, but tables using the DYNAMIC row format can store even more data on overflow pages than tables using the COMPACT row format. This results in more efficient data storage than tables using the COMPACT row format, especially for tables containing columns using the , , and data types. While InnoDB tables using the COMPRESSED row format can result in even greater space-efficiency, COMPRESSED requires substantially more memory and CPU to both read and write, so there is a significant performance and concurrency trade-off for that space-efficiency gain. COMPRESSED tables are not recommended for production use in most situations, while DYNAMIC row format scales well in high-performance environments.

    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    ALTER TABLE tab ADD COLUMN c VARCHAR(50), ALGORITHM=INPLACE;
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD COLUMN c VARCHAR(50);
    -- Create a temporary table with the new definition
    CREATE TEMPORARY TABLE tmp_tab (
    ...
    );
    
    -- Copy the data from the original table
    INSERT INTO tmp_tab
       SELECT * FROM original_tab;
    
    -- Drop the original table
    DROP TABLE original_tab;
    
    -- Rename the temporary table, so that it replaces the original one
    RENAME TABLE tmp_tab TO original_tab;
    SET SESSION alter_algorithm='INPLACE';
    
    ALTER TABLE tab MODIFY COLUMN c INT;
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    SET SESSION alter_algorithm='NOCOPY';
    
    ALTER TABLE tab MODIFY COLUMN c INT;
    ERROR 1846 (0A000): ALGORITHM=NOCOPY is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    SET SESSION alter_algorithm='INSTANT';
    
    ALTER TABLE tab MODIFY COLUMN c INT;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    ALTER TABLE tab ADD COLUMN c VARCHAR(50), ALGORITHM=INPLACE, LOCK=NONE;
    SET SESSION innodb_strict_mode=ON;
    
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB KEY_BLOCK_SIZE=4;
    SET SESSION innodb_strict_mode=ON;
    
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
    CREATE TABLE hq_sales.invoices (
       invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
       branch_id INT NOT NULL,
       customer_id INT,
       invoice_date DATETIME(6),
       invoice_total DECIMAL(13, 2),
       payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
       PRIMARY KEY(invoice_id)
    ) ROW_FORMAT = Compressed;
    $ mariadb --user=root
    SHOW SESSION VARIABLES
       LIKE 'default_storage_engine';
    +------------------------+--------+
    | Variable_name          | Value  |
    +------------------------+--------+
    | default_storage_engine | InnoDB |
    +------------------------+--------+
    CREATE TABLE hq_sales.invoices (
       invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
       branch_id INT NOT NULL,
       customer_id INT,
       invoice_date DATETIME(6),
       invoice_total DECIMAL(13, 2),
       payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
       PRIMARY KEY(invoice_id)
    ) ROW_FORMAT = Compressed;
    SELECT NAME, ROW_FORMAT, ZIP_PAGE_SIZE
    FROM information_schema.INNODB_SYS_TABLES
    WHERE NAME='hq_sales/invoices';
    +-------------------+------------+---------------+
    | NAME              | ROW_FORMAT | ZIP_PAGE_SIZE |
    +-------------------+------------+---------------+
    | hq_sales/invoices | Compressed |          8192 |
    +-------------------+------------+---------------+
    CREATE TABLE hq_sales.invoices (
       invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
       branch_id INT NOT NULL,
       customer_id INT,
       invoice_date DATETIME(6),
       invoice_total DECIMAL(13, 2),
       payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
       PRIMARY KEY(invoice_id)
    ) KEY_BLOCK_SIZE = 4;
    $ mariadb --user=root
    SHOW SESSION VARIABLES
       LIKE 'default_storage_engine';
    +------------------------+--------+
    | Variable_name          | Value  |
    +------------------------+--------+
    | default_storage_engine | InnoDB |
    +------------------------+--------+
    CREATE TABLE hq_sales.invoices (
       invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
       branch_id INT NOT NULL,
       customer_id INT,
       invoice_date DATETIME(6),
       invoice_total DECIMAL(13, 2),
       payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
       PRIMARY KEY(invoice_id)
    ) KEY_BLOCK_SIZE = 4;
    SELECT NAME, ROW_FORMAT, ZIP_PAGE_SIZE
    FROM information_schema.INNODB_SYS_TABLES
    WHERE NAME='hq_sales/invoices';
    +-------------------+------------+---------------+
    | NAME              | ROW_FORMAT | ZIP_PAGE_SIZE |
    +-------------------+------------+---------------+
    | hq_sales/invoices | Compressed |          4096 |
    +-------------------+------------+---------------+
    innodb_safe_truncate
    datadir

    Supported Index Prefix Limits

    The limit for indexing column values depends on the innodb_page_size value:

    Page Size
    Index Prefix Limit

    16k 32k 16k

    3072 bytes

    8k

    1536 bytes

    4k

    768 bytes

    Using the DYNAMIC Row Format

    The default row format is DYNAMIC, as long as the innodb_default_row_format system variable has not been modified. Therefore, in these versions, the easiest way to create an InnoDB table that uses the DYNAMIC row format is by not setting the ROW_FORMAT table option at all in a CREATE TABLE or ALTER TABLE statement.

    It is recommended to set the innodb_strict_mode system variable to ON when using this row format.

    For example:

    Create an InnoDB Table with the Dynamic Row Format by Default

    InnoDB uses the Dynamic row format for new InnoDB tables by default, because the innodb_default_row_format system variable is dynamic by default.

    Let's create an InnoDB table after confirming that the default storage engine is InnoDB and that InnoDB's default row format is Dynamic:

    1. Connect to the server using MariaDB Client:

    1. Confirm that the default storage engine is InnoDB by checking the default_storage_engine system variable using the SHOW SESSION VARIABLES statement:

    1. Confirm that InnoDB's default row format is Dynamic by checking the innodb_default_row_format system variable using the SHOW GLOBAL VARIABLES statement:

    1. If the database does not exist, then create the database for the table using the CREATE DATABASE statement:

    1. Create the table using the CREATE TABLE statement:

    1. Confirm that the table uses the Dynamic row format by querying the information_schema.INNODB_SYS_TABLES table:

    Create an InnoDB Table with the Dynamic Row Format using ROW_FORMAT

    An InnoDB table that uses the Dynamic row format can be created using the ROW_FORMAT table option.

    Let's create an InnoDB table after confirming that the default storage engine is InnoDB and that InnoDB's default row format is not Dynamic:

    1. Connect to the server using MariaDB Client:

    1. Confirm that the default storage engine is InnoDB by checking the default_storage_engine system variable using the SHOW SESSION VARIABLES statement:

    1. Confirm that InnoDB's default row format is not Dynamic by checking the innodb_default_row_format system variable using the SHOW GLOBAL VARIABLES statement:

    1. If the database does not exist, then create the database for the table using the CREATE DATABASE statement:

    1. Create the table using the CREATE TABLE statement, and specify the Dynamic row format using the ROW_FORMAT table option:

    1. Confirm that the table uses the Dynamic row format by querying the information_schema.INNODB_SYS_TABLES table:

    Convert InnoDB Tables to the Dynamic Row Format

    If your database was physically upgraded from some older version of MariaDB Server or MySQL, then some of your tables may not be using the Dynamic row format. If you want to get the benefits of the Dynamic row format, then those tables will need to be converted to use it.

    Let's convert some InnoDB tables to the Dynamic row format:

    1. Connect to the server using MariaDB Client:

    1. Search for InnoDB tables that do not use the Dynamic row format by querying the information_schema.INNODB_SYS_TABLES table:

    1. Alter the table using the ALTER TABLE statement, and specify the Dynamic row format using the ROW_FORMAT table option:

    1. Confirm that the table uses the Dynamic row format by querying the information_schema.INNODB_SYS_TABLES table again:

    Index Prefixes with the DYNAMIC Row Format

    The DYNAMIC row format supports index prefixes up to 3072 bytes. In earlier versions of MariaDB, the innodb_large_prefix system variable is used to configure the maximum index prefix length. In these versions, if innodb_large_prefix is set to ON, then the maximum prefix length is 3072 bytes, and if it is set to OFF, then the maximum prefix length is 767 bytes.

    Overflow Pages with the DYNAMIC Row Format

    All InnoDB row formats can store certain kinds of data in overflow pages. This allows for the maximum row size of an InnoDB table to be larger than the maximum amount of data that can be stored in the row's main data page. See Maximum Row Size for more information about the other factors that can contribute to the maximum row size for InnoDB tables.

    In the DYNAMIC row format variable-length columns, such as columns using the VARBINARY, VARCHAR, BLOB and TEXT data types, can be completely stored in overflow pages.

    InnoDB only considers using overflow pages if the table's row size is greater than half of innodb_page_size. If the row size is greater than this, then InnoDB chooses variable-length columns to be stored on overflow pages until the row size is less than half of innodb_page_size.

    For BLOB and TEXT columns, only values longer than 40 bytes are considered for storage on overflow pages. For VARBINARY and VARCHAR columns, only values longer than 255 bytes are considered for storage on overflow pages. Bytes that are stored to track a value's length do not count towards these limits. These limits are only based on the length of the actual column's data.

    These limits differ from the limits for the COMPACT row format, where the limit is 767 bytes for all types.

    Fixed-length columns greater than 767 bytes are encoded as variable-length columns, so they can also be stored in overflow pages if the table's row size is greater than half of innodb_page_size. Even though a column using the CHAR data type can hold at most 255 characters, a CHAR column can still exceed 767 bytes in some cases. For example, a char(255) column can exceed 767 bytes if the character set is utf8mb4.

    If a column is chosen to be stored on overflow pages, then the entire value of the column is stored on overflow pages, and only a 20-byte pointer to the column's first overflow page is stored on the main page. Each overflow page is the size of innodb_page_size. If a column is too large to be stored on a single overflow page, then it is stored on multiple overflow pages. Each overflow page contains part of the data and a 20-byte pointer to the next overflow page, if a next page exists.

    This behavior differs from the behavior of the COMPACT row format, which always stores the column prefix on the main page. This allows tables using the DYNAMIC row format to contain a high number of columns using the VARBINARY, VARCHAR, BLOB and TEXT data types.

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

    VARBINARY
    VARCHAR
    BLOB
    TEXT
    SET SESSION innodb_strict_mode=ON;
    
    SET GLOBAL innodb_default_row_format='dynamic';
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB;
    $ mariadb --user=root
    SHOW SESSION VARIABLES
       LIKE 'default_storage_engine';
    +------------------------+--------+
    | Variable_name          | Value  |
    +------------------------+--------+
    | default_storage_engine | InnoDB |
    +------------------------+--------+
    SHOW GLOBAL VARIABLES
       LIKE 'innodb_default_row_format';
    +---------------------------+---------+
    | Variable_name             | Value   |
    +---------------------------+---------+
    | innodb_default_row_format | dynamic |
    +---------------------------+---------+
    CREATE DATABASE hq_sales;
    CREATE TABLE hq_sales.invoices (
       invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
       branch_id INT NOT NULL,
       customer_id INT,
       invoice_date DATETIME(6),
       invoice_total DECIMAL(13, 2),
       payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
       PRIMARY KEY(invoice_id)
    );
    SELECT NAME, ROW_FORMAT
    FROM information_schema.INNODB_SYS_TABLES
    WHERE NAME='hq_sales/invoices';
    +-------------------+------------+
    | NAME              | ROW_FORMAT |
    +-------------------+------------+
    | hq_sales/invoices | Dynamic    |
    +-------------------+------------+
    $ mariadb --user=root
    SHOW SESSION VARIABLES
       LIKE 'default_storage_engine';
    +------------------------+--------+
    | Variable_name          | Value  |
    +------------------------+--------+
    | default_storage_engine | InnoDB |
    +------------------------+--------+
    SHOW GLOBAL VARIABLES
       LIKE 'innodb_default_row_format';
    +---------------------------+---------+
    | Variable_name             | Value   |
    +---------------------------+---------+
    | innodb_default_row_format | compact |
    +---------------------------+---------+
    CREATE DATABASE hq_sales;
    CREATE TABLE hq_sales.invoices (
       invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
       branch_id INT NOT NULL,
       customer_id INT,
       invoice_date DATETIME(6),
       invoice_total DECIMAL(13, 2),
       payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
       PRIMARY KEY(invoice_id)
    ) ROW_FORMAT = DYNAMIC;
    SELECT NAME, ROW_FORMAT
    FROM information_schema.INNODB_SYS_TABLES
    WHERE NAME='hq_sales/invoices';
    +-------------------+------------+
    | NAME              | ROW_FORMAT |
    +-------------------+------------+
    | hq_sales/invoices | Dynamic    |
    +-------------------+------------+
    $ mariadb --user=root
    SELECT NAME, ROW_FORMAT
    FROM information_schema.INNODB_SYS_TABLES
    WHERE NAME NOT LIKE 'SYS_%'
    AND ROW_FORMAT != 'Dynamic';
    +-------------------+------------+
    | NAME              | ROW_FORMAT |
    +-------------------+------------+
    | hq_sales/invoices | Compact    |
    +-------------------+------------+
    ALTER TABLE hq_sales.invoices
       ROW_FORMAT = DYNAMIC;
    SELECT NAME, ROW_FORMAT
    FROM information_schema.INNODB_SYS_TABLES
    WHERE NAME='hq_sales/invoices';
    +-------------------+------------+
    | NAME              | ROW_FORMAT |
    +-------------------+------------+
    | hq_sales/invoices | Dynamic    |
    +-------------------+------------+

    6

    (SRV_FORCE_NO_LOG_REDO) does not perform redo log roll-forward as part of recovery. Running queries that require indexes are likely to fail with this mode active. However, if a table dump still causes a crash, you can try using a SELECT * FROM tab ORDER BY primary_key DESC to dump all the data portion after the corrupted part.

    6

    (SRV_FORCE_NO_LOG_REDO) does not perform redo log roll-forward as part of recovery. Running queries that require indexes are likely to fail with this mode active. However, if a table dump still causes a crash, you can try using a SELECT * FROM tab ORDER BY primary_key DESC to dump all the data portion after the corrupted part.

    (SRV_FORCE_NO_UNDO_LOG_SCAN) treats incomplete transactions as committed, and does not look at the undo logs when starting. Any DDL log for InnoDB tables are essentially ignored by InnoDB, but the server will start up

    6

    (SRV_FORCE_NO_LOG_REDO) does not perform redo log roll-forward as part of recovery. Running queries that require indexes are likely to fail with this mode active. However, if a table dump still causes a crash, you can try using a SELECT * FROM tab ORDER BY primary_key DESC to dump all the data portion after the corrupted part.

    0

    The default mode while InnoDB is running normally. Write transactions are permitted with innodb_force_recovery<=4.

    1

    (SRV_FORCE_IGNORE_CORRUPT) allows the server to keep running even if corrupt pages are detected. It does so by making redo log based recovery ignore certain errors, such as missing data files or corrupted data pages. Any redo log for affected files or pages are skipped. You can facilitate dumping tables by getting the SELECT * FROM table_name statement to jump over corrupt indexes and pages.

    2

    (SRV_FORCE_NO_BACKGROUND) stops the master thread from running, preventing a crash that occurs during a purge. No purge are performed, so the undo logs will keep growing.

    3

    (SRV_FORCE_NO_TRX_UNDO) does not roll back transactions after the crash recovery. Does not affect rollback of currently active transactions. Will also prevent some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented.

    4

    (SRV_FORCE_NO_IBUF_MERGE) The same as 3.

    5

    0

    The default mode while InnoDB is running normally. Until , it was the only mode permitting changes to the data. From , write transactions are permitted with innodb_force_recovery<=3.

    1

    (SRV_FORCE_IGNORE_CORRUPT) allows the server to keep running even if corrupt pages are detected. It does so by making redo log based recovery ignore certain errors, such as missing data files or corrupted data pages. Any redo log for affected files or pages are skipped. You can facilitate dumping tables by getting the SELECT * FROM table_name statement to jump over corrupt indexes and pages.

    2

    (SRV_FORCE_NO_BACKGROUND) stops the master thread from running, preventing a crash that occurs during a purge. No purge are performed, so the undo logs will keep growing.

    3

    (SRV_FORCE_NO_TRX_UNDO) does not roll back transactions after the crash recovery. Does not affect rollback of currently active transactions. Starting with , will also prevent some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented.

    4

    (SRV_FORCE_NO_IBUF_MERGE) does not calculate tables statistics and prevents insert buffer merges.

    5

    (SRV_FORCE_NO_UNDO_LOG_SCAN) treats incomplete transactions as committed, and does not look at the when starting.

    (SRV_FORCE_NO_UNDO_LOG_SCAN) treats incomplete transactions as committed, and does not look at the when starting.

    Percona XtraDB versions in MariaDB

    • XtraDB from Percona Server 5.6.49-89.0 in

    • XtraDB from Percona Server 5.6.46-86.2 in

    • XtraDB from Percona Server 5.6.43-84.3 in

    • XtraDB from Percona Server 5.6.41-84.1 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

    • 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 Percona Server 5.6.42-84.2 in

    • XtraDB from Percona Server 5.6.41-84.1 in

    • XtraDB from Percona Server 5.6.39-83.1 in

    • XtraDB from Percona Server 5.6.38-83.0[4]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

    • 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 Percona Server 5.5.61-38.13 in

    • XtraDB from Percona Server 5.5.59-38.11 in

    • XtraDB from Percona Server 5.5.58-38.10 in

    • XtraDB from Percona Server 5.5.55-38.9 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

    • 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 5.1.59-13 in

    • version 5.1.54-12.5 in

    • version 5.1.52-11.6 in and

    • version 5.1.49-12 in

    • version 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

    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

    5. Misidentifies itself as 5.6.36-82.2 in

    6. Misidentifies itself as 5.6.32-79.0 in

    See Also

    More information can be found in the Percona documentation.

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

    used in MariaDB before MariaDB 10.2
    Galera Cluster
    Percona Server 5.6.38-83.0
    1
    Percona Server 5.6.37-82.2
    2
    Percona Server 5.6.36-82.1
    Percona Server 5.6.36-82.0
    Percona Server 5.6.35-80.0
    Percona Server 5.6.34-79.1
    Percona Server 5.6.33-79.0
    3
    Percona Server 5.6.32-78.1
    Percona Server 5.6.31-77.0
    Percona Server 5.6.30-76.3
    Percona Server 5.6.29-76.2
    Percona Server 5.6.28-76.1
    Percona Server 5.6.26-76.0
    Percona Server 5.6.26-74.0
    Percona Server 5.6.25-73.1
    Percona Server 5.6.24-72.2
    Percona Server 5.6.23-72.1
    Percona Server 5.6.22-72.0
    Percona Server 5.6.21-70.0
    Percona Server 5.6.17-65.0
    Percona Server 5.6.37-82.2
    5
    Percona Server 5.6.36-82.1
    Percona Server 5.6.36-82.0
    Percona Server 5.6.35-80.0
    Percona Server 5.6.34-79.1
    Percona Server 5.6.33-79.0
    6
    Percona Server 5.6.31-77.0
    Percona Server 5.6.30-76.3
    Percona Server 5.6.29-76.2
    Percona Server 5.6.28-76.1
    Percona Server 5.6.27-76.0
    Percona Server 5.6.26-74.0
    Percona Server 5.6.25-73.1
    Percona Server 5.6.24-72.2
    Percona Server 5.6.23-72.1
    Percona Server 5.6.22-72.0
    Percona Server 5.6.22-71.0
    Percona Server 5.6.21-70.0
    Percona Server 5.6.20-68.0
    Percona Server 5.6.19-67.0
    Percona Server 5.6.17-65.0
    Percona Server 5.6.14-rel62.0
    Percona Server 5.5.55-38.8
    Percona Server 5.5.52-38.3
    Percona Server 5.5.50-38.0
    Percona Server 5.5.49-37.9
    Percona Server 5.5.48-37.8
    Percona Server 5.5.46-37.7
    Percona Server 5.5.46-37.6
    Percona Server 5.5.45-37.4
    Percona Server 5.5.44-37.3
    Percona Server 5.5.42-37.2
    Percona Server 5.5.42-37.1
    Percona Server 5.5.40-36.1
    Percona Server 5.5.38-35.2
    Percona Server 5.5.37-35.0
    Percona Server 5.5.36-34.0
    Percona Server 5.5.35-33.0
    Percona Server 5.5.34-32.0
    Percona Server 5.5.33-31.1
    Percona Server-5.5.32-31.0
    5.1.47-11.2
    ↑
    ↑
    undo logs
    undo logs

    InnoDB Page Compression

    This feature enables transparent page-level compression for tables using algorithms like LZ4 or Zlib, reducing storage requirements.

    Overview

    InnoDB page compression provides a way to compress InnoDB tables.

    Use Cases

    • InnoDB page compression can be used on any storage device and any file system.

    • InnoDB page compression is most efficient on file systems that support sparse files. See for more information.

    • InnoDB page compression is most beneficial on solid state drives (SSDs) and other flash storage. See for more information.

    • InnoDB page compression performs best when your storage device and file system support atomic writes, since that allows the to be disabled. See for more information.

    Comparison with the COMPRESSED Row Format

    InnoDB page compression is a modern way to compress your InnoDB tables. It is similar to InnoDB's row format, but it has many advantages. Some of the differences are:

    • With InnoDB page compression, compressed pages are immediately decompressed after being read from the tablespace file, and only uncompressed pages are stored in the buffer pool. In contrast, with InnoDB's row format, compressed pages are decompressed immediately after they are read from the tablespace file, and both the uncompressed and compressed pages are stored in the buffer pool. This means that the row format uses more space in the buffer pool than InnoDB page compression does.

    • With InnoDB page compression, pages are compressed just before being written to the tablespace file. In contrast, with InnoDB's row format, pages are re-compressed immediately after any changes, and the compressed pages are stored in the buffer pool alongside the uncompressed pages. These changes are then occasionally flushed to disk. This means that the row format re-compresses data more frequently than InnoDB page compression does.

    • With InnoDB page compression, multiple compression algorithms are supported. In contrast, with InnoDB's

    In general, InnoDB page compression is superior to the row format.

    Comparison with Storage Engine-Independent Column Compression

    • See .

    Configuring the InnoDB Page Compression Algorithm

    There is not currently a table option to set different InnoDB page compression algorithms for individual tables.

    However, the server-wide InnoDB page compression algorithm can be configured by setting the system variable.

    When this system variable is changed, the InnoDB page compression algorithm does not change for existing pages that were already compressed with a different InnoDB page compression algorithm. InnoDB is able to handle this situation without issues, because every page in an InnoDB tablespace contains metadata about the InnoDB page compression algorithm in the page header. This means that InnoDB supports having uncompressed pages and pages compressed with different InnoDB page compression algorithms in the same InnoDB tablespace at the same time.

    This system variable can be set to one of the following values:

    System Variable Value
    Description

    However, on many distributions, the standard MariaDB builds do not support all InnoDB page compression algorithms by default. From , algorithms can be .

    This system variable can be changed dynamically with :

    This system variable can also be set in a server in an prior to starting up the server:

    Checking Supported InnoDB Page Compression Algorithms

    On many distributions, the standard MariaDB builds do not support all InnoDB page compression algorithms by default. Therefore, if you want to use a specific InnoDB page compression algorithm, then you should check whether your MariaDB build supports it.

    The compression algorithm is always supported. From , algorithms can be .

    A MariaDB build's support for other InnoDB page compression algorithms can be checked by querying the following status variables with :

    Status Variable
    Description

    For example:

    Adding Support for an InnoDB Page Compression Algorithm

    On many distributions, the standard MariaDB builds do not support all InnoDB page compression algorithms by default. From , algorithms can be , but in earlier versions, if you want to use certain InnoDB page compression algorithms, then you may need to do the following:

    • Download the package for the desired compression library from the above links.

    • Install the package for the desired compression library.

    • Compile MariaDB from the source distribution.

    The general steps for compiling MariaDB are:

    • Download and unpack the source code distribution:

    • Configure the build using :

    • Check to confirm that it has found the desired compression library on your system.

    • Compile the build:

    • Either install the build:

    Or make a package to install:

    See for more information.

    Enabling InnoDB Page Compression

    InnoDB page compression is not enabled by default. However, InnoDB page compression can be enabled for just individual InnoDB tables or it can be enabled for all new InnoDB tables by default.

    InnoDB page compression is also only supported if the InnoDB table is in a tablespace. Therefore, the system variable must be set to ON to use InnoDB page compression.

    InnoDB page compression is only supported if the InnoDB table uses the Barracuda .Therefore, in and before, the system variable must be set to Barracuda to use InnoDB page compression.

    InnoDB page compression is also only supported if the InnoDB table's is or .

    Enabling InnoDB Page Compression by Default

    In and later, InnoDB page compression can be enabled for all new InnoDB tables by default by setting the system variable to ON.

    This system variable can be set to one of the following values:

    System Variable Value
    Description

    This system variable can be changed dynamically with :

    This system variable's session value can be changed dynamically with :

    This system variable can also be set in a server in an prior to starting up the server:

    Enabling InnoDB Page Compression for Individual Tables

    InnoDB page compression can be enabled for individual tables by setting the table option to 1:

    Configuring the Compression Level

    Some InnoDB page compression algorithms support a compression level option, which configures how the InnoDB page compression algorithm will balance speed and compression.

    The compression level's supported values range from 1 to 9. The range goes from the fastest to the most compact, which means that 1 is the fastest and 9 is the most compact.

    Only the following InnoDB page compression algorithms currently support compression levels:

    If an InnoDB page compression algorithm does not support compression levels, then it ignores any provided compression level value.

    Configuring the Default Compression Level

    The default compression level can be configured by setting the system variable.

    This system variable's default value is 6.

    This system variable can be changed dynamically with :

    This system variable can also be set in a server in an prior to starting up the server:

    Configuring the Compression Level for Individual Tables

    The compression level for individual tables can also be configured by setting the table option for the table:

    Configuring the Failure Threshold and Maximum Padding

    InnoDB page compression can encounter compression failures.

    InnoDB page compression's failure threshold can be configured. If InnoDB encounters more compression failures than the failure threshold, then it pads pages with zeroed out bytes before attempting to compress them as a way to reduce failures. If the failure rate stays above the failure threshold, then InnoDB pads pages with more zeroed out bytes in 128 byte increments.

    InnoDB page compression's maximum padding can also be configured.

    Configuring the Failure Threshold

    The failure threshold can be configured by setting the system variable.

    This system variable's supported values range from 0 to 100.

    This system variable's default value is 5.

    This system variable can be changed dynamically with :

    This system variable can also be set in a server in an prior to starting up the server:

    Configuring the Maximum Padding

    The maximum padding can be configured by setting the system variable.

    This system variable's supported values range from 0 to 75.

    This system variable's default value is 50.

    This system variable can be changed dynamically with :

    This system variable can also be set in a server in an prior to starting up the server:

    Saving Storage Space with Sparse Files

    When InnoDB page compression is used, InnoDB may still write the compressed page to the tablespace file with the original size of the uncompressed page, which would be equivalent to the value of the system variable. This is done by design, because when InnoDB's I/O code needs to read the page from disk, it can only read the full page size. However, this is obviously not optimal.

    On file systems that support sparse files, this problem is solved by writing the tablespace file as a sparse file using the punch hole technique. With the punch hole technique, InnoDB will only write the actual compressed page size to the tablespace file, aligned to sector size. The rest of the page is trimmed.

    This punch hole technique allows InnoDB to read the compressed page from disk as the full page size, even though the compressed page really takes up less space on the file system.

    There are some potential disadvantages to using sparse files:

    • Some utilities may require special options in order to handle sparse files in an efficient manner.

    • Most existing file systems are slow to sparse files. As a consequence, if a tablespace file is a sparse file, then dropping the table can be very slow.

    Sparse File Support on Linux

    On Linux, the following file systems support sparse files:

    • ext3

    • ext4

    • xfs

    • btrfs

    On Linux, file systems need to support the system call with the FALLOC_FL_PUNCH_HOLE and FALLOC_FL_KEEP_SIZE flags:

    Some Linux utilities may require special options in order to work with sparse files efficiently:

    • The utility will report the non-sparse size of the tablespace file when executed with default behavior, but will report the actual amount of storage allocated for the tablespace file.

    • The utility is pretty good at auto-detecting sparse files, but it also provides the and options, if the auto-detection is not desired.

    • The utility will archive sparse files with their non-sparse size when executed with default behavior, but will auto-detect sparse files, and archive them with their sparse size.

    Sparse File Support on Windows

    On Windows, the following file systems support sparse files:

    • NTFS

    On Windows, file systems need to support the function with the and control codes:

    Configuring InnoDB to use Sparse Files

    In and later, InnoDB uses the punch hole technique to create sparse files used automatically when the underlying file system supports sparse files.

    In and before, InnoDB can be configured to use the punch hole technique to create sparse files by configuring the and system variables. These system variables can be set in a server in an prior to starting up the server:

    Optimized for Flash Storage

    InnoDB page compression was designed to be optimized on solid state drives (SSDs) and other flash storage.

    InnoDB page compression was originally developed by collaborating with . As a consequence, it was originally designed to work best on using . has since been acquired by , and they have decided not to continue supporting .

    However, InnoDB page compression is still likely to be most optimized on solid state drives (SSDs) and other flash storage.

    InnoDB page compression works without any issues on hard disk drives (HDDs). However, since its compression relies on the use of sparse files, the data may be somewhat fragmented on disk. This fragmentation may hurt performance on HDDs, since they handle random reads and writes much more slowly than flash storage.

    Configuring InnoDB Page Flushing

    With InnoDB page compression, pages are compressed when they are flushed to disk. Therefore, it can be helpful to optimize the configuration of InnoDB's page flushing. See for more information.

    Monitoring InnoDB Page Compression

    InnoDB page compression can be monitored by querying the following status variables with :

    Status Variable
    Description

    With InnoDB page compression, a page is only compressed when it is flushed to disk. This means that if you are monitoring InnoDB page compression via these status variables, then the status variables values will only get incremented when the dirty pages are flushed to disk, which does not necessarily happen immediately:

    Compatibility with Backup Tools

    supports InnoDB page compression.

    does not support InnoDB page compression.

    Acknowledgements

    • InnoDB page compression was developed by collaborating with . Special thanks especially to Dhananjoy Das and Torben Mathiasen.

    See Also

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

    InnoDB Row Formats Overview

    An overview of the four InnoDB row formats (REDUNDANT, COMPACT, DYNAMIC, COMPRESSED), comparing their storage efficiency and feature support.

    The InnoDB storage engine supports four different row formats:

    • REDUNDANT

    • COMPACT

    • DYNAMIC

    Default Row Format

    The system variable can be used to set the default row format for InnoDB tables. The possible values are:

    • redundant

    • compact

    • dynamic

    This system variable's default value is dynamic, which means that the default row format is DYNAMIC.

    This system variable cannot be set to compressed, which means that the default row format cannot be COMPRESSED.

    For example, the following statements would create a table with the DYNAMIC row format:

    Setting a Table's Row Format

    One way to specify an InnoDB table's row format is by setting the table option to the relevant row format in a or statement:

    Checking a Table's Row Format

    The statement can be used to see the row format used by a table:

    The table can also be queried to see the row format used by a table:

    A table's tablespace is tagged with the lowest InnoDB file format that supports the table's row format. So, even if the Barracuda file format is enabled, tables that use the COMPACT or REDUNDANT row formats are tagged with the Antelope file format in the table.

    Row Formats

    REDUNDANT Row Format

    The REDUNDANT row format is the original non-compacted row format.

    The REDUNDANT row format was the only available row format before MySQL 5.0.3. In that release, this row format was retroactively named the REDUNDANT row format. In the same release, the COMPACT row format was introduced as the new default row format.

    See for more information.

    COMPACT Row Format

    Default row format in earlier versions COMPACT.

    The COMPACT row format is similar to the REDUNDANT row format, but it stores data in a more compact manner that requires about 20% less storage.

    See for more information.

    DYNAMIC Row Format

    DYNAMIC is the default row format.

    The DYNAMIC row format is similar to the COMPACT row format, but tables using the DYNAMIC row format can store even more data on overflow pages than tables using the COMPACT row format. This results in more efficient data storage than tables using the COMPACT row format, especially for tables containing columns using the , , and data types. However, InnoDB tables using the COMPRESSED row format are more efficient.

    See for more information.

    COMPRESSED Row Format

    An alternative way to compress InnoDB tables is by using .

    The COMPRESSED row format is similar to the COMPACT row format, but tables using the COMPRESSED row format can store even more data on overflow pages than tables using the COMPACT row format. This results in more efficient data storage than tables using the COMPACT row format, especially for tables containing columns using the , , and data types.

    The COMPRESSED row format also supports compression of all data and index pages.

    See for more information.

    Maximum Row Size

    Several factors help determine the maximum row size of an InnoDB table.

    First, MariaDB enforces a 65,535 byte limit on a table's maximum row size. The total size of a table's and columns do not count towards this limit. Only the pointers for a table's and columns count towards this limit. MariaDB enforces this limit for all storage engines, so this limit also applies to InnoDB tables. Therefore, this limit is the absolute maximum row size for an InnoDB table.

    If you try to create a table that exceeds MariaDB's global limit on a table's maximum row size, then you will see an error like this:

    However, InnoDB also has its own limits on the maximum row size, so an InnoDB table's maximum row size could be smaller than MariaDB's global limit.

    Second, the maximum amount of data that an InnoDB table can store in a row's main data page depends on the value of the system variable. At most, the data that a single row can consume on the row's main data page is half of the value of the system variable. With the default value of 16k, that would mean that a single row can consume at most around 8 KB on the row's main data page. However, the limit on the row's main data page is not the absolute limit on the row's size.

    Third, all InnoDB row formats can store certain kinds of data in overflow pages, so the maximum row size of an InnoDB table can be larger than the maximum amount of data that can be stored in the row's main data page.

    Some row formats can store more data in overflow pages than others. For example, the DYNAMIC and COMPRESSED row formats can store the most data in overflow pages. To see how to determine the how the various InnoDB row formats can use overflow pages, see the following sections:

    If a table's definition can allow rows that the table's InnoDB row format can't actually store, then InnoDB will raise errors or warnings in certain scenarios.

    If the table were using the REDUNDANT or COMPACT row formats, then the error or warning would be the following:

    And if the table were using the DYNAMIC or COMPRESSED row formats, then the error or warning would be the following:

    These messages are raised in the following cases:

    • If is enabled and if a statement is executed that touches the table, such as or , then InnoDB will raise an error with this message

    • If is disabled and if a statement is executed that touches the table, such as or [ALTER TABLE](../../../sql-statements-and-structure/sql-statements/data-definition/alter/alter-table.md), then InnoDB will raise a warning with this message.

    • Regardless of whether is enabled, if a statement is executed that attempts to write a row that the table's InnoDB row format can't store, then InnoDB will raise an error with this message.

    For information on how to solve the problem, see .

    Feature Summary

    Known Issues

    Upgrading Causes Row Size Too Large Errors

    In earlier versions, MariaDB doesn't properly calculate the row sizes while executing DDL. In these versions, unsafe tables can be created, even if is enabled. The calculations were fixed by .

    As a side effect, some tables that could be created or altered in previous versions may get rejected with the following error in these releases and any later releases.

    And users could also see the following message as an error or warning in the :

    InnoDB used the wrong calculations to determine row sizes for quite a long time, so a lot of users may unknowingly have unsafe tables that the InnoDB row format can't actually store.

    InnoDB does not currently have an easy way to check which existing tables have this problem. See for more information.

    For information on how to solve the problem, see .

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

    Yes

    No

    No

    Efficiently utilizes buffer pool

    Yes

    No

    Yes

    Yes

    Supported Page Sizes

    • 64k • 32k • 16k • 8k • 4k

    • 16k • 8k • 4k

    • 64k • 32k • 16k • 8k • 4k

    • 64k • 32k • 16k • 8k • 4k

    Maximum size of indexed column values

    • 3072 bytes (innodb_page_size >= 16k) • 1536 bytes (innodb_page_size == 8k) • 768 bytes (innodb_page_size == 4k)

    • 3072 bytes (innodb_page_size >= 16k) • 1536 bytes (innodb_page_size == 8k) • 768 bytes (innodb_page_size == 4k)

    767 bytes

    767 bytes

    Supports ADD/DROP column with INSTANT Algorithm

    Yes

    No

    Yes

    Yes

    Feature

    Dynamic

    Compressed

    Compact

    Redundant

    Default

    Yes

    No

    No

    No

    Recommended

    Yes

    No

    No

    No

    Efficiently stores large columns

    COMPRESSED
    innodb_default_row_format
    ROW_FORMAT
    CREATE TABLE
    ALTER TABLE
    SHOW TABLE STATUS
    information_schema.INNODB_SYS_TABLES
    information_schema.INNODB_SYS_TABLES
    InnoDB REDUNDANT Row Format
    InnoDB COMPACT Row Format
    VARBINARY
    VARCHAR
    BLOB
    TEXT
    InnoDB DYNAMIC Row Format
    InnoDB Page Compression
    VARBINARY
    VARCHAR
    BLOB
    TEXT
    InnoDB COMPRESSED Row Format
    BLOB
    TEXT
    BLOB
    TEXT
    innodb_page_size
    innodb_page_size
    InnoDB REDUNDANT Row Format: Overflow Pages with the REDUNDANT Row Format
    InnoDB COMPACT Row Format: Overflow Pages with the COMPACT Row Format
    InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format
    InnoDB COMPRESSED Row Format: Overflow Pages with the COMPRESSED Row Format
    InnoDB strict mode
    DDL
    CREATE TABLE
    ALTER TABLE
    InnoDB strict mode
    DDL
    CREATE TABLE
    InnoDB strict mode
    DML
    Troubleshooting Row Size Too Large Errors with InnoDB
    InnoDB strict mode
    MDEV-19292
    error log
    MDEV-20400
    Troubleshooting Row Size Too Large Errors with InnoDB

    Yes

    SET SESSION innodb_strict_mode=ON;
    
    SET GLOBAL innodb_default_row_format='dynamic';
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB;
    SET SESSION innodb_strict_mode=ON;
    
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    CREATE TABLE tab (
       id INT,
       str VARCHAR(50)
    ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
    SHOW TABLE STATUS FROM db1 WHERE Name='tab'\G
    *************************** 1. row ***************************
               Name: tab
             Engine: InnoDB
            Version: 10
         Row_format: Dynamic
               Rows: 0
     Avg_row_length: 0
        Data_length: 16384
    Max_data_length: 0
       Index_length: 0
          Data_free: 0
     Auto_increment: NULL
        Create_time: 2019-04-18 20:24:04
        Update_time: NULL
         Check_time: NULL
          Collation: latin1_swedish_ci
           Checksum: NULL
     Create_options: row_format=DYNAMIC
            Comment:
    SELECT * FROM information_schema.INNODB_SYS_TABLES WHERE name='db1/tab'\G
    *************************** 1. row ***************************
         TABLE_ID: 42
             NAME: db1/tab
             FLAG: 33
           N_COLS: 4
            SPACE: 27
      FILE_FORMAT: Barracuda
       ROW_FORMAT: Dynamic
    ZIP_PAGE_SIZE: 0
       SPACE_TYPE: Single
    ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, 
    not counting BLOBs, is 65535. This includes storage overhead, check the manual. You 
    have to change some columns to TEXT or BLOBs
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED 
    may help. In current row format, BLOB prefix of 768 bytes is stored inline.
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
    [Warning] InnoDB: Cannot add field col in table db1.tab because after adding it, the row size is 8478 which is greater than maximum allowed size (8126) for a record on index leaf page.
    row format,
    is the only supported compression algorithm. This means that the
    row format has less compression options than InnoDB page compression does.

    snappy

    Pages are compressed using the algorithm.

  • nvmfs

  • Number of 16384 sectors trimmed

    Number of 32768 sectors trimmed

    Number of pages compressed

    Number of trim operations

    Number of trim operations saved

    Number of pages decompressed

    Number of compression errors

    InnoDB holepunch compression vs the filesystem in MariaDB 10.1
  • Significant performance boost with new MariaDB page compression on FusionIO

  • INFLOW '14: NVM Compression—Hybrid Flash-Aware Application Level Compression

  • none

    Pages are not compressed. This is the default value in and before, and and before.

    zlib

    Pages are compressed using the bundled zlib compression algorithm. This is the default value in and later, and and later.

    lz4

    Pages are compressed using the lz4 compression algorithm.

    lzo

    Pages are compressed using the lzo compression algorithm.

    lzma

    Pages are compressed using the lzma compression algorithm.

    bzip2

    Pages are compressed using the bzip2 compression algorithm.

    Innodb_have_lz4

    Whether InnoDB supports the lz4 compression algorithm.

    Innodb_have_lzo

    Whether InnoDB supports the lzo compression algorithm.

    Innodb_have_lzma

    Whether InnoDB supports the lzma compression algorithm.

    Innodb_have_bzip2

    Whether InnoDB supports the bzip2 compression algorithm.

    Innodb_have_snappy

    Whether InnoDB supports the snappy compression algorithm.

    OFF

    New InnoDB tables do not use InnoDB page compression. This is the default value.

    ON

    New InnoDB tables use InnoDB page compression.

    Innodb_page_compression_saved

    Bytes saved by compression

    Innodb_page_compression_trim_sect512

    Number of 512 sectors trimmed

    Innodb_page_compression_trim_sect1024

    Number of 1024 sectors trimmed

    Innodb_page_compression_trim_sect2048

    Number of 2048 sectors trimmed

    Innodb_page_compression_trim_sect4096

    Number of 4096 sectors trimmed

    Innodb_page_compression_trim_sect8192

    Number of 8192 sectors trimmed

    Saving Storage Space with Sparse Files
    Optimized for Flash Storage
    InnoDB doublewrite buffer
    Atomic Write Support
    COMPRESSED
    COMPRESSED
    COMPRESSED
    COMPRESSED
    COMPRESSED
    COMPRESSED
    COMPRESSED
    Storage Engine-Independent Column Compression - Comparison with InnoDB Page Compression
    innodb_compression_algorithm
    installed as a plugin
    SET GLOBAL
    option group
    option file
    zlib
    installed as a plugin
    SHOW GLOBAL STATUS
    installed as a plugin
    cmake
    CMakeCache.txt
    Compiling MariaDB From Source
    file per-table
    innodb_file_per_table
    file format
    innodb_file_format
    row format
    COMPACT
    DYNAMIC
    innodb_compression_default
    SET GLOBAL
    SET SESSION
    option group
    option file
    PAGE_COMPRESSED
    zlib
    lzma
    innodb_compression_level
    SET GLOBAL
    option group
    option file
    PAGE_COMPRESSION_LEVEL
    innodb_compression_failure_threshold_pct
    SET GLOBAL
    option group
    option file
    innodb_compression_pad_pct_max
    SET GLOBAL
    option group
    option file
    innodb_page_size
    unlink()
    fallocate()
    ls
    ls -s
    cp
    cp --sparse=always
    cp --sparse=never
    tar
    tar --sparse
    DeviceIoControl()
    FSCTL_SET_SPARSE
    FSCTL_SET_ZERO_DATA
    innodb_use_trim
    innodb_use_fallocate
    option group
    option file
    Fusion-io
    FusionIO devices
    NVMFS
    Fusion-io
    Western Digital
    NVMFS
    InnoDB Page Flushing
    SHOW GLOBAL STATUS
    mariadb-backup
    Percona XtraBackup
    Fusion-io
    Storage-Engine Independent Column Compression
    Atomic Write Support
    MariaDB Introduces Atomic Writes
    Small Datum: Third day with InnoDB transparent page compression
    zlib
    COMPRESSED

    InnoDB Online DDL Operations with the NOCOPY Alter Algorithm

    Understand the NOCOPY algorithm, which avoids rebuilding the clustered index for certain operations like adding secondary indexes, significantly reducing I/O.

    Supported Operations by Inheritance

    When the clause is set to NOCOPY, the supported operations are a superset of the operations that are supported when the clause is set to INSTANT.

    Therefore, when the clause is set to NOCOPY, some operations are supported by inheritance. See the following additional pages for more information about these supported operations:

    SET GLOBAL innodb_compression_algorithm='lzma';
    [mariadb]
    ...
    innodb_compression_algorithm=lzma
    SHOW GLOBAL STATUS WHERE Variable_name IN (
       'Innodb_have_lz4', 
       'Innodb_have_lzo', 
       'Innodb_have_lzma', 
       'Innodb_have_bzip2', 
       'Innodb_have_snappy'
    );
    +--------------------+-------+
    | Variable_name      | Value |
    +--------------------+-------+
    | Innodb_have_lz4    | OFF   |
    | Innodb_have_lzo    | OFF   |
    | Innodb_have_lzma   | ON    |
    | Innodb_have_bzip2  | OFF   |
    | Innodb_have_snappy | OFF   |
    +--------------------+-------+
    wget https://downloads.mariadb.com/MariaDB/mariadb-10.4.8/source/mariadb-10.4.8.tar.gz
    tar -xvzf mariadb-10.4.8.tar.gz
    cd mariadb-10.4.8/
    cmake .
    make
    make install
    make package
    SET GLOBAL innodb_compression_default=ON;
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    SET GLOBAL innodb_default_row_format='dynamic';
    
    SET GLOBAL innodb_compression_algorithm='lzma';
    
    SET SESSION  innodb_compression_default=ON;
    
    CREATE TABLE users (
       user_id INT NOT NULL, 
       b VARCHAR(200), 
       PRIMARY KEY(user_id)
    ) 
       ENGINE=InnoDB;
    [mariadb]
    ...
    innodb_compression_default=ON
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    SET GLOBAL innodb_default_row_format='dynamic';
    
    SET GLOBAL innodb_compression_algorithm='lzma';
    
    CREATE TABLE users (
       user_id INT NOT NULL, 
       b VARCHAR(200), 
       PRIMARY KEY(user_id)
    ) 
       ENGINE=InnoDB
       PAGE_COMPRESSED=1;
    SET GLOBAL innodb_compression_level=9;
    [mariadb]
    ...
    innodb_compression_level=9
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    SET GLOBAL innodb_default_row_format='dynamic';
    
    SET GLOBAL innodb_compression_algorithm='lzma';
    
    CREATE TABLE users (
       user_id INT NOT NULL, 
       b VARCHAR(200), 
       PRIMARY KEY(user_id)
    ) 
       ENGINE=InnoDB
       PAGE_COMPRESSED=1
       PAGE_COMPRESSION_LEVEL=9;
    SET GLOBAL innodb_compression_failure_threshold_pct=10;
    [mariadb]
    ...
    innodb_compression_failure_threshold_pct=10
    SET GLOBAL innodb_compression_pad_pct_max=75;
    [mariadb]
    ...
    innodb_compression_pad_pct_max=75
    fallocate(file_handle, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, file_offset, remainder_len);
    DeviceIoControl(file_handle, FSCTL_SET_SPARSE, inbuf, inbuf_size, 
       outbuf, outbuf_size,  NULL, &overlapped)
    ...
    DeviceIoControl(file_handle, FSCTL_SET_ZERO_DATA, inbuf, inbuf_size, 
       outbuf, outbuf_size,  NULL, &overlapped)
    [mariadb]
    ...
    innodb_use_trim=ON
    innodb_use_fallocate=ON
    CREATE TABLE `tab` (
         `id` INT(11) NOT NULL,
         `str` VARCHAR(50) DEFAULT NULL,
         PRIMARY KEY (`id`)
       ) ENGINE=InnoDB;
     
    INSERT INTO tab VALUES (1, 'str1');
    
    SHOW GLOBAL STATUS LIKE 'Innodb_num_pages_page_compressed';
    +----------------------------------+-------+
    | Variable_name                    | Value |
    +----------------------------------+-------+
    | Innodb_num_pages_page_compressed | 0     |
    +----------------------------------+-------+
     
    SET GLOBAL innodb_file_per_table=ON;
    
    SET GLOBAL innodb_file_format='Barracuda';
    
    SET GLOBAL innodb_default_row_format='dynamic';
    
    SET GLOBAL innodb_compression_algorithm='lzma';
     
    ALTER TABLE tab PAGE_COMPRESSED=1;
    
    SHOW GLOBAL STATUS LIKE 'Innodb_num_pages_page_compressed';
    +----------------------------------+-------+
    | Variable_name                    | Value |
    +----------------------------------+-------+
    | Innodb_num_pages_page_compressed | 0     |
    +----------------------------------+-------+
     
    SELECT SLEEP(10);
    +-----------+
    | SLEEP(10) |
    +-----------+
    |         0 |
    +-----------+
     
    SHOW GLOBAL STATUS LIKE 'Innodb_num_pages_page_compressed';
    +----------------------------------+-------+
    | Variable_name                    | Value |
    +----------------------------------+-------+
    | Innodb_num_pages_page_compressed | 3     |
    +----------------------------------+-------+
    • InnoDB Online DDL Operations with ALGORITHM=INSTANT

    Column Operations

    ALTER TABLE ... ADD COLUMN

    In and later, InnoDB supports adding columns to a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... ADD COLUMN for more information.

    This applies to ALTER TABLE ... ADD COLUMN for InnoDB tables.

    ALTER TABLE ... DROP COLUMN

    In and later, InnoDB supports dropping columns from a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... DROP COLUMN for more information.

    This applies to ALTER TABLE ... DROP COLUMN for InnoDB tables.

    ALTER TABLE ... MODIFY COLUMN

    This applies to ALTER TABLE ... MODIFY COLUMN for InnoDB tables.

    Reordering Columns

    In and later, InnoDB supports reordering columns within a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Reordering Columns for more information.

    Changing the Data Type of a Column

    InnoDB does not support modifying a column's data type with ALGORITHM set to NOCOPY in most cases. There are a few exceptions in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Changing the Data Type of a Column for more information.

    Changing a Column to NULL

    In and later, InnoDB supports modifying a column to allow NULL values with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Changing a Column to NULL for more information.

    Changing a Column to NOT NULL

    InnoDB does not support modifying a column to not allow NULL values with ALGORITHM set to NOCOPY.

    For example:

    Adding a New ENUM Option

    InnoDB supports adding a new ENUM option to a column with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Adding a New ENUM Option for more information.

    Adding a New SET Option

    InnoDB supports adding a new SET option to a column with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Adding a New SET Option for more information.

    Removing System Versioning from a Column

    In and later, InnoDB supports removing system versioning from a column with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Removing System Versioning from a Column for more information.

    ALTER TABLE ... ALTER COLUMN

    This applies to ALTER TABLE ... ALTER COLUMN for InnoDB tables.

    Setting a Column's Default Value

    InnoDB supports modifying a column's DEFAULT value with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Setting a Column's Default Value for more information.

    Removing a Column's Default Value

    InnoDB supports removing a column's DEFAULT value with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: Removing a Column's Default Value for more information.

    ALTER TABLE ... CHANGE COLUMN

    InnoDB supports renaming a column with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... CHANGE COLUMN for more information.

    This applies to ALTER TABLE ... CHANGE COLUMN for InnoDB tables.

    Index Operations

    ALTER TABLE ... ADD PRIMARY KEY

    InnoDB does not support adding a primary key to a table with ALGORITHM set to NOCOPY.

    For example:

    This applies to ALTER TABLE ... ADD PRIMARY KEY for InnoDB tables.

    ALTER TABLE ... DROP PRIMARY KEY

    InnoDB does not support dropping a primary key with ALGORITHM set to NOCOPY.

    For example:

    This applies to ALTER TABLE ... DROP PRIMARY KEY for InnoDB tables.

    ALTER TABLE ... ADD INDEX and CREATE INDEX

    This applies to ALTER TABLE ... ADD INDEX and CREATE INDEX for InnoDB tables.

    Adding a Plain Index

    InnoDB supports adding a plain index to a table with ALGORITHM set to NOCOPY.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the LOCK clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    And this succeeds:

    Adding a Fulltext Index

    InnoDB supports adding a FULLTEXT index to a table with ALGORITHM set to NOCOPY.

    However, there are some limitations, such as:

    • Adding a FULLTEXT index to a table that does not have a user-defined FTS_DOC_ID column will require the table to be rebuilt once. When the table is rebuilt, the system adds a hidden FTS_DOC_ID column. This initial operation will have to be performed with ALGORITHM set to INPLACE.From that point forward, adding additional FULLTEXT indexes to the same table will not require the table to be rebuilt, and ALGORITHM can be set to NOCOPY.

    • Only one FULLTEXT index may be added at a time when ALGORITHM is set to NOCOPY.

    This operation supports a read-only locking strategy. This strategy can be explicitly chosen by setting the LOCK clause to SHARED. When this strategy is used, read-only concurrent DML is permitted.

    For example, this succeeds, but the first operation requires the table to be rebuilt ALGORITHM set to INPLACE, so that the hidden FTS_DOC_ID column can be added:

    And this succeeds in the same way as above:

    But this second command fails, because only one FULLTEXT index can be added at a time:

    Adding a Spatial Index

    InnoDB supports adding a SPATIAL index to a table with ALGORITHM set to NOCOPY.

    This operation supports a read-only locking strategy. This strategy can be explicitly chosen by setting the LOCK clause to SHARED. When this strategy is used, read-only concurrent DML is permitted.

    For example, this succeeds:

    And this succeeds in the same way as above:

    ALTER TABLE ... DROP INDEX and DROP INDEX

    InnoDB supports dropping indexes from a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... DROP INDEX and DROP INDEX for more information.

    This applies to ALTER TABLE ... DROP INDEX and DROP INDEX for InnoDB tables.

    ALTER TABLE ... ADD FOREIGN KEY

    InnoDB does supports adding foreign key constraints to a table with ALGORITHM set to NOCOPY. In order to add a new foreign key constraint to a table with ALGORITHM set to NOCOPY, the foreign_key_checks system variable needs to be set to OFF. If it is set to ON, then ALGORITHM=COPY is required.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the LOCK clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this fails:

    But this succeeds:

    This applies to ALTER TABLE ... ADD FOREIGN KEY for InnoDB tables.

    ALTER TABLE ... DROP FOREIGN KEY

    InnoDB supports dropping foreign key constraints from a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... DROP FOREIGN KEY for more information.

    This applies to ALTER TABLE ... DROP FOREIGN KEY for InnoDB tables.

    Table Operations

    ALTER TABLE ... AUTO_INCREMENT=...

    InnoDB supports changing a table's AUTO_INCREMENT value with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... AUTO_INCREMENT=... for more information.

    This applies to ALTER TABLE ... AUTO_INCREMENT=... for InnoDB tables.

    ALTER TABLE ... ROW_FORMAT=...

    InnoDB does not support changing a table's row format with ALGORITHM set to NOCOPY.

    For example:

    This applies to ALTER TABLE ... ROW_FORMAT=... for InnoDB tables.

    ALTER TABLE ... KEY_BLOCK_SIZE=...

    InnoDB does not support changing a table's KEY_BLOCK_SIZE with ALGORITHM set to NOCOPY.

    For example:

    This applies to KEY_BLOCK_SIZE=... for InnoDB tables.

    ALTER TABLE ... PAGE_COMPRESSED=1 and ALTER TABLE ... PAGE_COMPRESSION_LEVEL=...

    In and later, InnoDB supports setting a table's PAGE_COMPRESSED value to 1 with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    InnoDB does not support changing a table's PAGE_COMPRESSED value from 1 to 0 with ALGORITHM set to NOCOPY.

    In these versions, InnoDB also supports changing a table's PAGE_COMPRESSION_LEVEL value with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause is set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... PAGE_COMPRESSED=1 and ALTER TABLE ... PAGE_COMPRESSION_LEVEL=... for more information.

    This applies to ALTER TABLE ... PAGE_COMPRESSED=... and ALTER TABLE ... PAGE_COMPRESSION_LEVEL=... for InnoDB tables.

    ALTER TABLE ... DROP SYSTEM VERSIONING

    InnoDB does not support dropping system versioning from a table with ALGORITHM set to NOCOPY.

    For example:

    This applies to ALTER TABLE ... DROP SYSTEM VERSIONING for InnoDB tables.

    ALTER TABLE ... DROP CONSTRAINT

    In and later, InnoDB supports dropping a CHECK constraint from a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... DROP CONSTRAINT for more information.

    This applies to ALTER TABLE ... DROP CONSTRAINT for InnoDB tables.

    ALTER TABLE ... FORCE

    InnoDB does not support forcing a table rebuild with ALGORITHM set to NOCOPY.

    For example:

    This applies to ALTER TABLE ... FORCE for InnoDB tables.

    ALTER TABLE ... ENGINE=InnoDB

    InnoDB does not support forcing a table rebuild with ALGORITHM set to NOCOPY.

    For example:

    This applies to ALTER TABLE ... ENGINE=InnoDB for InnoDB tables.

    OPTIMIZE TABLE ...

    InnoDB does not support optimizing a table with ALGORITHM set to NOCOPY.

    For example:

    This applies to OPTIMIZE TABLE for InnoDB tables.

    ALTER TABLE ... RENAME TO and RENAME TABLE ...

    InnoDB supports renaming a table with ALGORITHM set to NOCOPY in the cases where the operation supports having the ALGORITHM clause set to INSTANT.

    See InnoDB Online DDL Operations with ALGORITHM=INSTANT: ALTER TABLE ... RENAME TO and RENAME TABLE ... for more information.

    This applies to ALTER TABLE ... RENAME TO and RENAME TABLE for InnoDB tables.

    Limitations

    Limitations Related to Generated (Virtual and Persistent/Stored) Columns

    Generated columns do not currently support online DDL for all of the same operations that are supported for "real" columns.

    See Generated (Virtual and Persistent/Stored) Columns: Statement Support for more information on the limitations.

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

    ALGORITHM
    ALGORITHM
    ALGORITHM
    snappy
    Innodb_page_compression_trim_sect16384
    Innodb_page_compression_trim_sect32768
    Innodb_num_pages_page_compressed
    Innodb_num_page_compressed_trim_op
    Innodb_num_page_compressed_trim_op_saved
    Innodb_num_pages_page_decompressed
    Innodb_num_pages_page_compression_error
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=REDUNDANT;
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) NOT NULL;
    ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION sql_mode='STRICT_TRANS_TABLES';
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ADD PRIMARY KEY (a);
    ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab DROP PRIMARY KEY;
    ERROR 1846 (0A000): ALGORITHM=NOCOPY is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ADD INDEX b_index (b);
    Query OK, 0 rows affected (0.009 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    CREATE INDEX b_index ON tab (b);
    Query OK, 0 rows affected (0.009 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.043 sec)
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ADD FULLTEXT INDEX c_index (c);
    Query OK, 0 rows affected (0.017 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    CREATE FULLTEXT INDEX b_index ON tab (b);
    Query OK, 0 rows affected (0.048 sec)
    
    SET SESSION alter_algorithm='NOCOPY';
    CREATE FULLTEXT INDEX c_index ON tab (c);
    Query OK, 0 rows affected (0.016 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.041 sec)
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ADD FULLTEXT INDEX c_index (c), ADD FULLTEXT INDEX d_index (d);
    ERROR 1846 (0A000): ALGORITHM=NOCOPY is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c GEOMETRY NOT NULL
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ADD SPATIAL INDEX c_index (c);
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c GEOMETRY NOT NULL
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    CREATE SPATIAL INDEX c_index ON tab (c);
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT
    );
    
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab1 ADD FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a);
    ERROR 1846 (0A000): ALGORITHM=NOCOPY is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT
    );
    
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION foreign_key_checks=OFF;
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab1 ADD FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a);
    Query OK, 0 rows affected (0.011 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=DYNAMIC;
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ROW_FORMAT=COMPRESSED;
    ERROR 1846 (0A000): ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=COMPRESSED
      KEY_BLOCK_SIZE=4;
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab KEY_BLOCK_SIZE=2;
    ERROR 1846 (0A000): ALGORITHM=NOCOPY is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) WITH SYSTEM VERSIONING;
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab DROP SYSTEM VERSIONING;
    ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab FORCE;
    ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='NOCOPY';
    ALTER TABLE tab ENGINE=InnoDB;
    ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SHOW GLOBAL VARIABLES WHERE Variable_name IN('innodb_defragment', 'innodb_optimize_fulltext_only');
    +-------------------------------+-------+
    | Variable_name                 | Value |
    +-------------------------------+-------+
    | innodb_defragment             | OFF   |
    | innodb_optimize_fulltext_only | OFF   |
    +-------------------------------+-------+
    2 rows in set (0.001 sec)
    
    SET SESSION alter_algorithm='NOCOPY';
    OPTIMIZE TABLE tab;
    +---------+----------+----------+-----------------------------------------------------------------------------+
    | Table   | Op       | Msg_type | Msg_text                                                                    |
    +---------+----------+----------+-----------------------------------------------------------------------------+
    | db1.tab | optimize | note     | Table does not support optimize, doing recreate + analyze instead           |
    | db1.tab | optimize | error    | ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE |
    | db1.tab | optimize | status   | Operation failed                                                            |
    +---------+----------+----------+-----------------------------------------------------------------------------+
    3 rows in set, 1 warning (0.002 sec)

    InnoDB Online DDL Operations with the INSTANT Alter Algorithm

    Discover the INSTANT algorithm, which modifies table metadata without rebuilding the table, enabling extremely fast schema changes like adding columns.

    Column Operations

    ALTER TABLE ... ADD COLUMN

    In and later, InnoDB supports adding columns to a table with set to INSTANT if the new column is the last column in the table. See for more information. If the table has a hidden FTS_DOC_ID column is present, then this is not supported.

    In and later, InnoDB supports adding columns to a table with set to INSTANT, regardless of where in the column list the new column is added.

    When this operation is performed with set to INSTANT, the tablespace file will have a non-canonical storage format. See for more information.

    With the exception of adding an column, this operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    And this succeeds in and later:

    This applies to for tables.

    See for more information.

    ALTER TABLE ... DROP COLUMN

    In and later, InnoDB supports dropping columns from a table with set to INSTANT. See for more information.

    When this operation is performed with set to INSTANT, the tablespace file will have a non-canonical storage format. See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... MODIFY COLUMN

    This applies to for tables.

    Reordering Columns

    In and later, InnoDB supports reordering columns within a table with set to INSTANT. See for more information.

    When this operation is performed with set to INSTANT, the tablespace file will have a non-canonical storage format. See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    Changing the Data Type of a Column

    InnoDB does not support modifying a column's data type with set to INSTANT in most cases. There are some exceptions:

    • InnoDB supports increasing the length of VARCHAR columns with set to INSTANT, unless it would require changing the number of bytes requires to represent the column's length. A VARCHAR column that is between 0 and 255 bytes in size requires 1 byte to represent its length, while a VARCHAR column that is 256 bytes or longer requires 2 bytes to represent its length. This means that the length of a column cannot be increased with set to INSTANT if the original length was less than 256 bytes, and the new length is 256 bytes or more.

    • In and later, InnoDB supports increasing the length of VARCHAR

    The supported operations in this category support the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this fails:

    But this succeeds because the original length of the column is less than 256 bytes, and the new length is still less than 256 bytes:

    But this fails because the original length of the column is between 128 bytes and 255 bytes, and the new length is greater than 256 bytes:

    But this succeeds in and later because the table has ROW_FORMAT=REDUNDANT:

    And this succeeds in and later because the table has ROW_FORMAT=DYNAMIC and the column's original length is 127 bytes or less:

    And this succeeds in and later because the table has ROW_FORMAT=COMPRESSED and the column's original length is 127 bytes or less:

    But this fails even in and later because the table has ROW_FORMAT=DYNAMIC and the column's original length is between 128 bytes and 255 bytes:

    Changing a Column to NULL

    In and later, InnoDB supports modifying a column to allow values with set to INSTANT if the table option is set to . See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    Changing a Column to NOT NULL

    InnoDB does not support modifying a column to not allow values with set to INSTANT.

    For example:

    Adding a New ENUM Option

    InnoDB supports adding a new option to a column with set to INSTANT. In order to add a new option with set to INSTANT, the following requirements must be met:

    • It must be added to the end of the list.

    • The storage requirements must not change.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    Adding a New SET Option

    InnoDB supports adding a new option to a column with set to INSTANT. In order to add a new option with set to INSTANT, the following requirements must be met:

    • It must be added to the end of the list.

    • The storage requirements must not change.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    Removing System Versioning from a Column

    In and later, InnoDB supports removing from a column with set to INSTANT. In order for this to work, the system variable must be set to KEEP. See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    ALTER TABLE ... ALTER COLUMN

    This applies to for tables.

    Setting a Column's Default Value

    InnoDB supports modifying a column's value with set to INSTANT.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    Removing a Column's Default Value

    InnoDB supports removing a column's value with set to INSTANT.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    ALTER TABLE ... CHANGE COLUMN

    InnoDB supports renaming a column with set to INSTANT, unless the column's data type or attributes changed in addition to the name.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    This applies to for tables.

    Index Operations

    ALTER TABLE ... ADD PRIMARY KEY

    InnoDB does not support adding a primary key to a table with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... DROP PRIMARY KEY

    InnoDB does not support dropping a primary key with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... ADD INDEX and CREATE INDEX

    This applies to and for tables.

    Adding a Plain Index

    InnoDB does not support adding a plain index to a table with set to INSTANT.

    For example, this fails:

    And this fails:

    Adding a Fulltext Index

    InnoDB does not support adding a index to a table with set to INSTANT.

    For example, this fails:

    And this fails:

    Adding a Spatial Index

    InnoDB does not support adding a index to a table with set to INSTANT.

    For example, this fails:

    And this fails:

    ALTER TABLE ... ADD FOREIGN KEY

    InnoDB does not support adding foreign key constraints to a table with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... DROP FOREIGN KEY

    InnoDB supports dropping foreign key constraints from a table with set to INSTANT.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    Table Operations

    ALTER TABLE ... AUTO_INCREMENT=...

    InnoDB supports changing a table's value with set to INSTANT.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... ROW_FORMAT=...

    InnoDB does not support changing a table's with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... KEY_BLOCK_SIZE=...

    InnoDB does not support changing a table's with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... PAGE_COMPRESSED=1 and ALTER TABLE ... PAGE_COMPRESSION_LEVEL=...

    In and later, InnoDB supports setting a table's value to 1 with set to INSTANT. InnoDB does not support changing a table's value from 1 to 0 with set to INSTANT.

    In these versions, InnoDB also supports changing a table's value with set to INSTANT.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    See for more information.

    For example, this succeeds:

    And this succeeds:

    But this fails:

    This applies to and for tables.

    ALTER TABLE ... DROP SYSTEM VERSIONING

    InnoDB does not support dropping from a table with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... DROP CONSTRAINT

    In and later, InnoDB supports dropping a constraint from a table with set to INSTANT. See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... FORCE

    InnoDB does not support forcing a table rebuild with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... ENGINE=InnoDB

    InnoDB does not support forcing a table rebuild with set to INSTANT.

    For example:

    This applies to for tables.

    OPTIMIZE TABLE ...

    InnoDB does not support optimizing a table with set to INSTANT.

    For example:

    This applies to for tables.

    ALTER TABLE ... RENAME TO and RENAME TABLE ...

    InnoDB supports renaming a table with set to INSTANT.

    This operation supports the exclusive locking strategy. This strategy can be explicitly chosen by setting the clause to EXCLUSIVE. When this strategy is used, concurrent DML is not permitted.

    For example, this succeeds:

    And this succeeds:

    This applies to and for tables.

    Limitations

    Limitations Related to Generated (Virtual and Persistent/Stored) Columns

    do not currently support online DDL for all of the same operations that are supported for "real" columns.

    See for more information on the limitations.

    Non-canonical Storage Format Caused by Some Operations

    Some operations cause a table's tablespace file to use a non-canonical storage format when the INSTANT algorithm is used. The affected operations include:

    These operations require the following non-canonical changes to the storage format:

    • A hidden metadata record at the start of the clustered index is used to store each column's value. This makes it possible to add new columns that have default values without rebuilding the table.

    • A in the hidden metadata record is used to store column mappings. This makes it possible to drop or reorder columns without rebuilding the table. This also makes it possible to add columns to any position or drop columns from any position in the table without rebuilding the table.

    • If a column is dropped, old records will contain garbage in that column's former position, and new records are written with values, empty strings, or dummy values.

    This non-canonical storage format has the potential to incur some performance or storage overhead for all subsequent DML operations. If you notice some issues like this and you want to normalize a table's storage format to avoid this problem, then you can do so by forcing a table rebuild by executing with set to INPLACE:

    However, keep in mind that there are certain scenarios where you may not be able to rebuild the table with set to INPLACE. See for more information on those cases. If you hit one of those scenarios, but you still want to rebuild the table, then you would have to do so with set to COPY.

    Known Bugs

    There are some known bugs that could lead to issues when an InnoDB DDL operation is performed using the algorithm. This algorithm will usually be chosen by default if the operation supports the algorithm.

    The effect of many of these bugs is that the table seems to forget that its tablespace file is in the .

    If you are concerned that a table may be affected by one of these bugs, then your best option would be to normalize the table structure. This can be done by rebuilding the table:

    If you are concerned about these bugs, and you want to perform an operation that supports the algorithm, but you want to avoid using that algorithm, then you can set the algorithm to and add the FORCE keyword to the statement:

    Closed Bugs

    • : This bug could cause a table to become corrupt if a column was added instantly. It is fixed in and .

    • : This bug could cause a table to become corrupt if a column was dropped instantly. It is fixed in .

    • : This bug could cause a table to become corrupt during page reorganization if a column was added instantly. It is fixed in and .

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

    columns with
    set to INSTANT with no restrictions if the
    table option is set to
    . See
    for more information.
  • In and later, InnoDB also supports increasing the length of VARCHAR columns with ALGORITHM set to INSTANT in a more limited manner if the ROW_FORMAT table option is set to COMPACT, DYNAMIC, or COMPRESSED. In this scenario, the following limitations apply:

    • The length can be increased with ALGORITHM set to INSTANT if the original length of the column is 127 bytes or less, and the new length of the column is 256 bytes or more.

    • The length can be increased with set to INSTANT if the original length of the column is 255 bytes or less, and the new length of the column is still 255 bytes or less.

    • The length can be increased with set to INSTANT if the original length of the column is 256 bytes or more, and the new length of the column is still 256 bytes or more.

    • The length can not be increased with set to INSTANT if the original length was between 128 bytes and 255 bytes, and the new length is 256 bytes or more.

    • See for more information.

  • MDEV-19783: This bug could cause a table to become corrupt if a column was added instantly. It is fixed in and
  • MDEV-20090: This bug could cause a table to become corrupt if columns were added, dropped, or reordered instantly. It is fixed in .

  • MDEV-18519: This bug could cause a table to become corrupt if a column was added instantly. It is fixed in MariaDB 10.6.9, , and .

  • MDEV-18519: This bug could cause a table to become corrupt if a column was added instantly. This isn't and won't be fixed in versions less than MariaDB 10.6.

  • ALGORITHM
    MDEV-11369
    ALGORITHM
    ALGORITHM
    Non-canonical Storage Format Caused by Some Operations
    auto-increment
    LOCK
    ALTER TABLE ... ADD COLUMN
    InnoDB
    Instant ADD COLUMN for InnoDB
    ALGORITHM
    MDEV-15562
    ALGORITHM
    Non-canonical Storage Format Caused by Some Operations
    LOCK
    ALTER TABLE ... DROP COLUMN
    InnoDB
    ALTER TABLE ... MODIFY COLUMN
    InnoDB
    ALGORITHM
    MDEV-15562
    ALGORITHM
    Non-canonical Storage Format Caused by Some Operations
    LOCK
    ALGORITHM
    ALGORITHM
    ALGORITHM
    LOCK
    NULL
    ALGORITHM
    ROW_FORMAT
    REDUNDANT
    MDEV-15563
    LOCK
    NULL
    ALGORITHM
    ENUM
    ALGORITHM
    ENUM
    ALGORITHM
    LOCK
    SET
    ALGORITHM
    SET
    ALGORITHM
    LOCK
    system versioning
    ALGORITHM
    system_versioning_alter_history
    MDEV-16330
    LOCK
    ALTER TABLE ... ALTER COLUMN
    InnoDB
    DEFAULT
    ALGORITHM
    LOCK
    DEFAULT
    ALGORITHM
    LOCK
    ALGORITHM
    LOCK
    ALTER TABLE ... CHANGE COLUMN
    InnoDB
    ALGORITHM
    ALTER TABLE ... ADD PRIMARY KEY
    InnoDB
    ALGORITHM
    ALTER TABLE ... DROP PRIMARY KEY
    InnoDB
    ALTER TABLE ... ADD INDEX
    CREATE INDEX
    InnoDB
    ALGORITHM
    FULLTEXT
    ALGORITHM
    SPATIAL
    ALGORITHM
    ALGORITHM
    ALTER TABLE ... ADD FOREIGN KEY
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... DROP FOREIGN KEY
    InnoDB
    AUTO_INCREMENT
    ALGORITHM
    LOCK
    ALTER TABLE ... AUTO_INCREMENT=...
    InnoDB
    row format
    ALGORITHM
    ALTER TABLE ... ROW_FORMAT=...
    InnoDB
    KEY_BLOCK_SIZE
    ALGORITHM
    KEY_BLOCK_SIZE=...
    InnoDB
    PAGE_COMPRESSED
    ALGORITHM
    PAGE_COMPRESSED
    ALGORITHM
    PAGE_COMPRESSION_LEVEL
    ALGORITHM
    LOCK
    MDEV-16328
    ALTER TABLE ... PAGE_COMPRESSED=...
    ALTER TABLE ... PAGE_COMPRESSION_LEVEL=...
    InnoDB
    system versioning
    ALGORITHM
    ALTER TABLE ... DROP SYSTEM VERSIONING
    InnoDB
    CHECK
    ALGORITHM
    MDEV-16331
    LOCK
    ALTER TABLE ... DROP CONSTRAINT
    InnoDB
    ALGORITHM
    ALTER TABLE ... FORCE
    InnoDB
    ALGORITHM
    ALTER TABLE ... ENGINE=InnoDB
    InnoDB
    ALGORITHM
    OPTIMIZE TABLE
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... RENAME TO
    RENAME TABLE
    InnoDB
    Generated columns
    Generated (Virtual and Persistent/Stored) Columns: Statement Support
    Adding a column.
    Dropping a column.
    Reordering columns.
    DEFAULT
    BLOB
    NULL
    ALTER TABLE ... FORCE
    ALGORITHM
    ALGORITHM
    InnoDB Online DDL Operations with ALGORITHM=INPLACE: Limitations
    ALGORITHM
    INSTANT
    non-canonical storage format
    INSTANT
    INPLACE
    ALTER TABLE
    MDEV-20066
    MDEV-20117
    MDEV-19743
    ALGORITHM
    ROW_FORMAT
    REDUNDANT
    MDEV-15563
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ADD COLUMN c VARCHAR(50);
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ADD COLUMN c VARCHAR(50) AFTER a;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab DROP COLUMN c;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) AFTER a;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c INT;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(100);
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(255)
    ) CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(256);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(200)
    ) ROW_FORMAT=REDUNDANT;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(300);
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(127)
    ) ROW_FORMAT=DYNAMIC
      CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(300);
    Query OK, 0 rows affected (0.003 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(127)
    ) ROW_FORMAT=COMPRESSED
      CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(300);
    Query OK, 0 rows affected (0.003 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(128)
    ) ROW_FORMAT=DYNAMIC
      CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(300);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50) NOT NULL
    ) ROW_FORMAT=REDUNDANT;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) NULL;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=REDUNDANT;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) NOT NULL;
    ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c ENUM('red', 'green')
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c ENUM('red', 'green', 'blue');
    Query OK, 0 rows affected (0.002 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c ENUM('red', 'green')
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c ENUM('red', 'blue', 'green');
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c SET('red', 'green')
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c SET('red', 'green', 'blue');
    Query OK, 0 rows affected (0.002 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c SET('red', 'green')
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c SET('red', 'blue', 'green');
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50) WITH SYSTEM VERSIONING
    );
    
    SET SESSION system_versioning_alter_history='KEEP';
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) WITHOUT SYSTEM VERSIONING;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ALTER COLUMN c SET DEFAULT 'NO value explicitly provided.';
    Query OK, 0 rows affected (0.003 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50) DEFAULT 'NO value explicitly provided.'
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ALTER COLUMN c DROP DEFAULT;
    Query OK, 0 rows affected (0.002 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab CHANGE COLUMN c str VARCHAR(50);
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab CHANGE COLUMN c num INT;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION sql_mode='STRICT_TRANS_TABLES';
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ADD PRIMARY KEY (a);
    ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab DROP PRIMARY KEY;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ADD INDEX b_index (b);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    CREATE INDEX b_index ON tab (b);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.042 sec)
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ADD FULLTEXT INDEX c_index (c);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    CREATE FULLTEXT INDEX b_index ON tab (b);
    Query OK, 0 rows affected (0.040 sec)
    
    SET SESSION alter_algorithm='INSTANT';
    CREATE FULLTEXT INDEX c_index ON tab (c);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c GEOMETRY NOT NULL
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ADD SPATIAL INDEX c_index (c);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c GEOMETRY NOT NULL
    );
    
    SET SESSION alter_algorithm='INSTANT';
    CREATE SPATIAL INDEX c_index ON tab (c);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT
    );
    
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION foreign_key_checks=OFF;
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab1 ADD FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a);
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT,
       FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab1 DROP FOREIGN KEY tab2_fk; 
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab AUTO_INCREMENT=100;
    Query OK, 0 rows affected (0.002 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=DYNAMIC;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ROW_FORMAT=COMPRESSED;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=COMPRESSED
      KEY_BLOCK_SIZE=4;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab KEY_BLOCK_SIZE=2;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab PAGE_COMPRESSED=1;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) PAGE_COMPRESSED=1
      PAGE_COMPRESSION_LEVEL=5;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab PAGE_COMPRESSION_LEVEL=4;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) PAGE_COMPRESSED=1;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab PAGE_COMPRESSED=0;
    ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) WITH SYSTEM VERSIONING;
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab DROP SYSTEM VERSIONING;
    ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       CONSTRAINT b_not_empty CHECK (b != '')
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab DROP CONSTRAINT b_not_empty;
    Query OK, 0 rows affected (0.002 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab FORCE;
    ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab ENGINE=InnoDB;
    ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SHOW GLOBAL VARIABLES WHERE Variable_name IN('innodb_defragment', 'innodb_optimize_fulltext_only');
    +-------------------------------+-------+
    | Variable_name                 | Value |
    +-------------------------------+-------+
    | innodb_defragment             | OFF   |
    | innodb_optimize_fulltext_only | OFF   |
    +-------------------------------+-------+
    2 rows in set (0.001 sec)
    
    SET SESSION alter_algorithm='INSTANT';
    OPTIMIZE TABLE tab;
    +---------+----------+----------+------------------------------------------------------------------------------+
    | Table   | Op       | Msg_type | Msg_text                                                                     |
    +---------+----------+----------+------------------------------------------------------------------------------+
    | db1.tab | optimize | note     | Table does not support optimize, doing recreate + analyze instead            |
    | db1.tab | optimize | error    | ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE |
    | db1.tab | optimize | status   | Operation failed                                                             |
    +---------+----------+----------+------------------------------------------------------------------------------+
    3 rows in set, 1 warning (0.002 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    ALTER TABLE tab RENAME TO old_tab;
    Query OK, 0 rows affected (0.008 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INSTANT';
    RENAME TABLE tab TO old_tab;
    Query OK, 0 rows affected (0.008 sec)
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab FORCE;
    Query OK, 0 rows affected (0.008 sec)
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab FORCE;
    Query OK, 0 rows affected (0.008 sec)
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD COLUMN c VARCHAR(50), FORCE;
    ALGORITHM
    ALGORITHM
    ALGORITHM
    MDEV-15563

    InnoDB Online DDL Operations with the INPLACE Alter Algorithm

    Learn about operations supported by the INPLACE algorithm, which rebuilds the table but allows concurrent DML, offering a balance between performance and availability.

    Supported Operations by Inheritance

    When the ALGORITHM clause is set to INPLACE, the supported operations are a superset of the operations that are supported when the ALGORITHM clause is set to NOCOPY. Similarly, when the ALGORITHM clause is set to NOCOPY, the supported operations are a superset of the operations that are supported when the ALGORITHM clause is set to INSTANT.

    Therefore, when the clause is set to INPLACE, some operations are supported by inheritance. See the following additional pages for more information about these supported operations:

    Column Operations

    ALTER TABLE ... ADD COLUMN

    InnoDB supports adding columns to a table with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    With the exception of adding an column, this operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... DROP COLUMN

    InnoDB supports dropping columns from a table with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... MODIFY COLUMN

    This applies to for tables.

    Reordering Columns

    InnoDB supports reordering columns within a table with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    Changing the Data Type of a Column

    InnoDB does not support modifying a column's data type with set to INPLACE in most cases. There are some exceptions:

    • In and later, InnoDB supports increasing the length of VARCHAR columns with set to INPLACE, unless it would require changing the number of bytes requires to represent the column's length. A VARCHAR column that is between 0 and 255 bytes in size requires 1 byte to represent its length, while a VARCHAR column that is 256 bytes or longer requires 2 bytes to represent its length. This means that the length of a column cannot be increased with set to INPLACE if the original length was less than 256 bytes, and the new length is 256 bytes or more.

    • In and later, InnoDB supports increasing the length of VARCHAR

    See for more information.

    For example, this fails:

    But this succeeds in and later, because the original length of the column is less than 256 bytes, and the new length is still less than 256 bytes:

    But this fails in and later, because the original length of the column is less than 256 bytes, and the new length is greater than 256 bytes:

    Changing a Column to NULL

    InnoDB supports modifying a column to allow values with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    Changing a Column to NOT NULL

    InnoDB supports modifying a column to not allow values with set to INPLACE. It is required for to be enabled in . The operation will fail if the column contains any NULL values. Changes that would interfere with referential integrity are also not permitted.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    Adding a New ENUM Option

    InnoDB supports adding a new option to a column with set to INPLACE. In order to add a new option with set to INPLACE, the following requirements must be met:

    • It must be added to the end of the list.

    • The storage requirements must not change.

    This operation only changes the table's metadata, so the table does not have to be rebuilt..

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    Adding a New SET Option

    InnoDB supports adding a new option to a column with set to INPLACE. In order to add a new option with set to INPLACE, the following requirements must be met:

    • It must be added to the end of the list.

    • The storage requirements must not change.

    This operation only changes the table's metadata, so the table does not have to be rebuilt..

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    Removing System Versioning from a Column

    In and later, InnoDB supports removing from a column with set to INPLACE. In order for this to work, the system variable must be set to KEEP. See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    ALTER TABLE ... ALTER COLUMN

    This applies to for tables.

    Setting a Column's Default Value

    InnoDB supports modifying a column's value with set to INPLACE.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted. For example:

    Removing a Column's Default Value

    InnoDB supports removing a column's value with set to INPLACE.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    ALTER TABLE ... CHANGE COLUMN

    InnoDB supports renaming a column with set to INPLACE, unless the column's data type or attributes changed in addition to the name.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    This applies to for tables.

    Index Operations

    ALTER TABLE ... ADD PRIMARY KEY

    InnoDB supports adding a primary key to a table with set to INPLACE.

    If the new primary key column is not defined as , then it is highly recommended for to be enabled in . Otherwise, NULL values are silently converted to the default value for the given data type, which is probably not the desired behavior in this scenario.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    But this fails:

    And this fails:

    This applies to for tables.

    ALTER TABLE ... DROP PRIMARY KEY

    InnoDB does not support dropping a primary key with set to INPLACE in most cases.

    If you try to do so, then you will see an error. InnoDB only supports this operation with set to COPY. Concurrent DML is not permitted.

    However, there is an exception. If you are dropping a primary key, and adding a new one at the same time, then that operation can be performed with set to INPLACE. This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this fails:

    But this succeeds:

    This applies to for tables.

    ALTER TABLE ... ADD INDEX and CREATE INDEX

    This applies to and for tables.

    Adding a Plain Index

    InnoDB supports adding a plain index to a table with set to INPLACE. The table is not rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    And this succeeds:

    Adding a Fulltext Index

    InnoDB supports adding a index to a table with set to INPLACE. The table is not rebuilt in some cases.

    However, there are some limitations, such as:

    • Adding a index to a table that does not have a user-defined FTS_DOC_ID column will require the table to be rebuilt once. When the table is rebuilt, the system adds a hidden FTS_DOC_ID column. From that point forward, adding additional indexes to the same table will not require the table to be rebuilt when is set to INPLACE.

    • Only one index may be added at a time when is set to INPLACE.

    This operation supports a read-only locking strategy. This strategy can be explicitly chosen by setting the clause to SHARED. When this strategy is used, read-only concurrent DML is permitted.

    For example, this succeeds, but requires the table to be rebuilt, so that the hidden FTS_DOC_ID column can be added:

    And this succeeds in the same way as above:

    And this succeeds, and the second command does not require the table to be rebuilt:

    But this second command fails, because only one index can be added at a time:

    And this third command fails, because a table cannot be rebuilt when it has more than one index:

    Adding a Spatial Index

    InnoDB supports adding a index to a table with set to INPLACE.

    However, there are some limitations, such as:

    • If a table has a index, then it cannot be rebuilt by any operations when the clause is set to NONE.

    This operation supports a read-only locking strategy. This strategy can be explicitly chosen by setting the clause to SHARED. When this strategy is used, read-only concurrent DML is permitted.

    For example, this succeeds:

    And this succeeds in the same way as above:

    ALTER TABLE ... DROP INDEX and DROP INDEX

    InnoDB supports dropping indexes from a table with set to INPLACE.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this succeeds:

    And this succeeds:

    This applies to and for tables.

    ALTER TABLE ... ADD FOREIGN KEY

    InnoDB supports adding foreign key constraints to a table with set to INPLACE. In order to add a new foreign key constraint to a table with set to INPLACE, the system variable needs to be set to OFF. If it is set to ON, then ALGORITHM=COPY is required.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example, this fails:

    But this succeeds:

    This applies to for tables.

    ALTER TABLE ... DROP FOREIGN KEY

    InnoDB supports dropping foreign key constraints from a table with set to INPLACE.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    Table Operations

    ALTER TABLE ... AUTO_INCREMENT=...

    InnoDB supports changing a table's value with set to INPLACE. This operation should finish instantly. The table is not rebuilt.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... ROW_FORMAT=...

    InnoDB supports changing a table's with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... KEY_BLOCK_SIZE=...

    InnoDB supports changing a table's with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... PAGE_COMPRESSED=... and ALTER TABLE ... PAGE_COMPRESSION_LEVEL=...

    In and later, InnoDB supports setting a table's value to 1 with set to INPLACE. InnoDB also supports changing a table's value from 1 to 0 with set to INPLACE.

    In these versions, InnoDB also supports changing a table's value with set to INPLACE.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    See for more information.

    For example, this succeeds:

    And this succeeds:

    And this succeeds:

    This applies to and for tables.

    ALTER TABLE ... DROP SYSTEM VERSIONING

    InnoDB supports dropping from a table with set to INPLACE.

    This operation supports the read-only locking strategy. This strategy can be explicitly chosen by setting the clause to SHARED. When this strategy is used, read-only concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... DROP CONSTRAINT

    In and later, InnoDB supports dropping a constraint from a table with set to INPLACE. See for more information.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... FORCE

    InnoDB supports forcing a table rebuild with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    ALTER TABLE ... ENGINE=InnoDB

    InnoDB supports forcing a table rebuild with set to INPLACE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    This operation supports the non-locking strategy. This strategy can be explicitly chosen by setting the clause to NONE. When this strategy is used, all concurrent DML is permitted.

    For example:

    This applies to for tables.

    OPTIMIZE TABLE ...

    InnoDB supports optimizing a table with set to INPLACE.

    If the system variable is set to OFF, and if the system variable is also set to OFF, then OPTIMIZE TABLE are equivalent to ALTER TABLE … FORCE.

    The table is rebuilt, which means that all of the data is reorganized substantially, and the indexes are rebuilt. As a result, the operation is quite expensive.

    If either of the previously mentioned system variables is set to ON, then OPTIMIZE TABLE will optimize some data without rebuilding the table. However, the file size will not be reduced.

    For example, this succeeds:

    And this succeeds, but the table is not rebuilt:

    This applies to for tables.

    ALTER TABLE ... RENAME TO and RENAME TABLE ...

    InnoDB supports renaming a table with set to INPLACE.

    This operation only changes the table's metadata, so the table does not have to be rebuilt.

    This operation supports the exclusive locking strategy. This strategy can be explicitly chosen by setting the clause to EXCLUSIVE. When this strategy is used, concurrent DML is not permitted.

    For example, this succeeds:

    And this succeeds:

    This applies to and for tables.

    Limitations

    Limitations Related to Fulltext Indexes

    • If a table has more than one index, then it cannot be rebuilt by any operations when is set to INPLACE.

    • If a table has a index, then it cannot be rebuilt by any operations when the clause is set to NONE.

    Limitations Related to Spatial Indexes

    • If a table has a index, then it cannot be rebuilt by any operations when the clause is set to NONE.

    Limitations Related to Generated (Virtual and Persistent/Stored) Columns

    do not currently support online DDL for all of the same operations that are supported for "real" columns.

    See for more information on the limitations.

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

    columns with
    set to INPLACE in the cases where the operation supports having the
    clause set to INSTANT.
    If a table has more than one FULLTEXT index, then it cannot be rebuilt by any ALTER TABLE operations when ALGORITHM is set to INPLACE.
  • If a table has a FULLTEXT index, then it cannot be rebuilt by any ALTER TABLE operations when the LOCK clause is set to NONE.

  • ALGORITHM
    InnoDB Online DDL Operations with ALGORITHM=NOCOPY
    InnoDB Online DDL Operations with ALGORITHM=INSTANT
    ALGORITHM
    auto-increment
    LOCK
    ALTER TABLE ... ADD COLUMN
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... DROP COLUMN
    InnoDB
    ALTER TABLE ... MODIFY COLUMN
    InnoDB
    ALGORITHM
    LOCK
    ALGORITHM
    ALGORITHM
    ALGORITHM
    InnoDB Online DDL Operations with ALGORITHM=INSTANT: Changing the Data Type of a Column
    NULL
    ALGORITHM
    LOCK
    NULL
    ALGORITHM
    strict mode
    SQL_MODE
    LOCK
    ENUM
    ALGORITHM
    ENUM
    ALGORITHM
    LOCK
    SET
    ALGORITHM
    SET
    ALGORITHM
    LOCK
    system versioning
    ALGORITHM
    system_versioning_alter_history
    MDEV-16330
    LOCK
    ALTER TABLE ... ALTER COLUMN
    InnoDB
    DEFAULT
    ALGORITHM
    LOCK
    DEFAULT
    ALGORITHM
    LOCK
    ALGORITHM
    LOCK
    ALTER TABLE ... CHANGE COLUMN
    InnoDB
    ALGORITHM
    NOT NULL
    strict mode
    SQL_MODE
    LOCK
    ALTER TABLE ... ADD PRIMARY KEY
    InnoDB
    ALGORITHM
    ALGORITHM
    ALGORITHM
    LOCK
    ALTER TABLE ... DROP PRIMARY KEY
    InnoDB
    ALTER TABLE ... ADD INDEX
    CREATE INDEX
    InnoDB
    ALGORITHM
    LOCK
    FULLTEXT
    ALGORITHM
    FULLTEXT
    FULLTEXT
    ALGORITHM
    FULLTEXT
    ALGORITHM
    LOCK
    FULLTEXT
    FULLTEXT
    SPATIAL
    ALGORITHM
    SPATIAL
    ALTER TABLE
    LOCK
    LOCK
    ALGORITHM
    LOCK
    ALTER TABLE ... DROP INDEX
    DROP INDEX
    InnoDB
    ALGORITHM
    ALGORITHM
    foreign_key_checks
    LOCK
    ALTER TABLE ... ADD FOREIGN KEY
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... DROP FOREIGN KEY
    InnoDB
    AUTO_INCREMENT
    ALGORITHM
    LOCK
    ALTER TABLE ... AUTO_INCREMENT=...
    InnoDB
    row format
    ALGORITHM
    LOCK
    ALTER TABLE ... ROW_FORMAT=...
    InnoDB
    KEY_BLOCK_SIZE
    ALGORITHM
    LOCK
    KEY_BLOCK_SIZE=...
    InnoDB
    PAGE_COMPRESSED
    ALGORITHM
    PAGE_COMPRESSED
    ALGORITHM
    PAGE_COMPRESSION_LEVEL
    ALGORITHM
    LOCK
    MDEV-16328
    PAGE_COMPRESSED=...
    PAGE_COMPRESSION_LEVEL=...
    InnoDB
    system versioning
    ALGORITHM
    LOCK
    ALTER TABLE ... DROP SYSTEM VERSIONING
    InnoDB
    CHECK
    ALGORITHM
    MDEV-16331
    LOCK
    ALTER TABLE ... DROP CONSTRAINT
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... FORCE
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... ENGINE=InnoDB
    InnoDB
    ALGORITHM
    innodb_defragment
    innodb_optimize_fulltext_only
    OPTIMIZE TABLE
    InnoDB
    ALGORITHM
    LOCK
    ALTER TABLE ... RENAME TO
    RENAME TABLE
    InnoDB
    FULLTEXT
    ALTER TABLE
    ALGORITHM
    FULLTEXT
    ALTER TABLE
    LOCK
    SPATIAL
    ALTER TABLE
    LOCK
    Generated columns
    Generated (Virtual and Persistent/Stored) Columns: Statement Support
    ALGORITHM
    ALGORITHM

    Troubleshooting Row Size Too Large Errors with InnoDB

    Diagnose and fix 'Row size too large' errors in InnoDB, usually caused by exceeding the maximum row size, by changing row formats to DYNAMIC or adjusting column data types.

    With InnoDB, users can see the following message as an error or warning:

    And they can also see the following message as an error or warning in the :

    These messages indicate that the table's definition allows rows that the table's InnoDB row format can't actually store.

    These messages are raised in the following cases:

    • If is enabled and if a statement is executed that touches the table, such as or , then InnoDB will raise an error with this message

    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD COLUMN c VARCHAR(50);
    Query OK, 0 rows affected (0.006 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab DROP COLUMN c;
    Query OK, 0 rows affected (0.021 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) AFTER a;
    Query OK, 0 rows affected (0.022 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c INT;
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(100);
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(255)
    ) CHARACTER SET=latin1;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(256);
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50) NOT NULL
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) NULL;
    Query OK, 0 rows affected (0.021 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) NOT NULL;
    Query OK, 0 rows affected (0.021 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c ENUM('red', 'green')
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c ENUM('red', 'green', 'blue');
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c ENUM('red', 'green')
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c ENUM('red', 'blue', 'green');
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c SET('red', 'green')
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c SET('red', 'green', 'blue');
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c SET('red', 'green')
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c SET('red', 'blue', 'green');
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50) WITH SYSTEM VERSIONING
    );
    
    SET SESSION system_versioning_alter_history='KEEP';
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab MODIFY COLUMN c VARCHAR(50) WITHOUT SYSTEM VERSIONING;
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ALTER COLUMN c SET DEFAULT 'NO value explicitly provided.';
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50) DEFAULT 'NO value explicitly provided.'
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ALTER COLUMN c DROP DEFAULT;
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab CHANGE COLUMN c str VARCHAR(50);
    Query OK, 0 rows affected (0.006 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab CHANGE COLUMN c num INT;
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION sql_mode='STRICT_TRANS_TABLES';
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD PRIMARY KEY (a);
    Query OK, 0 rows affected (0.021 sec)
    CREATE OR REPLACE TABLE tab (
       a INT,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    INSERT INTO tab VALUES (NULL, NULL, NULL);
    
    SET SESSION sql_mode='STRICT_TRANS_TABLES';
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD PRIMARY KEY (a);
    ERROR 1265 (01000): Data truncated for column 'a' at row 1
    CREATE OR REPLACE TABLE tab (
       a INT,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    INSERT INTO tab VALUES (1, NULL, NULL);
    INSERT INTO tab VALUES (1, NULL, NULL);
    
    SET SESSION sql_mode='STRICT_TRANS_TABLES';
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD PRIMARY KEY (a);
    ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab DROP PRIMARY KEY;
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION sql_mode='STRICT_TRANS_TABLES';
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab DROP PRIMARY KEY, ADD PRIMARY KEY (b);
    Query OK, 0 rows affected (0.020 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD INDEX b_index (b);
    Query OK, 0 rows affected (0.010 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    CREATE INDEX b_index ON tab (b);
    Query OK, 0 rows affected (0.011 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.055 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    CREATE FULLTEXT INDEX b_index ON tab (b);
    Query OK, 0 rows affected (0.041 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.043 sec)
    
    ALTER TABLE tab ADD FULLTEXT INDEX c_index (c);
    Query OK, 0 rows affected (0.017 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.041 sec)
    
    ALTER TABLE tab ADD FULLTEXT INDEX c_index (c), ADD FULLTEXT INDEX d_index (d);
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD FULLTEXT INDEX b_index (b);
    Query OK, 0 rows affected (0.040 sec)
    
    ALTER TABLE tab ADD FULLTEXT INDEX c_index (c);
    Query OK, 0 rows affected (0.015 sec)
    
    ALTER TABLE tab FORCE;
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c GEOMETRY NOT NULL
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ADD SPATIAL INDEX c_index (c);
    Query OK, 0 rows affected (0.006 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c GEOMETRY NOT NULL
    );
    
    SET SESSION alter_algorithm='INPLACE';
    CREATE SPATIAL INDEX c_index ON tab (c);
    Query OK, 0 rows affected (0.006 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       INDEX b_index (b)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab DROP INDEX b_index;
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       INDEX b_index (b)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    DROP INDEX b_index ON tab;
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT
    );
    
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab1 ADD FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a);
    ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT
    );
    
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    SET SESSION foreign_key_checks=OFF;
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab1 ADD FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a);
    Query OK, 0 rows affected (0.011 sec)
    CREATE OR REPLACE TABLE tab2 (
       a INT PRIMARY KEY,
       b VARCHAR(50)
    );
    
    CREATE OR REPLACE TABLE tab1 (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       d INT,
       FOREIGN KEY tab2_fk (d) REFERENCES tab2 (a)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab1 DROP FOREIGN KEY tab2_fk;
    Query OK, 0 rows affected (0.005 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab AUTO_INCREMENT=100;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=DYNAMIC;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ROW_FORMAT=COMPRESSED;
    Query OK, 0 rows affected (0.025 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) ROW_FORMAT=COMPRESSED
      KEY_BLOCK_SIZE=4;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab KEY_BLOCK_SIZE=2;
    Query OK, 0 rows affected (0.021 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab PAGE_COMPRESSED=1;
    Query OK, 0 rows affected (0.006 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) PAGE_COMPRESSED=1;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab PAGE_COMPRESSED=0;
    Query OK, 0 rows affected (0.020 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) PAGE_COMPRESSED=1
      PAGE_COMPRESSION_LEVEL=5;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab PAGE_COMPRESSION_LEVEL=4;
    Query OK, 0 rows affected (0.006 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    ) WITH SYSTEM VERSIONING;
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab DROP SYSTEM VERSIONING;
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50),
       CONSTRAINT b_not_empty CHECK (b != '')
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab DROP CONSTRAINT b_not_empty;
    Query OK, 0 rows affected (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab FORCE;
    Query OK, 0 rows affected (0.022 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab ENGINE=InnoDB;
    Query OK, 0 rows affected (0.022 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SHOW GLOBAL VARIABLES WHERE Variable_name IN('innodb_defragment', 'innodb_optimize_fulltext_only');
    +-------------------------------+-------+
    | Variable_name                 | Value |
    +-------------------------------+-------+
    | innodb_defragment             | OFF   |
    | innodb_optimize_fulltext_only | OFF   |
    +-------------------------------+-------+
    
    SET SESSION alter_algorithm='INPLACE';
    OPTIMIZE TABLE tab;
    +---------+----------+----------+-------------------------------------------------------------------+
    | Table   | Op       | Msg_type | Msg_text                                                          |
    +---------+----------+----------+-------------------------------------------------------------------+
    | db1.tab | optimize | note     | Table does not support optimize, doing recreate + analyze instead |
    | db1.tab | optimize | status   | OK                                                                |
    +---------+----------+----------+-------------------------------------------------------------------+
    2 rows in set (0.026 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET GLOBAL innodb_defragment=ON;
    SHOW GLOBAL VARIABLES WHERE Variable_name IN('innodb_defragment', 'innodb_optimize_fulltext_only');
    +-------------------------------+-------+
    | Variable_name                 | Value |
    +-------------------------------+-------+
    | innodb_defragment             | ON    |
    | innodb_optimize_fulltext_only | OFF   |
    +-------------------------------+-------+
    
    SET SESSION alter_algorithm='INPLACE';
    OPTIMIZE TABLE tab;
    +---------+----------+----------+----------+
    | Table   | Op       | Msg_type | Msg_text |
    +---------+----------+----------+----------+
    | db1.tab | optimize | status   | OK       |
    +---------+----------+----------+----------+
    1 row in set (0.004 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    ALTER TABLE tab RENAME TO old_tab;
    Query OK, 0 rows affected (0.011 sec)
    CREATE OR REPLACE TABLE tab (
       a INT PRIMARY KEY,
       b VARCHAR(50),
       c VARCHAR(50)
    );
    
    SET SESSION alter_algorithm='INPLACE';
    RENAME TABLE tab TO old_tab;
    If InnoDB strict mode is disabled and if a DDL statement is executed that touches the table, such as CREATE TABLE or ALTER TABLE, then InnoDB will raise a warning with this message.
  • Regardless of whether InnoDB strict mode is enabled, if a DML statement is executed that attempts to write a row that the table's InnoDB row format can't store, then InnoDB will raise an error with this message.

  • Example of the Problem

    Here is an example of the problem:

    Root Cause of the Problem

    The root cause is that InnoDB has a maximum row size that is roughly equivalent to half of the value of the innodb_page_size system variable. See InnoDB Row Formats Overview: Maximum Row Size for more information.

    InnoDB's row formats work around this limit by storing certain kinds of variable-length columns on overflow pages. However, different row formats can store different types of data on overflow pages. Some row formats can store more data in overflow pages than others. For example, the DYNAMIC and COMPRESSED row formats can store the most data in overflow pages. To learn how the various InnoDB row formats use overflow pages, see the following pages:

    • InnoDB REDUNDANT Row Format: Overflow Pages with the REDUNDANT Row Format

    • InnoDB COMPACT Row Format: Overflow Pages with the COMPACT Row Format

    • InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format

    • InnoDB COMPRESSED Row Format: Overflow Pages with the COMPRESSED Row Format

    Checking Existing Tables for the Problem

    InnoDB does not currently have an easy way to check all existing tables to determine which tables have this problem. See MDEV-20400 for more information.

    One method to check a single existing table for this problem is to enable InnoDB strict mode, and then try to create a duplicate of the table with CREATE TABLE ... LIKE. If the table has this problem, then the operation will fail:

    Finding All Tables That Currently Have the Problem

    The following shell script will read through a MariaDB server to identify every table that has a row size definition that is too large for its row format and the server's page size. It runs on most common distributions of Linux.

    To run the script, copy the code below to a shell-script named rowsize.sh, make it executable with the command chmod 755 ./rowsize.sh, and invoke it with the following parameters:

    When the script runs, it displays the name of the temporary database it creates, so that if the script is interrupted before cleaning up, the database can be easily identified and removed manually.

    As the script runs it will output one line reporting the database and tablename for each table it finds that has the oversize row problem. If it finds none, it will print the following message: "No tables with rows size too big found."

    In either case, the script prints one final line to announce when it's done: ./rowsize.sh done.

    Solving the Problem

    There are several potential solutions available to solve this problem.

    Converting the Table to the DYNAMIC Row Format

    If the table is using either the REDUNDANT or the COMPACT row format, then one potential solution to this problem is to convert the table to use the DYNAMIC row format instead.

    If your tables were originally created on an older version of MariaDB or MySQL, then your table may be using one of InnoDB's older row formats:

    • In and before, and in MySQL 5.6 and before, the COMPACT row format was the default row format.

    • In MySQL 4.1 and before, the REDUNDANT row format was the default row format.

    The DYNAMIC row format can store more data on overflow pages than these older row formats, so this row format may actually be able to store the table's data safely. See InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format for more information.

    Therefore, a potential solution to the Row size too large error is to convert the table to use the DYNAMIC row format:

    You can use the INNODB_SYS_TABLES table in the information_schema database to find all tables that use the REDUNDANT or the COMPACT row formats. This is helpful if you would like to convert all of your tables that you still use the older row formats to the DYNAMIC row format. For example, the following query can find those tables, while excluding InnoDB's internal system tables:

    In and later, the DYNAMIC row format is the default row format. If your tables were originally created on one of these newer versions, then they may already be using this row format. In that case, you may need to try the next solution.

    Fitting More Columns on Overflow Pages

    If the table is already using the DYNAMIC row format, then another potential solution to this problem is to change the table schema, so that the row format can store more columns on overflow pages.

    In order for InnoDB to store some variable-length columns on overflow pages, the length of those columns may need to be increased.

    Therefore, a counter-intuitive solution to the Row size too large error in a lot of cases is actually to increase the length of some variable-length columns, so that InnoDB's row format can store them on overflow pages.

    Some possible ways to change the table schema are listed below.

    Converting Some Columns to BLOB or TEXT

    For BLOB and TEXT columns, the DYNAMIC row format can store these columns on overflow pages. See InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format for more information.

    Therefore, a potential solution to the Row size too large error is to convert some columns to the BLOB or TEXT data types.

    Increasing the Length of VARBINARY Columns

    For VARBINARY columns, the DYNAMIC row format can only store these columns on overflow pages if the maximum length of the column is 256 bytes or longer. See InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format for more information.

    Therefore, a potential solution to the Row size too large error is to ensure that all VARBINARY columns are at least as long as varbinary(256).

    Increasing the Length of VARCHAR Columns

    For VARCHAR columns, the DYNAMIC row format can only store these columns on overflow pages if the maximum length of the column is 256 bytes or longer. See InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format for more information.

    The original table schema shown earlier on this page causes the Row size too large error, because all of the table's VARCHAR columns are smaller than 256 bytes, which means that they have to be stored on the row's main data page.

    Therefore, a potential solution to the Row size too large error is to ensure that all VARCHAR columns are at least as long as 256 bytes. The number of characters required to reach the 256 byte limit depends on the character set used by the column.

    For example, when using InnoDB's DYNAMIC row format and a default character set of latin1 (which requires up to 1 byte per character), the 256 byte limit means that a VARCHAR column will only be stored on overflow pages if it is at least as large as a varchar(256):

    And when using InnoDB's DYNAMIC row format and a default character set of utf8 (which requires up to 3 bytes per character), the 256 byte limit means that a VARCHAR column will only be stored on overflow pages if it is at least as large as a varchar(86):

    And when using InnoDB's DYNAMIC row format and a default character set of utf8mb4 (which requires up to 4 bytes per character), the 256 byte limit means that a VARCHAR column will only be stored on overflow pages if it is at least as large as a varchar(64):

    Working Around the Problem

    There are a few ways to work around this problem.

    If you would like a solution for the problem instead of just working around it, then see the solutions mentioned in the previous section.

    Refactoring the Table into Multiple Tables

    A safe workaround is to refactor the single wide table, so that its columns are spread among multiple tables.

    This workaround can even work if your table is so wide that the previous solutions have failed to solve them problem for your table.

    Refactoring Some Columns into JSON

    A safe workaround is to refactor some of the columns into a JSON document.

    The JSON document can be queried and manipulated using MariaDB's JSON functions.

    The JSON document can be stored in a column that uses one of the following data types:

    • TEXT: The maximum size of a TEXT column is 64 KB.

    • MEDIUMTEXT: The maximum size of a MEDIUMTEXT column is 16 MB.

    • LONGTEXT: The maximum size of a LONGTEXT column is 4 GB.

    • JSON: This is just an alias for the LONGTEXT data type.

    This workaround can even work if your table is so wide that the previous solutions have failed to solve them problem for your table.

    Disabling InnoDB Strict Mode

    An unsafe workaround is to disable InnoDB strict mode. InnoDB strict mode can be disabled by setting the innodb_strict_mode system variable to OFF.

    For example, even though the following table schema is too large for most InnoDB row formats to store, it can still be created when InnoDB strict mode is disabled:

    But as mentioned above, if InnoDB strict mode is disabled and if a DDL statement is executed, then InnoDB will still raise a warning with this message. The SHOW WARNINGS statement can be used to view the warning:

    As mentioned above, even though InnoDB is allowing the table to be created, there is still an opportunity for errors. Regardless of whether InnoDB strict mode is enabled, if a DML statement is executed that attempts to write a row that the table's InnoDB row format can't store, then InnoDB will raise an error with this message. This creates a somewhat unsafe situation, because it means that the application has the chance to encounter an additional error while executing DML.

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

    error log
    InnoDB strict mode
    DDL
    CREATE TABLE
    ALTER TABLE
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored 
    inline.
    [Warning] InnoDB: Cannot add field col in table db1.tab because after adding it, 
    the row size is 8478 which is greater than maximum allowed size (8126) for a 
    record on index leaf page.
    SET GLOBAL innodb_default_row_format='dynamic';
    
    SET SESSION innodb_strict_mode=ON;
    
    CREATE OR REPLACE TABLE tab (
       col1 VARCHAR(40) NOT NULL,
       col2 VARCHAR(40) NOT NULL,
       col3 VARCHAR(40) NOT NULL,
       col4 VARCHAR(40) NOT NULL,
       col5 VARCHAR(40) NOT NULL,
       col6 VARCHAR(40) NOT NULL,
       col7 VARCHAR(40) NOT NULL,
       col8 VARCHAR(40) NOT NULL,
       col9 VARCHAR(40) NOT NULL,
       col10 VARCHAR(40) NOT NULL,
       col11 VARCHAR(40) NOT NULL,
       col12 VARCHAR(40) NOT NULL,
       col13 VARCHAR(40) NOT NULL,
       col14 VARCHAR(40) NOT NULL,
       col15 VARCHAR(40) NOT NULL,
       col16 VARCHAR(40) NOT NULL,
       col17 VARCHAR(40) NOT NULL,
       col18 VARCHAR(40) NOT NULL,
       col19 VARCHAR(40) NOT NULL,
       col20 VARCHAR(40) NOT NULL,
       col21 VARCHAR(40) NOT NULL,
       col22 VARCHAR(40) NOT NULL,
       col23 VARCHAR(40) NOT NULL,
       col24 VARCHAR(40) NOT NULL,
       col25 VARCHAR(40) NOT NULL,
       col26 VARCHAR(40) NOT NULL,
       col27 VARCHAR(40) NOT NULL,
       col28 VARCHAR(40) NOT NULL,
       col29 VARCHAR(40) NOT NULL,
       col30 VARCHAR(40) NOT NULL,
       col31 VARCHAR(40) NOT NULL,
       col32 VARCHAR(40) NOT NULL,
       col33 VARCHAR(40) NOT NULL,
       col34 VARCHAR(40) NOT NULL,
       col35 VARCHAR(40) NOT NULL,
       col36 VARCHAR(40) NOT NULL,
       col37 VARCHAR(40) NOT NULL,
       col38 VARCHAR(40) NOT NULL,
       col39 VARCHAR(40) NOT NULL,
       col40 VARCHAR(40) NOT NULL,
       col41 VARCHAR(40) NOT NULL,
       col42 VARCHAR(40) NOT NULL,
       col43 VARCHAR(40) NOT NULL,
       col44 VARCHAR(40) NOT NULL,
       col45 VARCHAR(40) NOT NULL,
       col46 VARCHAR(40) NOT NULL,
       col47 VARCHAR(40) NOT NULL,
       col48 VARCHAR(40) NOT NULL,
       col49 VARCHAR(40) NOT NULL,
       col50 VARCHAR(40) NOT NULL,
       col51 VARCHAR(40) NOT NULL,
       col52 VARCHAR(40) NOT NULL,
       col53 VARCHAR(40) NOT NULL,
       col54 VARCHAR(40) NOT NULL,
       col55 VARCHAR(40) NOT NULL,
       col56 VARCHAR(40) NOT NULL,
       col57 VARCHAR(40) NOT NULL,
       col58 VARCHAR(40) NOT NULL,
       col59 VARCHAR(40) NOT NULL,
       col60 VARCHAR(40) NOT NULL,
       col61 VARCHAR(40) NOT NULL,
       col62 VARCHAR(40) NOT NULL,
       col63 VARCHAR(40) NOT NULL,
       col64 VARCHAR(40) NOT NULL,
       col65 VARCHAR(40) NOT NULL,
       col66 VARCHAR(40) NOT NULL,
       col67 VARCHAR(40) NOT NULL,
       col68 VARCHAR(40) NOT NULL,
       col69 VARCHAR(40) NOT NULL,
       col70 VARCHAR(40) NOT NULL,
       col71 VARCHAR(40) NOT NULL,
       col72 VARCHAR(40) NOT NULL,
       col73 VARCHAR(40) NOT NULL,
       col74 VARCHAR(40) NOT NULL,
       col75 VARCHAR(40) NOT NULL,
       col76 VARCHAR(40) NOT NULL,
       col77 VARCHAR(40) NOT NULL,
       col78 VARCHAR(40) NOT NULL,
       col79 VARCHAR(40) NOT NULL,
       col80 VARCHAR(40) NOT NULL,
       col81 VARCHAR(40) NOT NULL,
       col82 VARCHAR(40) NOT NULL,
       col83 VARCHAR(40) NOT NULL,
       col84 VARCHAR(40) NOT NULL,
       col85 VARCHAR(40) NOT NULL,
       col86 VARCHAR(40) NOT NULL,
       col87 VARCHAR(40) NOT NULL,
       col88 VARCHAR(40) NOT NULL,
       col89 VARCHAR(40) NOT NULL,
       col90 VARCHAR(40) NOT NULL,
       col91 VARCHAR(40) NOT NULL,
       col92 VARCHAR(40) NOT NULL,
       col93 VARCHAR(40) NOT NULL,
       col94 VARCHAR(40) NOT NULL,
       col95 VARCHAR(40) NOT NULL,
       col96 VARCHAR(40) NOT NULL,
       col97 VARCHAR(40) NOT NULL,
       col98 VARCHAR(40) NOT NULL,
       col99 VARCHAR(40) NOT NULL,
       col100 VARCHAR(40) NOT NULL,
       col101 VARCHAR(40) NOT NULL,
       col102 VARCHAR(40) NOT NULL,
       col103 VARCHAR(40) NOT NULL,
       col104 VARCHAR(40) NOT NULL,
       col105 VARCHAR(40) NOT NULL,
       col106 VARCHAR(40) NOT NULL,
       col107 VARCHAR(40) NOT NULL,
       col108 VARCHAR(40) NOT NULL,
       col109 VARCHAR(40) NOT NULL,
       col110 VARCHAR(40) NOT NULL,
       col111 VARCHAR(40) NOT NULL,
       col112 VARCHAR(40) NOT NULL,
       col113 VARCHAR(40) NOT NULL,
       col114 VARCHAR(40) NOT NULL,
       col115 VARCHAR(40) NOT NULL,
       col116 VARCHAR(40) NOT NULL,
       col117 VARCHAR(40) NOT NULL,
       col118 VARCHAR(40) NOT NULL,
       col119 VARCHAR(40) NOT NULL,
       col120 VARCHAR(40) NOT NULL,
       col121 VARCHAR(40) NOT NULL,
       col122 VARCHAR(40) NOT NULL,
       col123 VARCHAR(40) NOT NULL,
       col124 VARCHAR(40) NOT NULL,
       col125 VARCHAR(40) NOT NULL,
       col126 VARCHAR(40) NOT NULL,
       col127 VARCHAR(40) NOT NULL,
       col128 VARCHAR(40) NOT NULL,
       col129 VARCHAR(40) NOT NULL,
       col130 VARCHAR(40) NOT NULL,
       col131 VARCHAR(40) NOT NULL,
       col132 VARCHAR(40) NOT NULL,
       col133 VARCHAR(40) NOT NULL,
       col134 VARCHAR(40) NOT NULL,
       col135 VARCHAR(40) NOT NULL,
       col136 VARCHAR(40) NOT NULL,
       col137 VARCHAR(40) NOT NULL,
       col138 VARCHAR(40) NOT NULL,
       col139 VARCHAR(40) NOT NULL,
       col140 VARCHAR(40) NOT NULL,
       col141 VARCHAR(40) NOT NULL,
       col142 VARCHAR(40) NOT NULL,
       col143 VARCHAR(40) NOT NULL,
       col144 VARCHAR(40) NOT NULL,
       col145 VARCHAR(40) NOT NULL,
       col146 VARCHAR(40) NOT NULL,
       col147 VARCHAR(40) NOT NULL,
       col148 VARCHAR(40) NOT NULL,
       col149 VARCHAR(40) NOT NULL,
       col150 VARCHAR(40) NOT NULL,
       col151 VARCHAR(40) NOT NULL,
       col152 VARCHAR(40) NOT NULL,
       col153 VARCHAR(40) NOT NULL,
       col154 VARCHAR(40) NOT NULL,
       col155 VARCHAR(40) NOT NULL,
       col156 VARCHAR(40) NOT NULL,
       col157 VARCHAR(40) NOT NULL,
       col158 VARCHAR(40) NOT NULL,
       col159 VARCHAR(40) NOT NULL,
       col160 VARCHAR(40) NOT NULL,
       col161 VARCHAR(40) NOT NULL,
       col162 VARCHAR(40) NOT NULL,
       col163 VARCHAR(40) NOT NULL,
       col164 VARCHAR(40) NOT NULL,
       col165 VARCHAR(40) NOT NULL,
       col166 VARCHAR(40) NOT NULL,
       col167 VARCHAR(40) NOT NULL,
       col168 VARCHAR(40) NOT NULL,
       col169 VARCHAR(40) NOT NULL,
       col170 VARCHAR(40) NOT NULL,
       col171 VARCHAR(40) NOT NULL,
       col172 VARCHAR(40) NOT NULL,
       col173 VARCHAR(40) NOT NULL,
       col174 VARCHAR(40) NOT NULL,
       col175 VARCHAR(40) NOT NULL,
       col176 VARCHAR(40) NOT NULL,
       col177 VARCHAR(40) NOT NULL,
       col178 VARCHAR(40) NOT NULL,
       col179 VARCHAR(40) NOT NULL,
       col180 VARCHAR(40) NOT NULL,
       col181 VARCHAR(40) NOT NULL,
       col182 VARCHAR(40) NOT NULL,
       col183 VARCHAR(40) NOT NULL,
       col184 VARCHAR(40) NOT NULL,
       col185 VARCHAR(40) NOT NULL,
       col186 VARCHAR(40) NOT NULL,
       col187 VARCHAR(40) NOT NULL,
       col188 VARCHAR(40) NOT NULL,
       col189 VARCHAR(40) NOT NULL,
       col190 VARCHAR(40) NOT NULL,
       col191 VARCHAR(40) NOT NULL,
       col192 VARCHAR(40) NOT NULL,
       col193 VARCHAR(40) NOT NULL,
       col194 VARCHAR(40) NOT NULL,
       col195 VARCHAR(40) NOT NULL,
       col196 VARCHAR(40) NOT NULL,
       col197 VARCHAR(40) NOT NULL,
       col198 VARCHAR(40) NOT NULL,
       PRIMARY KEY (col1)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
    SET SESSION innodb_strict_mode=ON;
    
    CREATE TABLE tab_dup LIKE tab;
    ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
    TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
    ./rowsize.sh host user password
    #!/bin/bash
    
    [ -z "$3" ] && echo "Usage: $0 host user password" >&2 && exit 1
    
    dt="tmp_$RANDOM$RANDOM"
    
    mysql -h $1 -u $2 -p$3 -ABNe "create database $dt;"
    [ $? -ne 0 ] && echo "Error: $0 terminating" >&2 exit 1
    
    echo
    echo "Created temporary database ${dt} on host $1"
    echo
    
    c=0
    for d in $(mysql -h $1 -u $2 -p$3 -ABNe "show databases;" | egrep -iv "information_schema|mysql|performance_schema|$dt")
    do
    	for t in $(mysql -h $1 -u $2 -p$3 -ABNe "show tables;" $d)
    	do
    		tc=$(mysql -h $1 -u $2 -p$3 -ABNe "show create table $t\\G" $d | egrep -iv "^\*|^$t")
    		
    		echo $tc | grep -iq "ROW_FORMAT"
    		if [ $? -ne 0 ]
    		then
    			tf=$(mysql -h $1 -u $2 -p$3 -ABNe "select row_format from information_schema.innodb_sys_tables where name = '${d}/${t}';")
    			tc="$tc ROW_FORMAT=$tf"
    		fi
    		
    		ef="/tmp/e$RANDOM$RANDOM"
    		mysql -h $1 -u $2 -p$3 -ABNe "set innodb_strict_mode=1; set foreign_key_checks=0; ${tc};" $dt >/dev/null  2>$ef
    		[ $? -ne 0 ] && cat $ef | grep -q "Row size too large" && echo "${d}.${t}" && let c++ || mysql -h $1 -u $2 -p$3 -ABNe "drop table if exists ${t};" $dt
    		rm -f $ef
    	done
    done
    mysql -h $1 -u $2 -p$3 -ABNe "set innodb_strict_mode=1; drop database $dt;"
    [ $c -eq 0 ] && echo "No tables with rows size too large found." || echo && echo "$c tables found with row size too large."
    echo
    echo "$0 done."
    ALTER TABLE tab ROW_FORMAT=DYNAMIC;
    SELECT NAME, ROW_FORMAT
    FROM information_schema.INNODB_SYS_TABLES
    WHERE ROW_FORMAT IN('Redundant', 'Compact')
    AND NAME NOT IN('SYS_DATAFILES', 'SYS_FOREIGN', 'SYS_FOREIGN_COLS', 'SYS_TABLESPACES', 'SYS_VIRTUAL', 'SYS_ZIP_DICT', 'SYS_ZIP_DICT_COLS');
    SET GLOBAL innodb_default_row_format='dynamic';
    SET SESSION innodb_strict_mode=ON;
    CREATE OR REPLACE TABLE tab (
       col1 VARCHAR(256) NOT NULL,
       col2 VARCHAR(256) NOT NULL,
       col3 VARCHAR(256) NOT NULL,
       col4 VARCHAR(256) NOT NULL,
       col5 VARCHAR(256) NOT NULL,
       col6 VARCHAR(256) NOT NULL,
       col7 VARCHAR(256) NOT NULL,
       col8 VARCHAR(256) NOT NULL,
       col9 VARCHAR(256) NOT NULL,
       col10 VARCHAR(256) NOT NULL,
       col11 VARCHAR(256) NOT NULL,
       col12 VARCHAR(256) NOT NULL,
       col13 VARCHAR(256) NOT NULL,
       col14 VARCHAR(256) NOT NULL,
       col15 VARCHAR(256) NOT NULL,
       col16 VARCHAR(256) NOT NULL,
       col17 VARCHAR(256) NOT NULL,
       col18 VARCHAR(256) NOT NULL,
       col19 VARCHAR(256) NOT NULL,
       col20 VARCHAR(256) NOT NULL,
       col21 VARCHAR(256) NOT NULL,
       col22 VARCHAR(256) NOT NULL,
       col23 VARCHAR(256) NOT NULL,
       col24 VARCHAR(256) NOT NULL,
       col25 VARCHAR(256) NOT NULL,
       col26 VARCHAR(256) NOT NULL,
       col27 VARCHAR(256) NOT NULL,
       col28 VARCHAR(256) NOT NULL,
       col29 VARCHAR(256) NOT NULL,
       col30 VARCHAR(256) NOT NULL,
       col31 VARCHAR(256) NOT NULL,
       col32 VARCHAR(256) NOT NULL,
       col33 VARCHAR(256) NOT NULL,
       col34 VARCHAR(256) NOT NULL,
       col35 VARCHAR(256) NOT NULL,
       col36 VARCHAR(256) NOT NULL,
       col37 VARCHAR(256) NOT NULL,
       col38 VARCHAR(256) NOT NULL,
       col39 VARCHAR(256) NOT NULL,
       col40 VARCHAR(256) NOT NULL,
       col41 VARCHAR(256) NOT NULL,
       col42 VARCHAR(256) NOT NULL,
       col43 VARCHAR(256) NOT NULL,
       col44 VARCHAR(256) NOT NULL,
       col45 VARCHAR(256) NOT NULL,
       col46 VARCHAR(256) NOT NULL,
       col47 VARCHAR(256) NOT NULL,
       col48 VARCHAR(256) NOT NULL,
       col49 VARCHAR(256) NOT NULL,
       col50 VARCHAR(256) NOT NULL,
       col51 VARCHAR(256) NOT NULL,
       col52 VARCHAR(256) NOT NULL,
       col53 VARCHAR(256) NOT NULL,
       col54 VARCHAR(256) NOT NULL,
       col55 VARCHAR(256) NOT NULL,
       col56 VARCHAR(256) NOT NULL,
       col57 VARCHAR(256) NOT NULL,
       col58 VARCHAR(256) NOT NULL,
       col59 VARCHAR(256) NOT NULL,
       col60 VARCHAR(256) NOT NULL,
       col61 VARCHAR(256) NOT NULL,
       col62 VARCHAR(256) NOT NULL,
       col63 VARCHAR(256) NOT NULL,
       col64 VARCHAR(256) NOT NULL,
       col65 VARCHAR(256) NOT NULL,
       col66 VARCHAR(256) NOT NULL,
       col67 VARCHAR(256) NOT NULL,
       col68 VARCHAR(256) NOT NULL,
       col69 VARCHAR(256) NOT NULL,
       col70 VARCHAR(256) NOT NULL,
       col71 VARCHAR(256) NOT NULL,
       col72 VARCHAR(256) NOT NULL,
       col73 VARCHAR(256) NOT NULL,
       col74 VARCHAR(256) NOT NULL,
       col75 VARCHAR(256) NOT NULL,
       col76 VARCHAR(256) NOT NULL,
       col77 VARCHAR(256) NOT NULL,
       col78 VARCHAR(256) NOT NULL,
       col79 VARCHAR(256) NOT NULL,
       col80 VARCHAR(256) NOT NULL,
       col81 VARCHAR(256) NOT NULL,
       col82 VARCHAR(256) NOT NULL,
       col83 VARCHAR(256) NOT NULL,
       col84 VARCHAR(256) NOT NULL,
       col85 VARCHAR(256) NOT NULL,
       col86 VARCHAR(256) NOT NULL,
       col87 VARCHAR(256) NOT NULL,
       col88 VARCHAR(256) NOT NULL,
       col89 VARCHAR(256) NOT NULL,
       col90 VARCHAR(256) NOT NULL,
       col91 VARCHAR(256) NOT NULL,
       col92 VARCHAR(256) NOT NULL,
       col93 VARCHAR(256) NOT NULL,
       col94 VARCHAR(256) NOT NULL,
       col95 VARCHAR(256) NOT NULL,
       col96 VARCHAR(256) NOT NULL,
       col97 VARCHAR(256) NOT NULL,
       col98 VARCHAR(256) NOT NULL,
       col99 VARCHAR(256) NOT NULL,
       col100 VARCHAR(256) NOT NULL,
       col101 VARCHAR(256) NOT NULL,
       col102 VARCHAR(256) NOT NULL,
       col103 VARCHAR(256) NOT NULL,
       col104 VARCHAR(256) NOT NULL,
       col105 VARCHAR(256) NOT NULL,
       col106 VARCHAR(256) NOT NULL,
       col107 VARCHAR(256) NOT NULL,
       col108 VARCHAR(256) NOT NULL,
       col109 VARCHAR(256) NOT NULL,
       col110 VARCHAR(256) NOT NULL,
       col111 VARCHAR(256) NOT NULL,
       col112 VARCHAR(256) NOT NULL,
       col113 VARCHAR(256) NOT NULL,
       col114 VARCHAR(256) NOT NULL,
       col115 VARCHAR(256) NOT NULL,
       col116 VARCHAR(256) NOT NULL,
       col117 VARCHAR(256) NOT NULL,
       col118 VARCHAR(256) NOT NULL,
       col119 VARCHAR(256) NOT NULL,
       col120 VARCHAR(256) NOT NULL,
       col121 VARCHAR(256) NOT NULL,
       col122 VARCHAR(256) NOT NULL,
       col123 VARCHAR(256) NOT NULL,
       col124 VARCHAR(256) NOT NULL,
       col125 VARCHAR(256) NOT NULL,
       col126 VARCHAR(256) NOT NULL,
       col127 VARCHAR(256) NOT NULL,
       col128 VARCHAR(256) NOT NULL,
       col129 VARCHAR(256) NOT NULL,
       col130 VARCHAR(256) NOT NULL,
       col131 VARCHAR(256) NOT NULL,
       col132 VARCHAR(256) NOT NULL,
       col133 VARCHAR(256) NOT NULL,
       col134 VARCHAR(256) NOT NULL,
       col135 VARCHAR(256) NOT NULL,
       col136 VARCHAR(256) NOT NULL,
       col137 VARCHAR(256) NOT NULL,
       col138 VARCHAR(256) NOT NULL,
       col139 VARCHAR(256) NOT NULL,
       col140 VARCHAR(256) NOT NULL,
       col141 VARCHAR(256) NOT NULL,
       col142 VARCHAR(256) NOT NULL,
       col143 VARCHAR(256) NOT NULL,
       col144 VARCHAR(256) NOT NULL,
       col145 VARCHAR(256) NOT NULL,
       col146 VARCHAR(256) NOT NULL,
       col147 VARCHAR(256) NOT NULL,
       col148 VARCHAR(256) NOT NULL,
       col149 VARCHAR(256) NOT NULL,
       col150 VARCHAR(256) NOT NULL,
       col151 VARCHAR(256) NOT NULL,
       col152 VARCHAR(256) NOT NULL,
       col153 VARCHAR(256) NOT NULL,
       col154 VARCHAR(256) NOT NULL,
       col155 VARCHAR(256) NOT NULL,
       col156 VARCHAR(256) NOT NULL,
       col157 VARCHAR(256) NOT NULL,
       col158 VARCHAR(256) NOT NULL,
       col159 VARCHAR(256) NOT NULL,
       col160 VARCHAR(256) NOT NULL,
       col161 VARCHAR(256) NOT NULL,
       col162 VARCHAR(256) NOT NULL,
       col163 VARCHAR(256) NOT NULL,
       col164 VARCHAR(256) NOT NULL,
       col165 VARCHAR(256) NOT NULL,
       col166 VARCHAR(256) NOT NULL,
       col167 VARCHAR(256) NOT NULL,
       col168 VARCHAR(256) NOT NULL,
       col169 VARCHAR(256) NOT NULL,
       col170 VARCHAR(256) NOT NULL,
       col171 VARCHAR(256) NOT NULL,
       col172 VARCHAR(256) NOT NULL,
       col173 VARCHAR(256) NOT NULL,
       col174 VARCHAR(256) NOT NULL,
       col175 VARCHAR(256) NOT NULL,
       col176 VARCHAR(256) NOT NULL,
       col177 VARCHAR(256) NOT NULL,
       col178 VARCHAR(256) NOT NULL,
       col179 VARCHAR(256) NOT NULL,
       col180 VARCHAR(256) NOT NULL,
       col181 VARCHAR(256) NOT NULL,
       col182 VARCHAR(256) NOT NULL,
       col183 VARCHAR(256) NOT NULL,
       col184 VARCHAR(256) NOT NULL,
       col185 VARCHAR(256) NOT NULL,
       col186 VARCHAR(256) NOT NULL,
       col187 VARCHAR(256) NOT NULL,
       col188 VARCHAR(256) NOT NULL,
       col189 VARCHAR(256) NOT NULL,
       col190 VARCHAR(256) NOT NULL,
       col191 VARCHAR(256) NOT NULL,
       col192 VARCHAR(256) NOT NULL,
       col193 VARCHAR(256) NOT NULL,
       col194 VARCHAR(256) NOT NULL,
       col195 VARCHAR(256) NOT NULL,
       col196 VARCHAR(256) NOT NULL,
       col197 VARCHAR(256) NOT NULL,
       col198 VARCHAR(256) NOT NULL,
       PRIMARY KEY (col1)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    SET GLOBAL innodb_default_row_format='dynamic';
    SET SESSION innodb_strict_mode=ON;
    CREATE OR REPLACE TABLE tab (
       col1 VARCHAR(86) NOT NULL,
       col2 VARCHAR(86) NOT NULL,
       col3 VARCHAR(86) NOT NULL,
       col4 VARCHAR(86) NOT NULL,
       col5 VARCHAR(86) NOT NULL,
       col6 VARCHAR(86) NOT NULL,
       col7 VARCHAR(86) NOT NULL,
       col8 VARCHAR(86) NOT NULL,
       col9 VARCHAR(86) NOT NULL,
       col10 VARCHAR(86) NOT NULL,
       col11 VARCHAR(86) NOT NULL,
       col12 VARCHAR(86) NOT NULL,
       col13 VARCHAR(86) NOT NULL,
       col14 VARCHAR(86) NOT NULL,
       col15 VARCHAR(86) NOT NULL,
       col16 VARCHAR(86) NOT NULL,
       col17 VARCHAR(86) NOT NULL,
       col18 VARCHAR(86) NOT NULL,
       col19 VARCHAR(86) NOT NULL,
       col20 VARCHAR(86) NOT NULL,
       col21 VARCHAR(86) NOT NULL,
       col22 VARCHAR(86) NOT NULL,
       col23 VARCHAR(86) NOT NULL,
       col24 VARCHAR(86) NOT NULL,
       col25 VARCHAR(86) NOT NULL,
       col26 VARCHAR(86) NOT NULL,
       col27 VARCHAR(86) NOT NULL,
       col28 VARCHAR(86) NOT NULL,
       col29 VARCHAR(86) NOT NULL,
       col30 VARCHAR(86) NOT NULL,
       col31 VARCHAR(86) NOT NULL,
       col32 VARCHAR(86) NOT NULL,
       col33 VARCHAR(86) NOT NULL,
       col34 VARCHAR(86) NOT NULL,
       col35 VARCHAR(86) NOT NULL,
       col36 VARCHAR(86) NOT NULL,
       col37 VARCHAR(86) NOT NULL,
       col38 VARCHAR(86) NOT NULL,
       col39 VARCHAR(86) NOT NULL,
       col40 VARCHAR(86) NOT NULL,
       col41 VARCHAR(86) NOT NULL,
       col42 VARCHAR(86) NOT NULL,
       col43 VARCHAR(86) NOT NULL,
       col44 VARCHAR(86) NOT NULL,
       col45 VARCHAR(86) NOT NULL,
       col46 VARCHAR(86) NOT NULL,
       col47 VARCHAR(86) NOT NULL,
       col48 VARCHAR(86) NOT NULL,
       col49 VARCHAR(86) NOT NULL,
       col50 VARCHAR(86) NOT NULL,
       col51 VARCHAR(86) NOT NULL,
       col52 VARCHAR(86) NOT NULL,
       col53 VARCHAR(86) NOT NULL,
       col54 VARCHAR(86) NOT NULL,
       col55 VARCHAR(86) NOT NULL,
       col56 VARCHAR(86) NOT NULL,
       col57 VARCHAR(86) NOT NULL,
       col58 VARCHAR(86) NOT NULL,
       col59 VARCHAR(86) NOT NULL,
       col60 VARCHAR(86) NOT NULL,
       col61 VARCHAR(86) NOT NULL,
       col62 VARCHAR(86) NOT NULL,
       col63 VARCHAR(86) NOT NULL,
       col64 VARCHAR(86) NOT NULL,
       col65 VARCHAR(86) NOT NULL,
       col66 VARCHAR(86) NOT NULL,
       col67 VARCHAR(86) NOT NULL,
       col68 VARCHAR(86) NOT NULL,
       col69 VARCHAR(86) NOT NULL,
       col70 VARCHAR(86) NOT NULL,
       col71 VARCHAR(86) NOT NULL,
       col72 VARCHAR(86) NOT NULL,
       col73 VARCHAR(86) NOT NULL,
       col74 VARCHAR(86) NOT NULL,
       col75 VARCHAR(86) NOT NULL,
       col76 VARCHAR(86) NOT NULL,
       col77 VARCHAR(86) NOT NULL,
       col78 VARCHAR(86) NOT NULL,
       col79 VARCHAR(86) NOT NULL,
       col80 VARCHAR(86) NOT NULL,
       col81 VARCHAR(86) NOT NULL,
       col82 VARCHAR(86) NOT NULL,
       col83 VARCHAR(86) NOT NULL,
       col84 VARCHAR(86) NOT NULL,
       col85 VARCHAR(86) NOT NULL,
       col86 VARCHAR(86) NOT NULL,
       col87 VARCHAR(86) NOT NULL,
       col88 VARCHAR(86) NOT NULL,
       col89 VARCHAR(86) NOT NULL,
       col90 VARCHAR(86) NOT NULL,
       col91 VARCHAR(86) NOT NULL,
       col92 VARCHAR(86) NOT NULL,
       col93 VARCHAR(86) NOT NULL,
       col94 VARCHAR(86) NOT NULL,
       col95 VARCHAR(86) NOT NULL,
       col96 VARCHAR(86) NOT NULL,
       col97 VARCHAR(86) NOT NULL,
       col98 VARCHAR(86) NOT NULL,
       col99 VARCHAR(86) NOT NULL,
       col100 VARCHAR(86) NOT NULL,
       col101 VARCHAR(86) NOT NULL,
       col102 VARCHAR(86) NOT NULL,
       col103 VARCHAR(86) NOT NULL,
       col104 VARCHAR(86) NOT NULL,
       col105 VARCHAR(86) NOT NULL,
       col106 VARCHAR(86) NOT NULL,
       col107 VARCHAR(86) NOT NULL,
       col108 VARCHAR(86) NOT NULL,
       col109 VARCHAR(86) NOT NULL,
       col110 VARCHAR(86) NOT NULL,
       col111 VARCHAR(86) NOT NULL,
       col112 VARCHAR(86) NOT NULL,
       col113 VARCHAR(86) NOT NULL,
       col114 VARCHAR(86) NOT NULL,
       col115 VARCHAR(86) NOT NULL,
       col116 VARCHAR(86) NOT NULL,
       col117 VARCHAR(86) NOT NULL,
       col118 VARCHAR(86) NOT NULL,
       col119 VARCHAR(86) NOT NULL,
       col120 VARCHAR(86) NOT NULL,
       col121 VARCHAR(86) NOT NULL,
       col122 VARCHAR(86) NOT NULL,
       col123 VARCHAR(86) NOT NULL,
       col124 VARCHAR(86) NOT NULL,
       col125 VARCHAR(86) NOT NULL,
       col126 VARCHAR(86) NOT NULL,
       col127 VARCHAR(86) NOT NULL,
       col128 VARCHAR(86) NOT NULL,
       col129 VARCHAR(86) NOT NULL,
       col130 VARCHAR(86) NOT NULL,
       col131 VARCHAR(86) NOT NULL,
       col132 VARCHAR(86) NOT NULL,
       col133 VARCHAR(86) NOT NULL,
       col134 VARCHAR(86) NOT NULL,
       col135 VARCHAR(86) NOT NULL,
       col136 VARCHAR(86) NOT NULL,
       col137 VARCHAR(86) NOT NULL,
       col138 VARCHAR(86) NOT NULL,
       col139 VARCHAR(86) NOT NULL,
       col140 VARCHAR(86) NOT NULL,
       col141 VARCHAR(86) NOT NULL,
       col142 VARCHAR(86) NOT NULL,
       col143 VARCHAR(86) NOT NULL,
       col144 VARCHAR(86) NOT NULL,
       col145 VARCHAR(86) NOT NULL,
       col146 VARCHAR(86) NOT NULL,
       col147 VARCHAR(86) NOT NULL,
       col148 VARCHAR(86) NOT NULL,
       col149 VARCHAR(86) NOT NULL,
       col150 VARCHAR(86) NOT NULL,
       col151 VARCHAR(86) NOT NULL,
       col152 VARCHAR(86) NOT NULL,
       col153 VARCHAR(86) NOT NULL,
       col154 VARCHAR(86) NOT NULL,
       col155 VARCHAR(86) NOT NULL,
       col156 VARCHAR(86) NOT NULL,
       col157 VARCHAR(86) NOT NULL,
       col158 VARCHAR(86) NOT NULL,
       col159 VARCHAR(86) NOT NULL,
       col160 VARCHAR(86) NOT NULL,
       col161 VARCHAR(86) NOT NULL,
       col162 VARCHAR(86) NOT NULL,
       col163 VARCHAR(86) NOT NULL,
       col164 VARCHAR(86) NOT NULL,
       col165 VARCHAR(86) NOT NULL,
       col166 VARCHAR(86) NOT NULL,
       col167 VARCHAR(86) NOT NULL,
       col168 VARCHAR(86) NOT NULL,
       col169 VARCHAR(86) NOT NULL,
       col170 VARCHAR(86) NOT NULL,
       col171 VARCHAR(86) NOT NULL,
       col172 VARCHAR(86) NOT NULL,
       col173 VARCHAR(86) NOT NULL,
       col174 VARCHAR(86) NOT NULL,
       col175 VARCHAR(86) NOT NULL,
       col176 VARCHAR(86) NOT NULL,
       col177 VARCHAR(86) NOT NULL,
       col178 VARCHAR(86) NOT NULL,
       col179 VARCHAR(86) NOT NULL,
       col180 VARCHAR(86) NOT NULL,
       col181 VARCHAR(86) NOT NULL,
       col182 VARCHAR(86) NOT NULL,
       col183 VARCHAR(86) NOT NULL,
       col184 VARCHAR(86) NOT NULL,
       col185 VARCHAR(86) NOT NULL,
       col186 VARCHAR(86) NOT NULL,
       col187 VARCHAR(86) NOT NULL,
       col188 VARCHAR(86) NOT NULL,
       col189 VARCHAR(86) NOT NULL,
       col190 VARCHAR(86) NOT NULL,
       col191 VARCHAR(86) NOT NULL,
       col192 VARCHAR(86) NOT NULL,
       col193 VARCHAR(86) NOT NULL,
       col194 VARCHAR(86) NOT NULL,
       col195 VARCHAR(86) NOT NULL,
       col196 VARCHAR(86) NOT NULL,
       col197 VARCHAR(86) NOT NULL,
       col198 VARCHAR(86) NOT NULL,
       PRIMARY KEY (col1)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    SET GLOBAL innodb_default_row_format='dynamic';
    SET SESSION innodb_strict_mode=ON;
    CREATE OR REPLACE TABLE tab (
       col1 VARCHAR(64) NOT NULL,
       col2 VARCHAR(64) NOT NULL,
       col3 VARCHAR(64) NOT NULL,
       col4 VARCHAR(64) NOT NULL,
       col5 VARCHAR(64) NOT NULL,
       col6 VARCHAR(64) NOT NULL,
       col7 VARCHAR(64) NOT NULL,
       col8 VARCHAR(64) NOT NULL,
       col9 VARCHAR(64) NOT NULL,
       col10 VARCHAR(64) NOT NULL,
       col11 VARCHAR(64) NOT NULL,
       col12 VARCHAR(64) NOT NULL,
       col13 VARCHAR(64) NOT NULL,
       col14 VARCHAR(64) NOT NULL,
       col15 VARCHAR(64) NOT NULL,
       col16 VARCHAR(64) NOT NULL,
       col17 VARCHAR(64) NOT NULL,
       col18 VARCHAR(64) NOT NULL,
       col19 VARCHAR(64) NOT NULL,
       col20 VARCHAR(64) NOT NULL,
       col21 VARCHAR(64) NOT NULL,
       col22 VARCHAR(64) NOT NULL,
       col23 VARCHAR(64) NOT NULL,
       col24 VARCHAR(64) NOT NULL,
       col25 VARCHAR(64) NOT NULL,
       col26 VARCHAR(64) NOT NULL,
       col27 VARCHAR(64) NOT NULL,
       col28 VARCHAR(64) NOT NULL,
       col29 VARCHAR(64) NOT NULL,
       col30 VARCHAR(64) NOT NULL,
       col31 VARCHAR(64) NOT NULL,
       col32 VARCHAR(64) NOT NULL,
       col33 VARCHAR(64) NOT NULL,
       col34 VARCHAR(64) NOT NULL,
       col35 VARCHAR(64) NOT NULL,
       col36 VARCHAR(64) NOT NULL,
       col37 VARCHAR(64) NOT NULL,
       col38 VARCHAR(64) NOT NULL,
       col39 VARCHAR(64) NOT NULL,
       col40 VARCHAR(64) NOT NULL,
       col41 VARCHAR(64) NOT NULL,
       col42 VARCHAR(64) NOT NULL,
       col43 VARCHAR(64) NOT NULL,
       col44 VARCHAR(64) NOT NULL,
       col45 VARCHAR(64) NOT NULL,
       col46 VARCHAR(64) NOT NULL,
       col47 VARCHAR(64) NOT NULL,
       col48 VARCHAR(64) NOT NULL,
       col49 VARCHAR(64) NOT NULL,
       col50 VARCHAR(64) NOT NULL,
       col51 VARCHAR(64) NOT NULL,
       col52 VARCHAR(64) NOT NULL,
       col53 VARCHAR(64) NOT NULL,
       col54 VARCHAR(64) NOT NULL,
       col55 VARCHAR(64) NOT NULL,
       col56 VARCHAR(64) NOT NULL,
       col57 VARCHAR(64) NOT NULL,
       col58 VARCHAR(64) NOT NULL,
       col59 VARCHAR(64) NOT NULL,
       col60 VARCHAR(64) NOT NULL,
       col61 VARCHAR(64) NOT NULL,
       col62 VARCHAR(64) NOT NULL,
       col63 VARCHAR(64) NOT NULL,
       col64 VARCHAR(64) NOT NULL,
       col65 VARCHAR(64) NOT NULL,
       col66 VARCHAR(64) NOT NULL,
       col67 VARCHAR(64) NOT NULL,
       col68 VARCHAR(64) NOT NULL,
       col69 VARCHAR(64) NOT NULL,
       col70 VARCHAR(64) NOT NULL,
       col71 VARCHAR(64) NOT NULL,
       col72 VARCHAR(64) NOT NULL,
       col73 VARCHAR(64) NOT NULL,
       col74 VARCHAR(64) NOT NULL,
       col75 VARCHAR(64) NOT NULL,
       col76 VARCHAR(64) NOT NULL,
       col77 VARCHAR(64) NOT NULL,
       col78 VARCHAR(64) NOT NULL,
       col79 VARCHAR(64) NOT NULL,
       col80 VARCHAR(64) NOT NULL,
       col81 VARCHAR(64) NOT NULL,
       col82 VARCHAR(64) NOT NULL,
       col83 VARCHAR(64) NOT NULL,
       col84 VARCHAR(64) NOT NULL,
       col85 VARCHAR(64) NOT NULL,
       col86 VARCHAR(64) NOT NULL,
       col87 VARCHAR(64) NOT NULL,
       col88 VARCHAR(64) NOT NULL,
       col89 VARCHAR(64) NOT NULL,
       col90 VARCHAR(64) NOT NULL,
       col91 VARCHAR(64) NOT NULL,
       col92 VARCHAR(64) NOT NULL,
       col93 VARCHAR(64) NOT NULL,
       col94 VARCHAR(64) NOT NULL,
       col95 VARCHAR(64) NOT NULL,
       col96 VARCHAR(64) NOT NULL,
       col97 VARCHAR(64) NOT NULL,
       col98 VARCHAR(64) NOT NULL,
       col99 VARCHAR(64) NOT NULL,
       col100 VARCHAR(64) NOT NULL,
       col101 VARCHAR(64) NOT NULL,
       col102 VARCHAR(64) NOT NULL,
       col103 VARCHAR(64) NOT NULL,
       col104 VARCHAR(64) NOT NULL,
       col105 VARCHAR(64) NOT NULL,
       col106 VARCHAR(64) NOT NULL,
       col107 VARCHAR(64) NOT NULL,
       col108 VARCHAR(64) NOT NULL,
       col109 VARCHAR(64) NOT NULL,
       col110 VARCHAR(64) NOT NULL,
       col111 VARCHAR(64) NOT NULL,
       col112 VARCHAR(64) NOT NULL,
       col113 VARCHAR(64) NOT NULL,
       col114 VARCHAR(64) NOT NULL,
       col115 VARCHAR(64) NOT NULL,
       col116 VARCHAR(64) NOT NULL,
       col117 VARCHAR(64) NOT NULL,
       col118 VARCHAR(64) NOT NULL,
       col119 VARCHAR(64) NOT NULL,
       col120 VARCHAR(64) NOT NULL,
       col121 VARCHAR(64) NOT NULL,
       col122 VARCHAR(64) NOT NULL,
       col123 VARCHAR(64) NOT NULL,
       col124 VARCHAR(64) NOT NULL,
       col125 VARCHAR(64) NOT NULL,
       col126 VARCHAR(64) NOT NULL,
       col127 VARCHAR(64) NOT NULL,
       col128 VARCHAR(64) NOT NULL,
       col129 VARCHAR(64) NOT NULL,
       col130 VARCHAR(64) NOT NULL,
       col131 VARCHAR(64) NOT NULL,
       col132 VARCHAR(64) NOT NULL,
       col133 VARCHAR(64) NOT NULL,
       col134 VARCHAR(64) NOT NULL,
       col135 VARCHAR(64) NOT NULL,
       col136 VARCHAR(64) NOT NULL,
       col137 VARCHAR(64) NOT NULL,
       col138 VARCHAR(64) NOT NULL,
       col139 VARCHAR(64) NOT NULL,
       col140 VARCHAR(64) NOT NULL,
       col141 VARCHAR(64) NOT NULL,
       col142 VARCHAR(64) NOT NULL,
       col143 VARCHAR(64) NOT NULL,
       col144 VARCHAR(64) NOT NULL,
       col145 VARCHAR(64) NOT NULL,
       col146 VARCHAR(64) NOT NULL,
       col147 VARCHAR(64) NOT NULL,
       col148 VARCHAR(64) NOT NULL,
       col149 VARCHAR(64) NOT NULL,
       col150 VARCHAR(64) NOT NULL,
       col151 VARCHAR(64) NOT NULL,
       col152 VARCHAR(64) NOT NULL,
       col153 VARCHAR(64) NOT NULL,
       col154 VARCHAR(64) NOT NULL,
       col155 VARCHAR(64) NOT NULL,
       col156 VARCHAR(64) NOT NULL,
       col157 VARCHAR(64) NOT NULL,
       col158 VARCHAR(64) NOT NULL,
       col159 VARCHAR(64) NOT NULL,
       col160 VARCHAR(64) NOT NULL,
       col161 VARCHAR(64) NOT NULL,
       col162 VARCHAR(64) NOT NULL,
       col163 VARCHAR(64) NOT NULL,
       col164 VARCHAR(64) NOT NULL,
       col165 VARCHAR(64) NOT NULL,
       col166 VARCHAR(64) NOT NULL,
       col167 VARCHAR(64) NOT NULL,
       col168 VARCHAR(64) NOT NULL,
       col169 VARCHAR(64) NOT NULL,
       col170 VARCHAR(64) NOT NULL,
       col171 VARCHAR(64) NOT NULL,
       col172 VARCHAR(64) NOT NULL,
       col173 VARCHAR(64) NOT NULL,
       col174 VARCHAR(64) NOT NULL,
       col175 VARCHAR(64) NOT NULL,
       col176 VARCHAR(64) NOT NULL,
       col177 VARCHAR(64) NOT NULL,
       col178 VARCHAR(64) NOT NULL,
       col179 VARCHAR(64) NOT NULL,
       col180 VARCHAR(64) NOT NULL,
       col181 VARCHAR(64) NOT NULL,
       col182 VARCHAR(64) NOT NULL,
       col183 VARCHAR(64) NOT NULL,
       col184 VARCHAR(64) NOT NULL,
       col185 VARCHAR(64) NOT NULL,
       col186 VARCHAR(64) NOT NULL,
       col187 VARCHAR(64) NOT NULL,
       col188 VARCHAR(64) NOT NULL,
       col189 VARCHAR(64) NOT NULL,
       col190 VARCHAR(64) NOT NULL,
       col191 VARCHAR(64) NOT NULL,
       col192 VARCHAR(64) NOT NULL,
       col193 VARCHAR(64) NOT NULL,
       col194 VARCHAR(64) NOT NULL,
       col195 VARCHAR(64) NOT NULL,
       col196 VARCHAR(64) NOT NULL,
       col197 VARCHAR(64) NOT NULL,
       col198 VARCHAR(64) NOT NULL,
       PRIMARY KEY (col1)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    SET GLOBAL innodb_default_row_format='dynamic';
    SET SESSION innodb_strict_mode=OFF;
    CREATE OR REPLACE TABLE tab (
       col1 VARCHAR(40) NOT NULL,
       col2 VARCHAR(40) NOT NULL,
       col3 VARCHAR(40) NOT NULL,
       col4 VARCHAR(40) NOT NULL,
       col5 VARCHAR(40) NOT NULL,
       col6 VARCHAR(40) NOT NULL,
       col7 VARCHAR(40) NOT NULL,
       col8 VARCHAR(40) NOT NULL,
       col9 VARCHAR(40) NOT NULL,
       col10 VARCHAR(40) NOT NULL,
       col11 VARCHAR(40) NOT NULL,
       col12 VARCHAR(40) NOT NULL,
       col13 VARCHAR(40) NOT NULL,
       col14 VARCHAR(40) NOT NULL,
       col15 VARCHAR(40) NOT NULL,
       col16 VARCHAR(40) NOT NULL,
       col17 VARCHAR(40) NOT NULL,
       col18 VARCHAR(40) NOT NULL,
       col19 VARCHAR(40) NOT NULL,
       col20 VARCHAR(40) NOT NULL,
       col21 VARCHAR(40) NOT NULL,
       col22 VARCHAR(40) NOT NULL,
       col23 VARCHAR(40) NOT NULL,
       col24 VARCHAR(40) NOT NULL,
       col25 VARCHAR(40) NOT NULL,
       col26 VARCHAR(40) NOT NULL,
       col27 VARCHAR(40) NOT NULL,
       col28 VARCHAR(40) NOT NULL,
       col29 VARCHAR(40) NOT NULL,
       col30 VARCHAR(40) NOT NULL,
       col31 VARCHAR(40) NOT NULL,
       col32 VARCHAR(40) NOT NULL,
       col33 VARCHAR(40) NOT NULL,
       col34 VARCHAR(40) NOT NULL,
       col35 VARCHAR(40) NOT NULL,
       col36 VARCHAR(40) NOT NULL,
       col37 VARCHAR(40) NOT NULL,
       col38 VARCHAR(40) NOT NULL,
       col39 VARCHAR(40) NOT NULL,
       col40 VARCHAR(40) NOT NULL,
       col41 VARCHAR(40) NOT NULL,
       col42 VARCHAR(40) NOT NULL,
       col43 VARCHAR(40) NOT NULL,
       col44 VARCHAR(40) NOT NULL,
       col45 VARCHAR(40) NOT NULL,
       col46 VARCHAR(40) NOT NULL,
       col47 VARCHAR(40) NOT NULL,
       col48 VARCHAR(40) NOT NULL,
       col49 VARCHAR(40) NOT NULL,
       col50 VARCHAR(40) NOT NULL,
       col51 VARCHAR(40) NOT NULL,
       col52 VARCHAR(40) NOT NULL,
       col53 VARCHAR(40) NOT NULL,
       col54 VARCHAR(40) NOT NULL,
       col55 VARCHAR(40) NOT NULL,
       col56 VARCHAR(40) NOT NULL,
       col57 VARCHAR(40) NOT NULL,
       col58 VARCHAR(40) NOT NULL,
       col59 VARCHAR(40) NOT NULL,
       col60 VARCHAR(40) NOT NULL,
       col61 VARCHAR(40) NOT NULL,
       col62 VARCHAR(40) NOT NULL,
       col63 VARCHAR(40) NOT NULL,
       col64 VARCHAR(40) NOT NULL,
       col65 VARCHAR(40) NOT NULL,
       col66 VARCHAR(40) NOT NULL,
       col67 VARCHAR(40) NOT NULL,
       col68 VARCHAR(40) NOT NULL,
       col69 VARCHAR(40) NOT NULL,
       col70 VARCHAR(40) NOT NULL,
       col71 VARCHAR(40) NOT NULL,
       col72 VARCHAR(40) NOT NULL,
       col73 VARCHAR(40) NOT NULL,
       col74 VARCHAR(40) NOT NULL,
       col75 VARCHAR(40) NOT NULL,
       col76 VARCHAR(40) NOT NULL,
       col77 VARCHAR(40) NOT NULL,
       col78 VARCHAR(40) NOT NULL,
       col79 VARCHAR(40) NOT NULL,
       col80 VARCHAR(40) NOT NULL,
       col81 VARCHAR(40) NOT NULL,
       col82 VARCHAR(40) NOT NULL,
       col83 VARCHAR(40) NOT NULL,
       col84 VARCHAR(40) NOT NULL,
       col85 VARCHAR(40) NOT NULL,
       col86 VARCHAR(40) NOT NULL,
       col87 VARCHAR(40) NOT NULL,
       col88 VARCHAR(40) NOT NULL,
       col89 VARCHAR(40) NOT NULL,
       col90 VARCHAR(40) NOT NULL,
       col91 VARCHAR(40) NOT NULL,
       col92 VARCHAR(40) NOT NULL,
       col93 VARCHAR(40) NOT NULL,
       col94 VARCHAR(40) NOT NULL,
       col95 VARCHAR(40) NOT NULL,
       col96 VARCHAR(40) NOT NULL,
       col97 VARCHAR(40) NOT NULL,
       col98 VARCHAR(40) NOT NULL,
       col99 VARCHAR(40) NOT NULL,
       col100 VARCHAR(40) NOT NULL,
       col101 VARCHAR(40) NOT NULL,
       col102 VARCHAR(40) NOT NULL,
       col103 VARCHAR(40) NOT NULL,
       col104 VARCHAR(40) NOT NULL,
       col105 VARCHAR(40) NOT NULL,
       col106 VARCHAR(40) NOT NULL,
       col107 VARCHAR(40) NOT NULL,
       col108 VARCHAR(40) NOT NULL,
       col109 VARCHAR(40) NOT NULL,
       col110 VARCHAR(40) NOT NULL,
       col111 VARCHAR(40) NOT NULL,
       col112 VARCHAR(40) NOT NULL,
       col113 VARCHAR(40) NOT NULL,
       col114 VARCHAR(40) NOT NULL,
       col115 VARCHAR(40) NOT NULL,
       col116 VARCHAR(40) NOT NULL,
       col117 VARCHAR(40) NOT NULL,
       col118 VARCHAR(40) NOT NULL,
       col119 VARCHAR(40) NOT NULL,
       col120 VARCHAR(40) NOT NULL,
       col121 VARCHAR(40) NOT NULL,
       col122 VARCHAR(40) NOT NULL,
       col123 VARCHAR(40) NOT NULL,
       col124 VARCHAR(40) NOT NULL,
       col125 VARCHAR(40) NOT NULL,
       col126 VARCHAR(40) NOT NULL,
       col127 VARCHAR(40) NOT NULL,
       col128 VARCHAR(40) NOT NULL,
       col129 VARCHAR(40) NOT NULL,
       col130 VARCHAR(40) NOT NULL,
       col131 VARCHAR(40) NOT NULL,
       col132 VARCHAR(40) NOT NULL,
       col133 VARCHAR(40) NOT NULL,
       col134 VARCHAR(40) NOT NULL,
       col135 VARCHAR(40) NOT NULL,
       col136 VARCHAR(40) NOT NULL,
       col137 VARCHAR(40) NOT NULL,
       col138 VARCHAR(40) NOT NULL,
       col139 VARCHAR(40) NOT NULL,
       col140 VARCHAR(40) NOT NULL,
       col141 VARCHAR(40) NOT NULL,
       col142 VARCHAR(40) NOT NULL,
       col143 VARCHAR(40) NOT NULL,
       col144 VARCHAR(40) NOT NULL,
       col145 VARCHAR(40) NOT NULL,
       col146 VARCHAR(40) NOT NULL,
       col147 VARCHAR(40) NOT NULL,
       col148 VARCHAR(40) NOT NULL,
       col149 VARCHAR(40) NOT NULL,
       col150 VARCHAR(40) NOT NULL,
       col151 VARCHAR(40) NOT NULL,
       col152 VARCHAR(40) NOT NULL,
       col153 VARCHAR(40) NOT NULL,
       col154 VARCHAR(40) NOT NULL,
       col155 VARCHAR(40) NOT NULL,
       col156 VARCHAR(40) NOT NULL,
       col157 VARCHAR(40) NOT NULL,
       col158 VARCHAR(40) NOT NULL,
       col159 VARCHAR(40) NOT NULL,
       col160 VARCHAR(40) NOT NULL,
       col161 VARCHAR(40) NOT NULL,
       col162 VARCHAR(40) NOT NULL,
       col163 VARCHAR(40) NOT NULL,
       col164 VARCHAR(40) NOT NULL,
       col165 VARCHAR(40) NOT NULL,
       col166 VARCHAR(40) NOT NULL,
       col167 VARCHAR(40) NOT NULL,
       col168 VARCHAR(40) NOT NULL,
       col169 VARCHAR(40) NOT NULL,
       col170 VARCHAR(40) NOT NULL,
       col171 VARCHAR(40) NOT NULL,
       col172 VARCHAR(40) NOT NULL,
       col173 VARCHAR(40) NOT NULL,
       col174 VARCHAR(40) NOT NULL,
       col175 VARCHAR(40) NOT NULL,
       col176 VARCHAR(40) NOT NULL,
       col177 VARCHAR(40) NOT NULL,
       col178 VARCHAR(40) NOT NULL,
       col179 VARCHAR(40) NOT NULL,
       col180 VARCHAR(40) NOT NULL,
       col181 VARCHAR(40) NOT NULL,
       col182 VARCHAR(40) NOT NULL,
       col183 VARCHAR(40) NOT NULL,
       col184 VARCHAR(40) NOT NULL,
       col185 VARCHAR(40) NOT NULL,
       col186 VARCHAR(40) NOT NULL,
       col187 VARCHAR(40) NOT NULL,
       col188 VARCHAR(40) NOT NULL,
       col189 VARCHAR(40) NOT NULL,
       col190 VARCHAR(40) NOT NULL,
       col191 VARCHAR(40) NOT NULL,
       col192 VARCHAR(40) NOT NULL,
       col193 VARCHAR(40) NOT NULL,
       col194 VARCHAR(40) NOT NULL,
       col195 VARCHAR(40) NOT NULL,
       col196 VARCHAR(40) NOT NULL,
       col197 VARCHAR(40) NOT NULL,
       col198 VARCHAR(40) NOT NULL,
       PRIMARY KEY (col1)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    SHOW WARNINGS;
    +---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
    | Level | Code | Message |
    +---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
    | Warning | 139 | Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. |
    +---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.000 sec)
    ACID

    InnoDB System Variables

    This page lists the system variables available for configuring InnoDB's behavior, performance, buffers, and logs.

    This page documents system variables related to the InnoDB storage engine. For options that are not system variables, see InnoDB Options.

    See Server System Variables for a complete list of system variables and instructions on setting them.

    Also see the Full list of MariaDB options, system and status variables.

    have_innodb

    • Description: If the server supports , are set to YES, otherwise are set to NO. Removed in , use the table or instead.

    • Scope: Global

    • Dynamic: No

    • Removed:

    ignore_builtin_innodb

    • Description: Setting this to 1 results in the built-in InnoDB storage engine being ignored. In some versions of MariaDB, XtraDB is the default and is always present, so this variable is ignored and setting it results in a warning. From to , when InnoDB was the default instead of XtraDB, this variable needed to be set. Usually used in conjunction with the option to use the InnoDB plugin.

    • Command line: --ignore-builtin-innodb

    • Scope: Global

    innodb_adaptive_checkpoint

    • Description: Replaced with . Controls adaptive checkpointing. InnoDB's fuzzy checkpointing can cause stalls, as many dirty blocks are flushed at once as the checkpoint age nears the maximum. Adaptive checkpointing aims for more consistent flushing, approximately modified age / maximum checkpoint age. Can result in larger transaction log files

      • reflex Similar to flushing but flushes blocks constantly and contiguously based on the oldest modified age. If the age exceeds 1/2 of the maximum age capacity, flushing are weak contiguous. If the age exceeds 3/4, flushing are strong. Strength can be adjusted by the variable .

    innodb_adaptive_flushing

    • Description: If set to 1, the default, the server will dynamically adjust the flush rate of dirty pages in the . This assists to reduce brief bursts of I/O activity. If set to 0, adaptive flushing will only take place when the limit specified by is reached.

    • Command line: --innodb-adaptive-flushing={0|1}

    • Scope: Global

    innodb_adaptive_flushing_lwm

    • Description: Adaptive flushing is enabled when this low water mark percentage of the capacity is reached. Takes effect even if is disabled.

    • Command line: --innodb-adaptive-flushing-lwm=#

    • Scope: Global

    • Dynamic: Yes

    innodb_adaptive_flushing_method

    • Description: Determines the method of flushing dirty blocks from the InnoDB . If set to native or 0, the original InnoDB method is used. The maximum checkpoint age is determined by the total length of all transaction log files. When the checkpoint age reaches the maximum checkpoint age, blocks are flushed. This can cause lag if there are many updates per second and many blocks with an almost identical age need to be flushed. If set to estimate or 1, the default, the oldest modified age are compared with the maximum age capacity. If it's more than 1/4 of this age, blocks are flushed every second. The number of blocks flushed is determined by the number of modified blocks, the LSN progress speed and the average age of all modified blocks. It's therefore independent of the for the 1-second loop, but not entirely so for the 10-second loop. If set to keep_average or 2, designed specifically for SSD cards, a shorter loop cycle is used in an attempt to keep the I/O rate constant. Removed in /XtraDB 5.6 and replaced with InnoDB flushing method from MySQL 5.6.

    innodb_adaptive_hash_index

    • Description: If set to 1, the default until , the hash index is enabled. Based on performance testing (), the InnoDB adaptive hash index helps performance in mostly read-only workloads, and could slow down performance in other environments, especially , , , or operations.

    • Command line: --innodb-adaptive-hash-index={0|1}

    • Scope: Global

    innodb_adaptive_hash_index_partitions

    • Description: Specifies the number of partitions for use in adaptive searching. If set to 1, no extra partitions are created. XtraDB-only. From (which uses InnoDB as default instead of XtraDB), this is an alias for to allow for easier upgrades.

    • Command line: innodb-adaptive-hash-index-partitions=#

    • Scope: Global

    innodb_adaptive_hash_index_parts

    • Description: Specifies the number of partitions for use in adaptive searching. If set to 1, no extra partitions are created.

    • Command line: innodb-adaptive-hash-index-parts=#

    • Scope: Global

    • Dynamic: No

    innodb_adaptive_max_sleep_delay

    • Description: Maximum time in microseconds to automatically adjust the value to, based on the workload. Useful in extremely busy systems with hundreds of thousands of simultaneous connections. 0 disables any limit. Deprecated and ignored from .

    • Command line: --innodb-adaptive-max-sleep-delay=#

    • Scope: Global

    innodb_additional_mem_pool_size

    • Description: Size in bytes of the memory pool used for storing information about internal data structures. Defaults to 8MB, if your application has many tables and a large structure, and this is exceeded, operating system memory are allocated and warning messages written to the error log, in which case you should increase this value. Deprecated in and removed in along with InnoDB's internal memory allocator.

    • Command line: --innodb-additional-mem-pool-size=#

    • Scope: Global

    innodb_alter_copy_bulk

    • Description: Allow bulk insert operation for copy alter operation.

    • Scope: Global

    • Dynamic: Yes

    • Data Type: boolean

    innodb_api_bk_commit_interval

    • Description: Time in seconds between auto-commits for idle connections using the InnoDB memcached interface (not implemented in MariaDB).

    • Command line: --innodb-api-bk-commit-interval=#

    • Scope: Global

    • Dynamic: Yes

    innodb_api_disable_rowlock

    • Description: For use with MySQL's memcached (not implemented in MariaDB)

    • Command line: --innodb-api-disable-rowlock={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_api_enable_binlog

    • Description: For use with MySQL's memcached (not implemented in MariaDB)

    • Command line: --innodb-api-enable-binlog={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_api_enable_mdl

    • Description: For use with MySQL's memcached (not implemented in MariaDB)

    • Command line: --innodb-api-enable-mdl={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_api_trx_level

    • Description: For use with MySQL's memcached (not implemented in MariaDB)

    • Command line: --innodb-api-trx-level=#

    • Scope: Global

    • Dynamic: Yes

    innodb_auto_lru_dump

    • Description: Renamed since XtraDB 5.5.10-20.1, which was in turn replaced by in .

    • Command line: --innodb-auto-lru-dump=#

    • Removed: XtraDB 5.5.10-20.1

    innodb_autoextend_increment

    • Description: Size in MB to increment an auto-extending shared tablespace file when it becomes full. If was set to 1, this setting does not apply to the resulting per-table tablespace files, which are automatically extended in their own way.

    • Command line: --innodb-autoextend-increment=#

    • Scope: Global

    innodb_autoinc_lock_mode

    • Description: The lock mode that is used when generating values for InnoDB tables.

      • Valid values are:

        • 0 is the traditional lock mode.

    innodb_background_scrub_data_check_interval

    • Description: Check if spaces needs scrubbing every seconds. See . Deprecated and ignored from .

    • Command line: --innodb-background-scrub-data-check-interval=#

    • Scope: Global

    • Dynamic: Yes

    innodb_background_scrub_data_compressed

    • Description: Enable scrubbing of compressed data by background threads (same as encryption_threads). See . Deprecated and ignored from .

    • Command line: --innodb-background-scrub-data-compressed={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_background_scrub_data_interval

    • Description: Scrub spaces that were last scrubbed longer than this number of seconds ago. See . Deprecated and ignored from .

    • Command line: --innodb-background-scrub-data-interval=#

    • Scope: Global

    • Dynamic: Yes

    innodb_background_scrub_data_uncompressed

    • Description: Enable scrubbing of uncompressed data by background threads (same as encryption_threads). See . Deprecated and ignored from .

    • Command line: --innodb-background-scrub-data-uncompressed={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_blocking_buffer_pool_restore

    • Description: If set to 1 (0 is default), XtraDB will wait until the least-recently used (LRU) dump is completely restored upon restart before reporting back to the server that it has successfully started up. Available with XtraDB only, not InnoDB.

    • Command line: innodb-blocking-buffer-pool-restore={0|1}

    • Scope: Global

    innodb_buf_dump_status_frequency

    • Description: Determines how often (as a percent) the buffer pool dump status should be printed in the logs. For example, 10 means that the buffer pool dump status is printed when every 10% of the number of buffer pool pages are dumped. The default is 0 (only start and end status is printed).

    • Command line: --innodb-buf-dump-status-frequency=#

    • Scope: Global

    innodb_buffer_pool_chunk_size

    • Description: Chunk size used for dynamically resizing the . Note that changing this setting can change the size of the buffer pool. When is used this value is effectively rounded up to the next multiple of . See . From , the variable is autosized based on the .

    • Command line: --innodb-buffer-pool-chunk-size=#

    • Scope: Global

    innodb_buffer_pool_dump_at_shutdown

    • Description: Whether to record pages cached in the on server shutdown, which reduces the length of the warmup the next time the server starts. The related specifies whether the buffer pool is automatically warmed up at startup.

    • Command line: --innodb-buffer-pool-dump-at-shutdown={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_dump_now

    • Description: Immediately records pages stored in the . The related does the reverse, and will immediately warm up the buffer pool.

    • Command line: --innodb-buffer-pool-dump-now={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_dump_pct

    • Description: Dump only the hottest N% of each .

    • Command line: --innodb-buffer-pool-dump-pct={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_evict

    • Description: Evict pages from the buffer pool. If set to "uncompressed" then all uncompressed pages are evicted from the buffer pool. Variable to be used only for testing. Only exists in DEBUG builds.

    • Command line: --innodb-buffer-pool-evict=#

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_filename

    • Description: The file that holds the list of page numbers set by and .

    • Command line: --innodb-buffer-pool-filename=file

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_instances

    • Description: If is set to more than 1GB, innodb_buffer_pool_instances divides the buffer pool into the specified number of instances. The default was 1 in , but for large systems with buffer pools of many gigabytes, many instances could help reduce contention concurrency through . The default is 8 in MariaDB 10 (except on Windows 32-bit, where it varies according to , or from , where it is set to 1 if < 1GB). Each instance manages its own data structures and takes an equal portion of the total buffer pool size, so for example if innodb_buffer_pool_size is 4GB and innodb_buffer_pool_instances is set to 4, each instance are 1GB. Each instance should ideally be at least 1GB in size. Starting with , performance improvements intended to reduce the overhead of context-switching between buffer pools changed the recommended number of innodb_buffer_pool_instances to one for every 128GB of buffer pool size. Based on these changes, the variable is deprecated and ignored from , where the buffer pool runs in a single instance regardless of size.

    • Command line: --innodb-buffer-pool-instances=#

    innodb_buffer_pool_load_abort

    • Description: Aborts the process of restoring contents started by or .

    • Command line: --innodb-buffer-pool-load-abort={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_load_at_startup

    • Description: Specifies whether the is automatically warmed up when the server starts by loading the pages held earlier. The related specifies whether pages are saved at shutdown. If the buffer pool is large and taking a long time to load, increasing at startup may help.

    • Command line: --innodb-buffer-pool-load-at-startup={0|1}

    • Scope: Global

    innodb_buffer_pool_load_now

    • Description: Immediately warms up the by loading the stored data pages. The related does the reverse, and immediately records pages stored in the buffer pool.

    • Command line: --innodb-buffer-pool-load-now={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_load_pages_abort

    • Description: Number of pages during a buffer pool load to process before signaling . Debug builds only.

    • Command line: --innodb-buffer-pool-load-pages-abort=#

    • Scope: Global

    • Dynamic: Yes

    innodb_buffer_pool_populate

    • Description: When set to 1 (0 is default), XtraDB will preallocate pages in the buffer pool on starting up so that NUMA allocation decisions are made while the buffer cache is still clean. XtraDB only. This option was made ineffective in . Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-buffer-pool-populate={0|1}

    • Scope: Global

    innodb_buffer_pool_restore_at_startup

    • Description: Time in seconds between automatic buffer pool dumps. If set to a non-zero value, XtraDB will also perform an automatic restore of the at startup. If set to 0, automatic dumps are not performed, nor automatic restores on startup. Replaced by in .

    • Command line: innodb-buffer-pool-restore-at-startup

    • Scope: Global

    innodb_buffer_pool_shm_checksum

    • Description: Used with Percona's SHM buffer pool patch in XtraDB 5.5. Was shortly deprecated and removed in XtraDB 5.6. XtraDB only.

    • Command line: innodb-buffer-pool-shm-checksum={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_buffer_pool_shm_key

    • Description: Used with Percona's SHM buffer pool patch in XtraDB 5.5. Later deprecated in XtraDB 5.5, and removed in XtraDB 5.6.

    • Command line: innodb-buffer-pool-shm-key={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_buffer_pool_size

    • Description: InnoDB buffer pool size in bytes. The primary value to adjust on a database server with entirely/primarily tables, can be set up to 80% of the total memory in these environments. See the for more on setting this variable, and also if doing so dynamically.

    • Command line: --innodb-buffer-pool-size=#

    • Scope: Global

    innodb_buffer_pool_size_auto_min

    • Description: Minimum innodb_buffer_pool_size in bytes for dynamic shrinking on memory pressure. Only affects Linux. If a memory pressure event is reported by Linux, the innodb_buffer_pool_size may be automatically shrunk towards this value. By default, set to , that is, memory pressure events will be ignored. 0 sets no minimum value.

    • Command line: --innodb-buffer-pool-size-auto-min=#

    • Scope: Global

    innodb_buffer_pool_size_max

    • Description: Maximum innodb_buffer_pool_size value.

    • Command line: --innodb-buffer-pool-size-max=#

    • Scope: Global

    • Dynamic: No

    innodb_change_buffer_dump

    • Description: If set, causes the contents of the InnoDB change buffer to be dumped to the server error log at startup. Only available in debug builds.

    • Scope: Global

    • Dynamic: No

    • Data Type: boolean

    innodb_change_buffer_max_size

    • Description: Maximum size of the as a percentage of the total buffer pool. The default is 25%, and this can be increased up to 50% for servers with high write activity, and lowered down to 0 for servers used exclusively for reporting.

    • Command line: --innodb-change-buffer-max-size=#

    • Scope: Global

    • Dynamic: Yes

    innodb_change_buffering

    • Description: Sets how change buffering is performed. See for details on the settings. Deprecated and ignored from .

    • Command line: --innodb-change-buffering=#

    • Scope: Global

    • Dynamic: Yes

    innodb_change_buffering_debug

    • Description: If set to 1, an debug flag is set. 1 forces all changes to the change buffer, while 2 causes a crash at merge. 0, the default, indicates no flag is set. Only available in debug builds.

    • Command line: --innodb-change-buffering-debug=#

    innodb_checkpoint_age_target

    • Description: The maximum value of the checkpoint age. If set to 0, has no effect. Removed in /XtraDB 5.6 and replaced with InnoDB flushing method from MySQL 5.6.

    • Command line: innodb-checkpoint-age-target=#

    • Scope: Global

    innodb_checksum_algorithm

    • Description: Specifies how the InnoDB tablespace checksum is generated and verified.

      • innodb: Backwards compatible with earlier versions (<= ). Deprecated in , , and removed in . If really needed, data files can still be converted with .

      • crc32: A newer, faster algorithm, but incompatible with earlier versions. Tablespace blocks are converted to the new format over time, meaning that a mix of checksums may be present.

    innodb_checksums

    • Description: By default, performs checksum validation on all pages read from disk, which provides extra fault tolerance. You would usually want this set to 1 in production environments, although setting it to 0 can provide marginal performance improvements. Deprecated and functionality replaced by in , and should be removed to avoid conflicts. ON is equivalent to --innodb_checksum_algorithm=innodb and OFF to --innodb_checksum_algorithm=none.

    • Command line: --innodb-checksums

    innodb_cleaner_lsn_age_factor

    • Description: XtraDB has enhanced page cleaner heuristics, and with these in place, the default InnoDB adaptive flushing may be too aggressive. As a result, a new LSN age factor formula has been introduced, controlled by this variable. The default setting, high_checkpoint, uses the new formula, while the alternative, legacy, uses the original algorithm. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: --innodb-cleaner-lsn-age-factor=value

    • Scope: Global

    innodb_cmp_per_index_enabled

    • Description: If set to ON (OFF is default), per-index compression statistics are stored in the table. These are expensive to record, so this setting should only be changed with care, such as for performance tuning on development or replica servers.

    • Command line: --innodb-cmp-per-index-enabled={0|1}

    • Scope: Global

    innodb_commit_concurrency

    • Description: Limit to the number of transaction threads that can commit simultaneously. 0, the default, imposes no limit. While you can change from one positive limit to another at runtime, you cannot set this variable to 0, or change it from 0, while the server is running. Deprecated and ignored from .

    • Command line: --innodb-commit-concurrency=#

    • Scope: Global

    • Dynamic: Yes

    innodb_compression_algorithm

    • Description: Compression algorithm used for . The supported values are:

      • none: Pages are not compressed.

      • zlib: Pages are compressed using the bundled compression algorithm.

    innodb_compression_default

    • Description: Whether or not is enabled by default for new tables.

      • The default value is OFF, which means new tables are not compressed.

      • See for more information.

    • Command line:

    innodb_compression_failure_threshold_pct

    • Description: Specifies the percentage cutoff for expensive compression failures during updates to a table that uses , after which free space is added to each new compressed page, dynamically adjusted up to the level set by . Zero disables checking of compression efficiency and adjusting padding.

      • See for more information.

    • Command line: --innodb-compression-failure-threshold-pct=#

    innodb_compression_level

    • Description: Specifies the default level of compression for tables that use .

      • Only a subset of InnoDB page compression algorithms support compression levels. If an InnoDB page compression algorithm does not support compression levels, then the compression level value is ignored.

      • The compression level can be set to any value between 1 and 9. The default compression level is 6. The range goes from the fastest to the most compact, which means that

    innodb_compression_pad_pct_max

    • Description: The maximum percentage of reserved free space within each compressed page for tables that use . Reserved free space is used when the page's data is reorganized and might be recompressed. Only used when is not zero, and the rate of compression failures exceeds its setting.

      • See for more information.

    • Command line: --innodb-compression-pad-pct-max=#

    innodb_concurrency_tickets

    • Description: Number of times a newly-entered thread can enter and leave until it is again subject to the limitations of and may possibly be queued. Deprecated and ignored from .

    • Command line: --innodb-concurrency-tickets=#

    • Scope: Global

    • Dynamic: Yes

    innodb_corrupt_table_action

    • Description: What action to perform when a corrupt table is found. XtraDB only.

      • When set to assert, the default, XtraDB will intentionally crash the server when it detects corrupted data in a single-table tablespace, with an assertion failure.

      • When set to warn, it will pass corruption as corrupt table instead of crashing, and disable all further I/O (except for deletion) on the table file.

    innodb_data_file_buffering

    • Description: Whether to enable the file system cache for data files. Set to OFF by default, are set to ON if is set to fsync, littlesync, nosync, or (Windows specific) normal.

    • Command line: --innodb-data-file-buffering={0|1}

    innodb_data_file_path

    • Description: Individual data files, paths and sizes. The value of is joined to each path specified by innodb_data_file_path to get the full directory path. If innodb_data_home_dir is an empty string, absolute paths can be specified here. A file size is specified (with K for kilobytes, M for megabytes and G for gigabytes). Also whether or not to autoextend the data file, and whether or not to on startup may also be specified.

    • Command line: --innodb-data-file-path=name

    • Scope: Global

    innodb_data_file_write_through

    • Description: Whether writes to InnoDB data files (including the temporary tablespace) are write through. Set to OFF by default, are set to ON if is set to O_DSYNC. On systems that support FUA it may make sense to enable write-through, to avoid extra system calls.

    • Command line: --innodb-data-file-write-through={0|1}

    • Scope: Global

    innodb_data_home_dir

    • Description: Directory path for all data files in the shared tablespace (assuming is not enabled). File-specific information can be added in , as well as absolute paths if innodb_data_home_dir is set to an empty string.

    • Command line: --innodb-data-home-dir=path

    • Scope: Global

    • Dynamic: No

    innodb_deadlock_detect

    • Description: By default, the InnoDB deadlock detector is enabled. If set to off, deadlock detection is disabled and MariaDB will rely on instead. This may be more efficient in systems with high concurrency as deadlock detection can cause a bottleneck when a number of threads have to wait for the same lock.

    • Command line: --innodb-deadlock-detect

    • Scope: Global

    • Dynamic: Yes

    innodb_deadlock_report

    • Description: How to report deadlocks (if ).

      • off: Do not report any details of deadlocks.

      • basic: Report transactions and waiting locks.

    innodb_default_page_encryption_key

    • Description: Encryption key used for page encryption.

      • See and for more information.

    • Command line: --innodb-default-page-encryption-key=#

    • Scope: Global

    innodb_default_encryption_key_id

    • Description: ID of encryption key used by default to encrypt InnoDB tablespaces.

      • See and for more information.

    • Command line: --innodb-default-encryption-key-id=#

    • Scope: Global, Session

    innodb_default_row_format

    • Description: Specifies the default to be used for InnoDB tables. The compressed row format cannot be set as the default.

      • See for more information.

    • Command line: --innodb-default-row-format=value

    innodb_defragment

    • Description: When set to 1 (the default is 0), InnoDB defragmentation is enabled. When set to FALSE, all existing defragmentation are paused and new defragmentation commands will fail. Paused defragmentation commands will resume when this variable is set to true again. See .

    • Command line: --innodb-defragment={0|1}

    • Scope: Global

    innodb_defragment_fill_factor

    • Description:. Indicates how full defragmentation should fill a page. Together with ensures defragmentation won’t pack the page too full and cause page split on the next insert on every page. The variable indicating more defragmentation gain is the one effective. See .

    • Command line: --innodb-defragment-fill-factor=#

    • Scope: Global

    • Dynamic: Yes

    innodb_defragment_fill_factor_n_recs

    • Description: Number of records of space that defragmentation should leave on the page. This variable, together with , is introduced so defragmentation won't pack the page too full and cause page split on the next insert on every page. The variable indicating more defragmentation gain is the one effective. See .

    • Command line: --innodb-defragment-fill-factor-n-recs=#

    • Scope: Global

    innodb_defragment_frequency

    • Description: Maximum times per second for defragmenting a single index. This controls the number of times the defragmentation thread can request X_LOCK on an index. The defragmentation thread will check whether 1/defragment_frequency (s) has passed since it last worked on this index, and put the index back in the queue if not enough time has passed. The actual frequency can only be lower than this given number. See .

    • Command line: --innodb-defragment-frequency=#

    • Scope: Global

    innodb_defragment_n_pages

    • Description: Number of pages considered at once when merging multiple pages to defragment. See .

    • Command line: --innodb-defragment-n-pages=#

    • Scope: Global

    • Dynamic: Yes

    innodb_defragment_stats_accuracy

    • Description: Number of defragment stats changes there are before the stats are written to persistent storage. Defaults to zero, meaning disable defragment stats tracking. See .

    • Command line: --innodb-defragment-stats-accuracy=#

    • Scope: Global

    • Dynamic: Yes

    innodb_dict_size_limit

    • Description: Size in bytes of a soft limit the memory used by tables in the data dictionary. Once this limit is reached, XtraDB will attempt to remove unused entries. If set to 0, the default and standard InnoDB behavior, there is no limit to memory usage. Removed in /XtraDB 5.6 and replaced by MySQL 5.6's new implementation.

    • Command line: innodb-dict-size-limit=#

    • Scope: Global

    innodb_disable_sort_file_cache

    • Description: If set to 1 (0 is default), the operating system file system cache for merge-sort temporary files is disabled.

    • Command line: --innodb-disable-sort-file-cache={0|1}

    • Scope: Global

    innodb_disallow_writes

    • Description: Tell InnoDB to stop any writes to disk.

    • Command line: None

    • Scope: Global

    • Dynamic: Yes

    innodb_doublewrite

    • Description: If set to ON, the default, to improve fault tolerance first stores data to a before writing it to data file. Disabling will provide a marginal performance improvement, and assumes that writes of are atomic. fast is available from , and is like ON, but writes are not synchronized to data files. The deprecated start-up parameter will cause innodb_doublewrite=ON to be changed to innodb_doublewrite=fast, which will prevent InnoDB from making any durable writes to data files. This would normally be done right before the log checkpoint LSN is updated. Depending on the file systems being used and their configuration, this may or may not be safe.

      The value innodb_doublewrite=fast differs from the previous combination of innodb_doublewrite=ON and innodb_flush_method=O_DIRECT_NO_FSYNC by always invoking os_file_flush() on the doublewrite buffer itself in buf_dblwr_t::flush_buffered_writes_completed(). This should be safer when there are multiple doublewrite batches between checkpoints.

      Typically, once per second, buf_flush_page_cleaner() would write out up to innodb_io_capacity pages and advance the log checkpoint. Also typically, innodb_io_capacity>128, which is the size of the doublewrite buffer in pages. Should os_file_flush_func() not be invoked between doublewrite batches, writes could be reordered in an unsafe way.

    innodb_doublewrite_file

    • Description: The absolute or relative path and filename to a dedicated tablespace for the . In heavy workloads, the doublewrite buffer can impact heavily on the server, and moving it to a different drive will reduce contention on random reads. Since the doublewrite buffer is mostly sequential writes, a traditional HDD is a better choice than SSD. This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Command line: innodb-doublewrite-file=filename

    • Scope: Global

    innodb_empty_free_list_algorithm

    • Description: XtraDB 5.6.13-61 introduced an algorithm to assist with reducing mutex contention when the buffer pool free list is empty, controlled by this variable. If set to backoff, the default until , the new algorithm are used. If set to legacy, the original InnoDB algorithm are used. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades. See for the reasons this was changed back to legacy in XtraDB 5.6.36-82.0. When upgrading from 10.0 to 10.1 (>= 10.1.24), for large buffer pools the default will remain backoff, while for small ones it are changed to legacy.

    • Command line: innodb-empty-free-list-algorithm=value

    innodb_enable_unsafe_group_commit

    • Description: Unneeded after XtraDB 1.0.5. If set to 0, the default, InnoDB will keep transactions between the transaction log and s in the same order. Safer, but slower. If set to 1, transactions can be group-committed, but there is no guarantee of the order being kept, and a small risk of the two logs getting out of sync. In write-intensive environments, can lead to a significant improvement in performance.

    • Command line: --innodb-enable-unsafe-group-commit

    • Scope: Global

    innodb_encrypt_log

    • Description: Enables encryption of the . This also enables encryption of some temporary files created internally by InnoDB, such as those used for merge sorts and row logs.

      • See and for more information.

    • Command line: --innodb-encrypt-log

    innodb_encrypt_tables

    • Description: Enables automatic encryption of all InnoDB tablespaces.

      • OFF - Disables table encryption for all new and existing tables that have the table option set to DEFAULT.

      • ON - Enables table encryption for all new and existing tables that have the table option set to DEFAULT

    innodb_encrypt_temporary_tables

    • Description: Enables automatic encryption of the InnoDB .

      • See and for more information.

    • Command line: --innodb-encrypt-temporary-tables={0|1}

    innodb_encryption_rotate_key_age

    • Description: Re-encrypt in background any page having a key older than this number of key versions. When setting up encryption, this variable must be set to a non-zero value. Otherwise, when you enable encryption through MariaDB won't be able to automatically encrypt any unencrypted tables.

      • See and for more information.

    • Command line: --innodb-encryption-rotate-key-age=#

    innodb_encryption_rotation_iops

    • Description: Use this many iops for background key rotation operations performed by the background encryption threads.

      • See and for more information.

    • Command line: --innodb-encryption-rotation_iops=#

    innodb_encryption_threads

    • Description: Number of background encryption threads performing background key rotation and . When setting up encryption, this variable must be set to a non-zero value. Otherwise, when you enable encryption through MariaDB won't be able to automatically encrypt any unencrypted tables. Recommended never be set higher than 255.

      • See and for more information.

    • Command line: --innodb-encryption-threads=#

    innodb_extra_rsegments

    • Description: Removed in XtraDB 5.5 and replaced by . Usually there is one rollback segment protected by single mutex, a source of contention in high write environments. This option specifies a number of extra user rollback segments. Changing the default will make the data readable by XtraDB only, and is incompatible with InnoDB. After modifying, the server must be slow-shutdown. If there is existing data, it must be dumped before changing, and re-imported after the change has taken effect.

    • Command line: --innodb-extra-rsegments=#

    • Scope: Global

    innodb_extra_undoslots

    • Description: Usually, InnoDB has 1024 undo slots in its rollback segment, so 1024 transactions can run in parallel. New transactions will fail if all slots are used. Setting this variable to 1 expands the available undo slots to 4072. Not recommended unless you get the Warning: cannot find a free slot for an undo log error in the error log, as it makes data files unusable for ibbackup, or MariaDB servers not run with this option. See also .

    • Command line: --innodb-extra-undoslots={0|1}

    • Scope: Global

    innodb_fake_changes

    • Description: From until , XtraDB-only option that enables the fake changes feature. In , setting up or restarting a replica can cause a replication reads to perform more slowly, as MariaDB is single-threaded and needs to read the data before it can execute the queries. This can be speeded up by prefetching threads to warm the server, replaying the statements and then rolling back at commit. This however has an overhead from locking rows only then to undo changes at rollback. Fake changes attempts to reduce this overhead by reading the rows for INSERT, UPDATE and DELETE statements but not updating them. The rollback is then very fast with little or nothing to do. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades. Not present in and beyond.

    • Command line: --innodb-fake-changes={0|1}

    innodb_fast_checksum

    • Description: Implements a more CPU efficient XtraDB checksum algorithm, useful for write-heavy loads with high I/O. If set to 1 on a server with tables that have been created with it set to 0, reads are slower, so tables should be recreated (dumped and reloaded). XtraDB will fail to start if set to 0 and there are tables created while set to 1. Replaced with in /XtraDB 5.6.

    • Command line: --innodb-fast-checksum={0|1}

    innodb_fast_shutdown

    • Description: The shutdown mode.

      • 0 - InnoDB performs a slow shutdown, including full purge (before , not always, due to ) and change buffer merge. Can be very slow, even taking hours in extreme cases.

      • 1 - the default, performs a fast shutdown, not performing a full purge or an insert buffer merge.

    innodb_fatal_semaphore_wait_threshold

    • Description: In MariaDB, the fatal semaphore timeout is configurable. This variable sets the maximum number of seconds for semaphores to time out in InnoDB.

    • Command line: --innodb-fatal-semaphore-wait-threshold=#

    • Scope: Global

    • Dynamic: No

    innodb_file_format

    • Description: File format for new tables. Can either be Antelope, the default and the original format, or Barracuda, which supports . Note that this value is also used when a table is re-created with an which requires a table copy. See for more on the file formats. Removed in 10.3.1 and restored as a deprecated and unused variable in 10.4.3 for compatibility purposes.

    • Command line: --innodb-file-format=value

    • Scope: Global

    innodb_file_format_check

    • Description: If set to 1, the default, checks the shared tablespace file format tag. If this is higher than the current version supported by XtraDB/InnoDB (for example Barracuda when only Antelope is supported), XtraDB/InnoDB will not start. If it the value is not higher, XtraDB/InnoDB starts correctly and the value is set to this value. If innodb_file_format_check is set to 0, no checking is performed. See for more on the file formats.

    • Command line: --innodb-file-format-check={0|1}

    • Scope: Global

    innodb_file_format_max

    • Description: The highest file format. This is set to the value of the file format tag in the shared tablespace on startup (see ). If the server later creates a higher table format, innodb_file_format_max is set to that value. See for more on the file formats.

    • Command line: --innodb-file-format-max=value

    • Scope: Global

    innodb_file_per_table

    • Description: If set to ON, then new tables are created with their own . If set to OFF, then new tables are created in the instead. is only available with file-per-table tablespaces. Note that this value is also used when a table is re-created with an which requires a table copy. Deprecated in as there's no benefit to setting to OFF, the original InnoDB default.

    • Command line: --innodb-file-per-table

    innodb_fill_factor

    • Description: Percentage of B-tree page filled during bulk insert (sorted index build). Used as a hint rather than an absolute value. Setting to 70, for example, reserves 30% of the space on each B-tree page for the index to grow in future.

    • Command line: --innodb-fill-factor=#

    • Scope: Global

    innodb_flush_log_at_timeout

    • Description: Interval in seconds to write and flush the . Before MariaDB 10, this was fixed at one second, which is still the default, but this can now be changed. It's usually increased to reduce flushing and avoid impacting performance of binary log group commit.

    • Scope: Global

    • Dynamic: Yes

    • Data Type: numeric

    innodb_flush_log_at_trx_commit

    • Description: Set to 1, along with for the greatest level of fault tolerance. The value of determines whether this variable can be reset with a SET statement or not.

      • 1 The default, the log buffer is written to the file and a flush to disk performed after each transaction. This is required for full ACID compliance.

      • 0 Nothing is done on commit; rather the log buffer is written and flushed to the

    innodb_flush_method

    • Description: flushing method. Windows always uses async_unbuffered and this variable then has no effect. On Unix, before , by default fsync() is used to flush data and logs. Adjusting this variable can give performance improvements, but behavior differs widely on different filesystems, and changing from the default has caused problems in some situations, so test and benchmark carefully before adjusting. In MariaDB, Windows recognises and correctly handles the Unix methods, but if none are specified it uses own default - unbuffered write (analog of O_DIRECT) + syncs (e.g FileFlushBuffers()) for all files.

      • O_DSYNC - O_DSYNC is used to open and flush logs, and fsync() to flush the data files.

      • O_DIRECT

    innodb_flush_neighbor_pages

    • Description: Determines whether, when dirty pages are flushed to the data file, neighboring pages in the data file are flushed at the same time. If set to none, the feature is disabled. If set to area, the default, the standard InnoDB behavior is used. For each page to be flushed, dirty neighboring pages are flushed too. If there's little head seek delay, such as SSD or large enough write buffer, one of the other two options may be more efficient. If set to cont, for each page to be flushed, neighboring contiguous blocks are flushed at the same time. Being contiguous, a sequential I/O is used, unlike the random I/O used in area. Replaced by in /XtraDB 5.6.

    • Command line: innodb-flush-neighbor-pages=value

    innodb_flush_neighbors

    • Description: Determines whether flushing a page from the will flush other dirty pages in the same group of pages (extent). In high write environments, if flushing is not aggressive enough, it can fall behind resulting in higher memory usage, or if flushing is too aggressive, cause excess I/O activity. SSD devices, with low seek times, would be less likely to require dirty neighbor flushing to be set. Since an attempt is made under Windows and Linux to determine SSD status which was exposed in . This variable is ignored for table spaces that are detected as stored on SSD (and the 0 behavior applies).

      • 1: The default, flushes contiguous dirty pages in the same extent from the buffer pool.

    innodb_flush_sync

    • Description: If set to ON, the default, the setting is ignored for I/O bursts occurring at checkpoints.

    • Command line: --innodb-flush-sync={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_flushing_avg_loops

    • Description: Determines how quickly adaptive flushing will respond to changing workloads. The value is the number of iterations that a previously calculated flushing state snapshot is kept. Increasing the value smooths and slows the rate that the flushing operations change, while decreasing it causes flushing activity to spike quickly in response to workload changes.

    • Command line: --innodb-flushing-avg-loops=#

    • Scope: Global

    innodb_force_load_corrupted

    • Description: Set to 0 by default, if set to 1, are permitted to load tables marked as corrupt. Only use this to recover data you can't recover any other way, or in troubleshooting. Always restore to 0 when the returning to regular use. Given that in aims to allow any metadata for a missing or corrupted table to be dropped, and given that and and related tasks made DDL operations crash-safe, the parameter no longer serves any purpose and was removed in .

    • Command line: --innodb-force-load-corrupted

    innodb_force_primary_key

    • Description: If set to 1 (0 is default) CREATE TABLEs without a primary or unique key where all keyparts are NOT NULL will not be accepted, and will return an error.

    • Command line: --innodb-force-primary-key

    • Scope: Global

    innodb_force_recovery

    • Description: crash recovery mode. 0 is the default. The other modes are for recovery purposes only, and no data can be changed while another mode is active. Some queries relying on indexes are also blocked. See for more on mode specifics.

    • Command line: --innodb-force-recovery=#

    • Scope: Global

    innodb_foreground_preflush

    • Description: Before XtraDB 5.6.13-61.0, if the checkpoint age is in the sync preflush zone while a thread is writing to the , it will try to advance the checkpoint by issuing a flush list flush batch if this is not already being done. XtraDB has enhanced page cleaner tuning, and may already be performing furious flushing, resulting in the flush simply adding unneeded mutex pressure. Instead, the thread now waits for the flushes to finish, and then has two options, controlled by this variable. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

      • exponential_backoff - thread sleeps while it waits for the flush list flush to occur. The sleep time randomly progressively increases, periodically reset to avoid runaway sleeps.

    innodb_ft_aux_table

    • Description: Diagnostic variable intended only to be set at runtime. It specifies the qualified name (for example test/ft_innodb) of an InnoDB table that has a , and after being set the INFORMATION_SCHEMA tables , , INNODB_FT_CONFIG, , and will contain search index information for the specified table.

    • Command line: --innodb-ft-aux-table=value

    • Scope: Global

    innodb_ft_cache_size

    • Description: Cache size available for a parsed document while creating an InnoDB .

    • Command line: --innodb-ft-cache-size=#

    • Scope: Global

    • Dynamic: No

    innodb_ft_enable_diag_print

    • Description: If set to 1, additional search diagnostic output is enabled.

    • Command line: --innodb-ft-enable-diag-print={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_ft_enable_stopword

    • Description: If set to 1, the default, a set of is associated with an InnoDB when it is created. The stopword list comes from the table set by the session variable , if set, otherwise the global variable , if that is set, or the if neither variable is set.

    • Command line: --innodb-ft-enable-stopword={0|1}

    • Scope: Global

    innodb_ft_max_token_size

    • Description: Maximum length of words stored in an InnoDB . A larger limit will increase the size of the index, slowing down queries, but permit longer words to be searched for. In most normal situations, longer words are unlikely search terms.

    • Command line: --innodb-ft-max-token-size=#

    • Scope: Global

    • Dynamic: No

    innodb_ft_min_token_size

    • Description: Minimum length of words stored in an InnoDB . A smaller limit will increase the size of the index, slowing down queries, but permit shorter words to be searched for. For data stored in a Chinese, Japanese or Korean , a value of 1 should be specified to preserve functionality.

    • Command line: --innodb-ft-min-token-size=#

    • Scope: Global

    innodb_ft_num_word_optimize

    • Description: Number of words processed during each on an InnoDB . To ensure all changes are incorporated, multiple OPTIMIZE TABLE statements could be run in case of a substantial change to the index.

    • Command line: --innodb-ft-num-word-optimize=#

    • Scope: Global

    • Dynamic: Yes

    innodb_ft_result_cache_limit

    • Description: Limit in bytes of the InnoDB query result cache per fulltext query. The latter stages of the full-text search are handled in memory, and limiting this prevents excess memory usage. If the limit is exceeded, the query returns an error.

    • Command line: --innodb-ft-result-cache-limit=#

    • Scope: Global

    • Dynamic: Yes

    innodb_ft_server_stopword_table

    • Description: Table name containing a list of stopwords to ignore when creating an InnoDB , in the format db_name/table_name. The specified table must exist before this option is set, and must be an InnoDB table with a single column, a named VALUE. See also .

    • Command line: --innodb-ft-server-stopword-table=db_name/table_name

    • Scope: Global

    innodb_ft_sort_pll_degree

    • Description: Number of parallel threads used when building an InnoDB . See also .

    • Command line: --innodb-ft-sort-pll-degree=#

    • Scope: Global

    • Dynamic: No

    innodb_ft_total_cache_size

    • Description:Total memory allocated for the cache for all InnoDB tables. A force sync is triggered if this limit is exceeded.

    • Command line: --innodb-ft-total-cache-size=#

    • Scope: Global

    • Dynamic: No

    innodb_ft_user_stopword_table

    • Description: Table name containing a list of stopwords to ignore when creating an InnoDB , in the format db_name/table_name. The specified table must exist before this option is set, and must be an InnoDB table with a single column, a named VALUE. See also .

    • Command line: --innodb-ft-user-stopword-table=db_name/table_name

    • Scope: Session

    innodb_ibuf_accel_rate

    • Description: Allows the insert buffer activity to be adjusted. The following formula is used: [real activity] = [default activity] * (innodb_io_capacity/100) * (innodb_ibuf_accel_rate/100). As innodb_ibuf_accel_rate is increased from its default value of 100, the lowest setting, insert buffer activity is increased. See also . This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Command line: innodb-ibuf-accel-rate=#

    • Scope: Global

    innodb_ibuf_active_contract

    • Description: Specifies whether the insert buffer can be processed before it's full. If set to 0, the standard InnoDB method is used, and the buffer is not processed until it's full. If set to 1, the default, the insert buffer can be processed before it is full. This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Command line: innodb-ibuf-active-contract=#

    • Scope: Global

    innodb_ibuf_max_size

    • Description: Maximum size in bytes of the insert buffer. Defaults to half the size of the so you may want to reduce if you have a very large buffer pool. If set to 0, the insert buffer is disabled, which will cause all secondary index updates to be performed synchronously, usually at a cost to performance. This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Command line: innodb-ibuf-max-size=#

    • Scope: Global

    innodb_idle_flush_pct

    • Description: Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so. Has had no effect since merging InnoDB 5.7 from mysql-5.7.9 (). Deprecated in , , and removed in .

    • Command line: --innodb-idle-flush-pct=#

    • Scope: Global

    innodb_immediate_scrub_data_uncompressed

    • Description: Enable scrubbing of data. See .

    • Command line: --innodb-immediate-scrub-data-uncompressed={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_import_table_from_xtrabackup

    • Description: If set to 1, permits importing of .ibd files exported with the --export option. Previously named innodb_expand_import. Removed in /XtraDB 5.6 and replaced with MySQL 5.6's transportable tablespaces.

    • Command line: innodb-import-table-from-xtrabackup=#

    • Scope: Global

    innodb_instant_alter_column_allowed

    • Description:

      • If a table is altered using ALGORITHM=INSTANT, it can force the table to use a non-canonical format: A hidden metadata record at the start of the clustered index is used to store each column's DEFAULT value. This makes it possible to add new columns that have default values without rebuilding the table. Starting with , a BLOB in the hidden metadata record is used to store column mappings. This makes it possible to drop or reorder columns without rebuilding the table. This also makes it possible to add columns to any position or drop columns from any position in the table without rebuilding the table. If a column is dropped without rebuilding the table, old records will contain garbage in that column's former position, and new records are written with NULL values, empty strings, or dummy values.

      • This is generally not a problem. However, there may be cases where you want to avoid putting a table into this format. For example, to ensure that future UPDATE operations after an ADD COLUMN are performed in-place, to reduce write amplification. (Instantly added columns are essentially always variable-length.) Also avoid bugs similar to

    innodb_instrument_semaphores

    • Description: Enable semaphore request instrumentation. This could have some effect on performance but allows better information on long semaphore wait problems.

    • Command line: --innodb-instrument-semaphores={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_io_capacity

    • Description: Limit on I/O activity for InnoDB background tasks, including merging data from the insert buffer and flushing pages. Should be set to around the number of I/O operations per second that system can handle, based on the type of drive/s being used. You can also set it higher when the server starts to help with the extra workload at that time, and then reduce for normal use. Ideally, opt for a lower setting, as at higher value data is removed from the buffers too quickly, reducing the effectiveness of caching. See also .

      • See for more information.

    • Command line: --innodb-io-capacity=#

    innodb_io_capacity_max

    • Description: Upper limit to which InnoDB can extend in case of emergency. See for more information.

    • Command line: --innodb-io-capacity-max=#

    • Scope: Global

    • Dynamic: Yes

    innodb_kill_idle_transaction

    • Description: Time in seconds before killing an idle XtraDB transaction. If set to 0 (the default), the feature is disabled. Used to prevent accidental user locks. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Scope: Global

    • Dynamic: Yes

    • Data Type:

    innodb_large_prefix

    • Description: If set to 1, tables that use specific are permitted to have index key prefixes up to 3072 bytes (for 16k pages, ). If not set, the limit is 767 bytes.

      • This applies to the and row formats.

      • Removed in 10.3.1 and restored as a deprecated and unused variable in 10.4.3 for compatibility purposes.

    innodb_lazy_drop_table

    • Description: Deprecated and removed in XtraDB 5.6. processing can take a long time when is set to 1 and there's a large . If innodb_lazy_drop_table is set to 1 (0 is default), XtraDB attempts to optimize processing by deferring the dropping of related pages from the until there is time, only initially marking them.

    • Command line: innodb-lazy-drop-table={0|1}

    innodb_lock_schedule_algorithm

    • Description: Removed in due to problems with the VATS implementation (). Specifies the algorithm that InnoDB uses to decide which of the waiting transactions should be granted the lock once it has been released. The possible values are: FCFS (First-Come-First-Served) where locks are granted in the order they appear in the lock queue and VATS (Variance-Aware-Transaction-Scheduling) where locks are granted based on the Eldest-Transaction-First heuristic. Note that VATS should not be used with , and InnoDB will refuse to start if VATS is used with Galera. It is also not recommended to set to VATS even in the general case (). From , the value was changed to FCFS and a warning produced when using Galera.

    innodb_lock_wait_timeout

    • Description: Time in seconds that an InnoDB transaction waits for an InnoDB record lock (or table lock) before giving up with the error ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction. When this occurs, the statement (not transaction) is rolled back. The whole transaction can be rolled back if the option is used. Increase this for data warehousing applications or where other long-running operations are common, or decrease for OLTP and other highly interactive applications. This setting does not apply to deadlocks, which InnoDB detects immediately, rolling back a deadlocked transaction. 0 means no wait. See . Setting to 100000000 or more (from , 100000000 is the maximum) means the timeout is infinite.

    • Command line: --innodb-lock-wait-timeout=#

    innodb_locking_fake_changes

    • Description: From to , XtraDB-only option that if set to OFF, fake transactions (see ) don't take row locks. This is an experimental feature to attempt to deal with drawbacks in fake changes blocking real locks. It is not safe for use in all environments. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: --innodb-locking-fake-changes

    • Scope: Global

    innodb_locks_unsafe_for_binlog

    • Description: Set to 0 by default, in which case XtraDB/InnoDB uses . If set to 1, gap locking is disabled for searches and index scans. Deprecated in , and removed in , use instead.

    • Command line: --innodb-locks-unsafe-for-binlog

    • Scope: Global

    innodb_log_arch_dir

    • Description: The directory for archiving. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: --innodb-log-arch-dir=name

    • Scope: Global

    • Dynamic: No

    innodb_log_arch_expire_sec

    • Description: Time in seconds since the last change after which the archived should be deleted. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: --innodb-log-arch-expire-sec=#

    • Scope: Global

    • Dynamic: Yes

    innodb_log_archive

    • Description: Whether or not archiving is enabled. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: --innodb-log-archive={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_log_block_size

    • Description: Size in bytes of the records. Generally 512, the default, or 4096, are the only two useful values. If the server is restarted and this value is changed, all old log files need to be removed. Should be set to 4096 for SSD cards or if is set to ALL_O_DIRECT on ext4 filesystems. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-log-block-size=#

    innodb_log_buffer_size

    • Description: Size in bytes of the buffer for writing files to disk. Increasing this means larger transactions can run without needing to perform disk I/O before committing.

    • Command line: --innodb-log-buffer-size=#

    • Scope: Global

    • Dynamic: No

    innodb_log_checkpoint_now

    • Description: Write back dirty pages from the and update the log checkpoint. Prior to , , was only available in debug builds. Introduced in order to force checkpoints before a backup, allowing mariadb-backup to create much smaller incremental backups. However, this comes at the cost of heavy I/O usage and it is now disabled by default.

    • Command line: --innodb-log-checkpoint{=1|0}

    • Scope: Global

    innodb_log_checksum_algorithm

    • Description: Experimental feature (as of ), this variable specifies how to generate and verify checksums. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

      • none - No checksum. A constant value is instead written to logs, and no checksum validation is performed.

      • innodb - The default, and the original InnoDB algorithm. This is inefficient, but compatible with all MySQL, MariaDB and Percona versions that don't support other checksum algorithms.

    innodb_log_checksums

    • Description: If set to 1, the CRC32C for Innodb or innodb_log_checksum_algorithm for XtraDB algorithm is used for pages. If disabled, the checksum field contents are ignored. From , the variable is deprecated, and checksums are always calculated, as previously, the InnoDB redo log used the slow innodb algorithm, but with hardware or SIMD assisted CRC-32C computation being available, there is no reason to allow checksums to be disabled on the redo log.

    • Command line: innodb-log-checksums={0|1}

    • Scope: Global

    innodb_log_compressed_pages

    • Description: Whether or not images of recompressed pages are stored in the . Deprecated and ignored from .

    • Command line: --innodb-log-compressed-pages={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_log_file_buffering

    • Description: Whether the file system cache for ib_logfile0 is enabled. In , MariaDB disabled the file system cache on the InnoDB write-ahead log file (ib_logfile0) by default on Linux. With in particular, writing to the log via the file system cache typically improves throughput, especially on slow storage or at a small number of concurrent transactions. For other values of innodb_flush_log_at_trx_commit, direct writes were observed to be mostly but not always faster. Whether it pays off to disable the file system cache on the log may depend on the type of storage, the workload, and the operating system kernel version. If the server is started up with , the value are changed to ON. Will be set to OFF if is set to O_DSYNC. On Linux, when the physical block size cannot be determined to be a power of 2 between 64 and 4096 bytes, the file system cache cannot be disabled, and innodb_log_file_buffering=ON cannot be changed. Linux and Windows only.

    • Command line: --innodb-log-file-buffering={0|1}

    innodb_log_file_mmap

    • Description: Whether ib_logfile0 resides in persistent memory or should initially be memory-mapped. When using the default innodb_log_buffer_size=2m, mariadb-backup --backup would spend a lot of time re-reading and re-parsing the log. For reading the log file during mariadb-backup --backup, it is beneficial to memory-map the entire ib_logfile0 to the address space (typically 48 bits or 256 TiB) and read it from there, both during --backup and --prepare. OFF by default on most platforms, to avoid aggressive read-ahead of the entire ib_logfile0 in when only a tiny portion would be accessed. On Linux and FreeBSD the default is innodb_log_file_mmap=ON, because those platforms define a specific mmap(2) option for enabling such read-ahead and therefore it can be assumed that the default wouldbe on-demand paging. This parameter will only have impact on the initial InnoDB startup and recovery. Any writes to the log will use regular I/O, except when the ib_logfile0 is stored in a specially configured file system that is backed by persistent memory (Linux "mount -o dax").

    • Command line: --innodb-log-file-mmap{=0|1}

    innodb_log_file_size

    • Description: Size in bytes of each file in the log group. The combined size can be no more than 512GB. Larger values mean less disk I/O due to less flushing checkpoint activity, but also slower recovery from a crash. In , crash recovery has been improved and shouldn't run out of memory, so the default has been increased. It can safely be set higher to reduce checkpoint flushing, even larger than .From the variable is dynamic, and the server no longer needs to be restarted for the resizing to take place. Unless the log is located in a persistent memory file system (PMEM), an attempt to innodb_log_file_size to less than are refused. Log resizing can be aborted by killing the connection that is executing the SET GLOBAL statement.

    • Command line: --innodb-log-file-size=#

    • Scope: Global

    innodb_log_file_write_through

    • Description: Whether each write to ib_logfile0 is write through (disabling any caching, as in O_SYNC or O_DSYNC). Set to OFF by default, are set to ON if is set to O_DSYNC. On systems that support FUA it may make sense to enable write-through, to avoid extra system calls.

    • Command line: --innodb-log-file-write-through={0|1}

    • Scope: Global

    innodb_log_files_in_group

    • Description: Number of physical files in the . Deprecated and ignored from

    • Command line: --innodb-log-files-in-group=#

    • Scope: Global

    • Dynamic: No

    innodb_log_group_home_dir

    • Description: Path to the files. If none is specified, files named ib_logfile0 and so on, with a size of are created in the data directory.

    • Command line: --innodb-log-group-home-dir=path

    • Scope: Global

    • Dynamic: No

    innodb_log_optimize_ddl

    • Description: Whether activity should be reduced when natively creating indexes or rebuilding tables. Reduced logging requires additional page flushing and interferes with . Enabling this may slow down backup and cause delay due to page flushing. Deprecated and ignored from . Deprecated (but not ignored) from , and .

    • Command line: --innodb-log-optimize-ddl={0|1}

    • Scope: Global

    innodb_log_spin_wait_delay

    • Description: Delay between log buffer spin lock polls (0 to use a blocking latch). Specifically, enables a spin lock that will execute that many MY_RELAX_CPU() operations (such as the x86 PAUSE instruction) between successive attempts of acquiring the spin lock. On some hardware with certain workloads (observed on write intensive workloads on NUMA systems), the default setting results in a significant amount of time being spent in native_queued_spin_lock_slowpath() in the Linux kernel, plus context switching between user and kernel address space, in which case changing from the default (for example, setting to 50), may result in a performance improvement.

    • Command line: --innodb-log-spin-wait-delay=#

    • Scope: Global

    innodb_log_write_ahead_size

    • Description: write ahead unit size to avoid read-on-write. Should match the OS cache block IO size. Removed in , and instead on Linux and Windows, the physical block size of the underlying storage is detected and used. Reintroduced in and later versions. On Linux and Windows, the default or the specified innodb_log_write_ahead_size are automatically adjusted to not be less than the physical block size (if it can be determined).

    • Command line: --innodb-log-write-ahead-size=#

    • Scope: Global

    innodb_lru_flush_size

    • Description: Number of pages to flush on LRU eviction. Changes in , , , , and made this setting superfluous, and it is no longer used.

    • Command line: --innodb-lru-flush-size=#

    • Scope: Global

    innodb_lru_scan_depth

    • Description: Specifies how far down the buffer pool least-recently used (LRU) list the cleaning thread should look for dirty pages to flush. This process is performed once a second. In an I/O intensive-workload, can be increased if there is spare I/O capacity, or decreased if in a write-intensive workload with little spare I/O capacity.

      • See for more information.

    • Command line: --innodb-lru-scan-depth=#

    innodb_max_bitmap_file_size

    • Description: Limit in bytes of the changed page bitmap files. For faster incremental backup with , XtraDB tracks pages with changes written to them according to the and writes the information to special changed page bitmap files. These files are rotated when the server restarts or when this limit is reached. XtraDB only. See also and .

      • Deprecated and ignored in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-max-bitmap-file-size=#

    innodb_max_changed_pages

    • Description: Limit to the number of changed page bitmap files (stored in the ). Zero is unlimited. See and . Previously named innodb_changed_pages_limit. XtraDB only.

      • Deprecated and ignored in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-max-changed-pages=#

    innodb_max_dirty_pages_pct

    • Description: Maximum percentage of unwritten (dirty) pages in the buffer pool.

      • See for more information.

    • Command line: --innodb-max-dirty-pages-pct=#

    • Scope: Global

    innodb_max_dirty_pages_pct_lwm

    • Description: Low water mark percentage of dirty pages that will enable preflushing to lower the dirty page ratio. The value 0 (default) means 'refer to '. (Note that 0 meant 0 in 10.5.7 to 10.5.8, but was then reverted back to "same as innodb_max_dirty_pages_pct" again in 10.5.9)

      • See for more information.

    • Command line: --innodb-max-dirty-pages-pct-lwm=#

    innodb_max_purge_lag

    • Description: When purge operations are lagging on a busy server, setting innodb_max_purge_lag can help. By default set to 0, no lag, the figure is used to calculate a time lag for each INSERT, UPDATE, and DELETE when the system is lagging. InnoDB keeps a list of transactions with delete-marked index records due to UPDATE and DELETE statements. The length of this list is purge_lag, and the calculation, performed every ten seconds, is as follows: ((purge_lag/innodb_max_purge_lag)×10)–5 microseconds.

    • Command line: --innodb-max-purge-lag=#

    • Scope: Global

    innodb_max_purge_lag_delay

    • Description: Maximum delay in milliseconds imposed by the setting. If set to 0, the default, there is no maximum.

    • Command line: --innodb-max-purge-lag-delay=#

    • Scope: Global

    • Dynamic: Yes

    innodb_max_purge_lag_wait

    • Description: Wait until History list length is below the specified limit.

    • Command line: --innodb-max-purge-wait=#

    • Scope: Global

    • Dynamic: Yes

    innodb_max_undo_log_size

    • Description: If an undo tablespace is larger than this, it is marked for truncation if is set.

    • Command line: --innodb-max-undo-log-size=#

    • Scope: Global

    • Dynamic: Yes

    innodb_merge_sort_block_size

    • Description: Size in bytes of the block used for merge sorting in fast index creation. Replaced in /XtraDB 5.6 by .

    • Command line: innodb-merge-sort-block-size=#

    • Scope: Global

    • Dynamic: Yes

    innodb_mirrored_log_groups

    • Description: Unused. Restored as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Deprecated:

    • Removed: -

    innodb_mtflush_threads

    • Description: Sets the number of threads to use in Multi-Threaded Flush operations. For more information, see .

      • InnoDB's multi-thread flush feature was deprecated in and removed from . In later versions of MariaDB, use system variable instead.

      • See for more information.

    innodb_monitor_disable

    • Description: Disables the specified counters in the table.

    • Command line: --innodb-monitor-disable=string

    • Scope: Global

    • Dynamic: Yes

    innodb_monitor_enable

    • Description: Enables the specified counters in the table.

    • Command line: --innodb-monitor-enable=string

    • Scope: Global

    • Dynamic: Yes

    innodb_monitor_reset

    • Description: Resets the count value of the specified counters in the table to zero.

    • Command line: --innodb-monitor-reset=string

    • Scope: Global

    • Dynamic: Yes

    innodb_monitor_reset_all

    • Description: Resets all values for the specified counters in the table.

    • Command line: ---innodb-monitor-reset-all=string

    • Scope: Global

    • Dynamic: Yes

    innodb_numa_interleave

    • Description: Whether or not to use the NUMA interleave memory policy to allocate the . Before , required that MariaDB be compiled on a NUMA-enabled Linux system.

    • Command line: innodb-numa-interleave={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_old_blocks_pct

    • Description: Percentage of the to use for the old block sublist.

    • Command line: --innodb-old-blocks-pct=#

    • Scope: Global

    • Dynamic: Yes

    innodb_old_blocks_time

    • Description: Time in milliseconds an inserted block must stay in the old sublist after its first access before it can be moved to the new sublist. '0' means "no delay". Setting a non-zero value can help prevent full table scans clogging the . See also .

    • Command line: --innodb-old-blocks-time=#

    • Scope: Global

    • Dynamic: Yes

    innodb_online_alter_log_max_size

    • Description: The maximum size for temporary log files during online DDL (data and index structure changes). The temporary log file is used for each table being altered, or index being created, to store data changes to the table while the process is underway. The table is extended by up to the limit set by this variable. If this limit is exceeded, the online DDL operation fails and all uncommitted changes are rolled back. A lower value reduces the time a table could lock at the end of the operation to apply all the log's changes, but also increases the chance of the online DDL changes failing.

    • Command line: --innodb-online-alter-log-max-size=#

    • Scope: Global

    innodb_open_files

    • Description: Maximum .ibd files MariaDB can have open at the same time. Only applies to systems with multiple XtraDB/InnoDB tablespaces, and is separate to the table cache and . The default, if is disabled, is 300 or the value of , whichever is higher. It will also auto-size up to the default value if it is set to a value less than 10.

    • Command line: --innodb-open-files=#

    • Scope: Global

    innodb_optimize_fulltext_only

    • Description: When set to 1 (0 is default), will only process InnoDB data. Only intended for use during fulltext index maintenance.

    • Command line: --innodb-optimize-fulltext-only={0|1}

    • Scope: Global

    innodb_page_cleaners

    • Description: Number of page cleaner threads. The default is 4, but the value are set to the number of if this is lower. If set to 1, only a single cleaner thread is used, as was the case until . Cleaner threads flush dirty pages from the , performing flush list and least-recently used (LRU) flushing. Deprecated and ignored from , as the original reasons for splitting the buffer pool have mostly gone away.

      • See for more information.

    • Command line:

    innodb_page_size

    • Description: Specifies the page size in bytes for all InnoDB tablespaces. The default, 16k, is suitable for most uses.

      • A smaller InnoDB page size might work more effectively in a situation with many small writes (OLTP), or with SSD storage, which usually has smaller block sizes.

      • A larger InnoDB page size can provide a larger .

    innodb_pass_corrupt_table

    • Removed: XtraDB 5.5 - renamed .

    innodb_prefix_index_cluster_optimization

    • Description: Enable prefix optimization to sometimes avoid cluster index lookups. Deprecated and ignored from , as the optimization is now always enabled.

    • Command line: --innodb-prefix-index-cluster-optimization={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_print_all_deadlocks

    • Description: If set to 1 (0 is default), all InnoDB transaction deadlock information is written to the .

    • Command line: --innodb-print-all-deadlocks={0|1}

    • Scope: Global

    innodb_purge_batch_size

    • Description: Number of pages to purge in one batch from the history list. Together with has a small effect on tuning.

    • Command line: --innodb-purge-batch-size=#

    • Scope: Global

    • Dynamic: No

    innodb_purge_rseg_truncate_frequency

    • Description: Frequency with which undo records are purged. Set by default to every 128 times, reducing this increases the frequency at which rollback segments are freed. See also . The motivation for introducing this in MySQL seems to have been to avoid stalls due to freeing undo log pages or truncating undo log tablespaces. In MariaDB, should be a much lighter operation because it will not involve any log checkpoint, hence this is deprecated and ignored from , , , , and . ()

    • Command line: -- innodb-purge-rseg-truncate-frequency=#

    • Scope: Global

    innodb_purge_threads

    • Description: Number of background threads dedicated to InnoDB purge operations. The range is 1 to 32. At least one background thread is always used. Setting to a value greater than 1 creates that many separate purge threads. This can improve efficiency in some cases, such as when performing DML operations on many tables. See also .

    • Command line: --innodb-purge-threads=#

    • Scope: Global

    innodb_random_read_ahead

    • Description: Originally, random read-ahead was always set as an optimization technique, but was removed in . innodb_random_read_ahead permits it to be re-instated if set to 1 (0) is default.

    • Command line: --innodb-random-read-ahead={0|1}

    • Scope: Global

    innodb_read_ahead

    • Description: If set to linear, the default, XtraDB/InnoDB will automatically fetch remaining pages if there are enough within the same extent that can be accessed sequentially. If set to none, read-ahead is disabled. random has been removed and is now ignored, while both sets to both linear and random. Also see for more control on read-aheads. Removed in /XtraDB 5.6 and replaced by MySQL 5.6's .

    • Command line: innodb-read-ahead=value

    innodb_read_ahead_threshold

    • Description: Minimum number of pages InnoDB must read sequentially from an extent of 64 before initiating an asynchronous read for the following extent.

    • Command line: --innodb-read-ahead-threshold=#

    • Scope: Global

    • Dynamic: Yes

    innodb_read_io_threads

    • Description: Prior to , this was simply the number of I/O threads for InnoDB reads. From , asynchronous I/O functionality in the InnoDB Background Thread Pool replaces the old InnoDB I/O Threads. This variable is now multiplied by 256 to determine the maximum number of concurrent asynchronous I/O read requests that can be completed by the Background Thread Pool. The default is therefore 4*256 = 1024 conccurrent asynchronous read requests. You may on rare occasions need to reduce this default on Linux systems running multiple MariaDB servers to avoid exceeding system limits, or increase if spending too much time waiting on I/O requests.

    • Command line: --innodb-read-io-threads=#

    • Scope: Global

    innodb_read_only

    • Description: If set to 1 (0 is default), the server are read-only. For use in distributed applications, data warehouses or read-only media.

    • Command line: --innodb-read-only={0|1}

    • Scope: Global

    innodb_read_only_compressed

    • Description: If set (the default before ), tables are read-only. This was intended to be the first step towards removing write support and deprecating the feature, but this plan has been abandoned.

    • Command line: --innodb-read-only-compressed, --skip-innodb-read-only-compressed

    • Scope: Global

    innodb_recovery_stats

    • Description: If set to 1 (0 is default) and recovery is necessary on startup, the server will write detailed recovery statistics to the error log at the end of the recovery process. This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Command line: No

    • Scope: Global

    innodb_recovery_update_relay_log

    • Description: If set to 1 (0 is default), the relay log info file are overwritten on crash recovery if the information differs from the InnoDB record. Should not be used if multiple storage engine types are being replicated. Previously named innodb_overwrite_relay_log_info. Removed in /XtraDB 5.6 and replaced by MySQL 5.6's relay-log-recovery

    • Command line: innodb-recovery-update-relay-log={0|1}

    innodb_replication_delay

    • Description: Time in milliseconds for the replica server to delay the replication thread if is reached. Deprecated and ignored from .

    • Command line: --innodb-replication-delay=#

    • Scope: Global

    • Dynamic: Yes

    innodb_rollback_on_timeout

    • Description: InnoDB usually rolls back the last statement of a transaction that's been timed out (see ). If innodb_rollback_on_timeout is set to 1 (0 is default), InnoDB will roll back the entire transaction. Before , rolling back the entire transaction was the default behavior.

    • Command line: --innodb-rollback-on-timeout

    • Scope: Global

    • Dynamic: No

    innodb_rollback_segments

    • Description: Specifies the number of rollback segments that XtraDB/InnoDB will use within a transaction (see ). Deprecated and replaced by in . Removed in as part of an InnoDB cleanup, as it makes sense to always create and use the maximum number of rollback segments. |

    • Command line: --innodb-rollback-segments=#

    • Scope: Global

    innodb_safe_truncate

    • Description: Use a backup-safe implementation and crash-safe rename operations inside InnoDB. This is not compatible with hot backup tools other than . Users who need to use such tools may set this to OFF.

    • Command line: --innodb-safe-truncate={0|1}

    • Scope: Global

    innodb_scrub_log

    • Description: Enable scrubbing. See . Deprecated and ignored from , as never really worked ( and ). If old log contents should be kept secret, then enabling or setting a smaller could help.

    • Command line: --innodb-scrub-log

    • Scope: Global

    innodb_scrub_log_interval

    • Description: Used with in 10.1.3 only - replaced in 10.1.4 by . scrubbing interval in milliseconds.

    • Command line: --innodb-scrub-log-interval=#

    • Scope: Global

    • Dynamic: Yes

    innodb_scrub_log_speed

    • Description: scrubbing speed in bytes/sec. See . Deprecated and ignored from .

    • Command line: --innodb-scrub-log-speed=#

    • Scope: Global

    • Dynamic: Yes

    innodb_sched_priority_cleaner

    • Description: Set a thread scheduling priority for cleaner and least-recently used (LRU) manager threads. The range from 0 to 39 corresponds in reverse order to Linux nice values of -20 to 19. So 0 is the lowest priority (Linux nice value 19) and 39 is the highest priority (Linux nice value -20). XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    innodb_show_locks_held

    • Description: Specifies the number of locks held for each InnoDB transaction to be displayed in output. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-show-locks-held=#

    • Scope: Global

    • Dynamic: Yes

    innodb_show_verbose_locks

    • Description: If set to 1, and is also ON, the traditional InnoDB behavior is followed and locked records are shown in output. If set to 0, the default, only high-level information about the lock is shown. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-show-verbose-locks=#

    • Scope: Global

    innodb_simulate_comp_failures

    • Description: Simulate compression failures. Used for testing robustness against random compression failures. XtraDB only.

    • Command line: None

    • Scope: Global

    • Dynamic: Yes

    innodb_snapshot_isolation

    • Description: Use snapshot isolation (write-write conflict detection). If set, if an attempt to acquire a lock on a record that does not exist in the current read view is made, an error DB_RECORD_CHANGED (HA_ERR_RECORD_CHANGED, ER_CHECKREAD) are raised. This error are treated in the same way as a deadlock and the transaction are rolled back. When set, the default isolation level, arecome Snapshot Isolation. Prior to , the default is OFF for backwards compatibility.

    • Command line: --innodb-snapshot-isolation={0|1}

    • Scope: Global, Session

    innodb_sort_buffer_size

    • Description: Size of the sort buffers used for sorting data when an InnoDB index is created, as well as the amount by which the temporary log file is extended during online DDL operations to record concurrent writes. The larger the setting, the fewer merge phases are required between buffers while sorting. When a or creates a new index, three buffers of this size are allocated, as well as pointers for the rows in the buffer.

    • Command line: --innodb-sort-buffer-size=#

    • Scope: Global

    innodb_spin_wait_delay

    • Description: Maximum delay (not strictly corresponding to a time unit) between spin lock polls. Default changed from 6 to 4 in , as this was verified to give the best throughput by OLTP update index and read-write benchmarks on Intel Broadwell (2/20/40) and ARM (1/46/46).

    • Command line: --innodb-log-spin-wait-delay=#

    • Scope: Global

    innodb_stats_auto_recalc

    • Description: If set to 1 (the default), persistent statistics are automatically recalculated when the table changes significantly (more than 10% of the rows). Affects tables created or altered with STATS_PERSISTENT=1 (see ), or when is enabled. determines how much data to sample when recalculating. See .

    • Command line: --innodb-stats-auto-recalc={0|1}

    • Scope: Global

    innodb_stats_auto_update

    • Description: If set to 0 (1 is default), index statistics will not be automatically calculated except when an is run, or the table is first opened. Replaced by in /XtraDB 5.6.

    • Scope: Global

    • Dynamic: Yes

    innodb_stats_include_delete_marked

    • Description: Include delete marked records when calculating persistent statistics.

    • Scope: Global

    • Dynamic: Yes

    • Data Type: boolean

    innodb_stats_method

    • Description: Determines how NULLs are treated for InnoDB index statistics purposes.

      • nulls_equal: The default, all NULL index values are treated as a single group. This is usually fine, but if you have large numbers of NULLs the average group size is slanted higher, and the optimizer may miss using the index for ref accesses when it would be useful.

      • nulls_unequal: The opposite approach to nulls_equal is taken, with each NULL forming its own group of one. Conversely, the average group size is slanted lower, and the optimizer may use the index for ref accesses when not suitable.

    innodb_stats_modified_counter

    • Description: The number of rows modified before we calculate new statistics. If set to 0, the default, current limits are used.

    • Command line: --innodb-stats-modified-counter=#

    • Scope: Global

    • Dynamic: Yes

    innodb_stats_on_metadata

    • Description: If set to 1, the default, XtraDB/InnoDB updates statistics when accessing the INFORMATION_SCHEMA.TABLES or INFORMATION_SCHEMA.STATISTICS tables, and when running metadata statements such as or . If set to 0, statistics are not updated at those times, which can reduce the access time for large schemas, as well as make execution plans more stable.

    • Command line: --innodb-stats-on-metadata

    • Scope: Global

    innodb_stats_persistent

    • Description: produces index statistics, and this setting determines whether they are stored on disk, or be required to be recalculated more frequently, such as when the server restarts. This information is stored for each table, and can be set with the STATS_PERSISTENT clause when creating or altering tables (see ). See .

    • Command line: --innodb-stats-persistent={0|1}

    • Scope: Global

    innodb_stats_persistent_sample_pages

    • Description: Number of index pages sampled when estimating cardinality and statistics for indexed columns. Increasing this value will increases index statistics accuracy, but use more I/O resources when running . See .

    • Command line: --innodb-stats-persistent-sample-pages=#

    • Scope: Global

    • Dynamic: Yes

    innodb_stats_sample_pages

    • Description: Gives control over the index distribution statistics by determining the number of index pages to sample. Higher values produce more disk I/O, but, especially for large tables, produce more accurate statistics and therefore make more effective use of the query optimizer. Lower values than the default are not recommended, as the statistics can be quite inaccurate.

      • If is enabled, then the exact number of pages configured by this system variable are sampled for statistics.

      • If is disabled, then the number of pages to sample for statistics is calculated using a logarithmic algorithm, so the exact number can change depending on the size of the table. This means that more samples may be used for larger tables.

    innodb_stats_traditional

    • Description: This system variable affects how the number of pages to sample for transient statistics is determined, in particular how is used.

      • If is enabled, then the exact number of pages configured by the system variable are sampled for statistics.

      • If is disabled, then the number of pages to sample for statistics is calculated using a logarithmic algorithm, so the exact number can change depending on the size of the table. This means that more samples may be used for larger tables.

    innodb_stats_transient_sample_pages

    • Description: Gives control over the index distribution statistics by determining the number of index pages to sample. Higher values produce more disk I/O, but, especially for large tables, produce more accurate statistics and therefore make more effective use of the query optimizer. Lower values than the default are not recommended, as the statistics can be quite inaccurate.

      • If is enabled, then the exact number of pages configured by this system variable are sampled for statistics.

      • If is disabled, then the number of pages to sample for statistics is calculated using a logarithmic algorithm, so the exact number can change depending on the size of the table. This means that more samples may be used for larger tables.

    innodb_stats_update_need_lock

    • Description: Setting to 0 (1 is default) may help reduce contention of the &dict_operation_lock, but also disables the Data_free option in . This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Scope: Global

    • Dynamic: Yes

    innodb_status_output

    • Description: Enable output to the .

    • Command line: --innodb-status-output={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_status_output_locks

    • Description: Enable output to the and . Also requires to enable output to the error log.

    • Command line: --innodb-status-output-locks={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_strict_mode

    • Description: If set to 1 (the default), InnoDB will return errors instead of warnings in certain cases, similar to strict SQL mode. See for details.

    • Command line: --innodb-strict-mode={0|1}

    • Scope: Global, Session

    innodb_support_xa

    • Description: If set to 1, the default, are supported. XA support ensures data is written to the in the same order to the actual database, which is critical for and disaster recovery, but comes at a small performance cost. If your database is set up to only permit one thread to change data (for example, on a replication replica with only the replication thread writing), it is safe to turn this option off. Removed in , XA transactions are always supported.

    • Command line: --innodb-support-xa

    • Scope: Global, Session

    innodb_sync_array_size

    • Description: By default 1, can be increased to split internal thread co-ordinating, giving higher concurrency when there are many waiting threads.

    • Command line: --innodb-sync-array-size=#

    • Scope: Global

    • Dynamic: No

    innodb_sync_spin_loops

    • Description: The number of times a thread waits for an InnoDB mutex to be freed before the thread is suspended.

    • Command line: --innodb-sync-spin-loops=#

    • Scope: Global

    • Dynamic: Yes

    innodb_table_locks

    • Description: If is set to 0 (1 is default), setting innodb_table_locks to 1, the default, will cause InnoDB to lock a table internally upon a .

    • Command line: --innodb-table-locks

    • Scope: Global, Session

    innodb_thread_concurrency

    • Description: Once this number of threads is reached (excluding threads waiting for locks), XtraDB/InnoDB will place new threads in a wait state in a first-in, first-out queue for execution, in order to limit the number of threads running concurrently. A setting of 0, the default, permits as many threads as necessary. A suggested setting is twice the number of CPU's plus the number of disks. Deprecated and ignored from .

    • Command line: --innodb-thread-concurrency=#

    • Scope: Global

    innodb_thread_concurrency_timer_based

    • Description: If set to 1, thread concurrency are handled in a lock-free timer-based manner rather than the default mutex-based method. Depends on atomic op builtins being available. This Percona XtraDB variable has not been ported to XtraDB 5.6.

    • Command line: innodb-thread-concurrency-timer-based={0|1}

    • Scope: Global

    innodb_thread_sleep_delay

    • Description: Time in microseconds that InnoDB threads sleep before joining the queue. Setting to 0 disables sleep. Deprecated and ignored from

    • Command line: --innodb-thread-sleep-delay=#

    • Scope: Global

    innodb_temp_data_file_path

    • Description: Path where to store data for temporary tables. Argument is filename:size followed by options separated by ':' Multiple paths can be given separated by ';' A file size is specified (with K for kilobytes, M for megabytes and G for gigabytes). Also whether or not to autoextend the data file, max size and whether or not to on startup may also be specified.

    • Command line: --innodb-temp-data-file-path=path

    innodb_tmpdir

    • Description: Allows an alternate location to be set for temporary non-tablespace files. If not set (the default), files are created in the usual location. Alternate location must be outside of datadir

    • Command line: --innodb-tmpdir=path

    • Scope: Global

    innodb_track_changed_pages

    • Description: For faster incremental backup with , XtraDB tracks pages with changes written to them according to the and writes the information to special changed page bitmap files. This read-only variable is used for controlling this feature. See also and . XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-track-changed-pages={0|1}

    • Scope: Global

    innodb_track_redo_log_now

    • Description: Available on debug builds only. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-track-redo-log-now={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_truncate_temporary_tablespace_now

    • Description: Set to ON to shrink the temporary tablespace.

    • Command line: innodb-truncate-temporary-tablespace-now={0|1}

    • Scope: Global

    • Dynamic: Yes

    innodb_undo_directory

    • Description: Path to the directory (relative or absolute) that InnoDB uses to create separate tablespaces for the . . (the default value before 10.2.2) leaves the undo logs in the same directory as the other log files. From , the default value is NULL, and if no path is specified, undo tablespaces are created in the directory defined by . Use together with and . Undo logs are most usefully placed on a separate storage device.

    • Command line: --innodb-undo-directory=name

    • Scope: Global

    innodb_undo_log_truncate

    • Description: When enabled, that are larger than are marked for truncation. See also . Enabling this setting may cause stalls during heavy write workloads.

    • Command line: --innodb-undo-log-truncate[={0|1}]

    • Scope: Global

    • Dynamic: Yes

    innodb_undo_logs

    • Description: Specifies the number of rollback segments that XtraDB/InnoDB will use within a transaction (or the number of active ). By default set to the maximum, 128, it can be reduced to avoid allocating unneeded rollback segments. See the status variable for the number of undo logs available. See also and . Replaced in . The contains information about the XtraDB rollback segments. Deprecated and ignored in , as it always makes sense to use the maximum number of rollback segments.

    • Command line: --innodb-undo-logs=#

    innodb_undo_tablespaces

    • Description: Number of tablespaces files used for dividing up the . Zero (the default before ) means that undo logs are all part of the system tablespace, which contains one undo tablespace more than the innodb_undo_tablespaces setting. A value of 1 is reset to 0 as 2 or more are needed for separate tablespaces. When the undo logs can grow large, splitting them over multiple tablespaces will reduce the size of any single tablespace. Until , must be set before InnoDB is initialized, or else MariaDB will fail to start, with an error saying that InnoDB did not find the expected number of undo tablespaces. The files are created in the directory specified by , and are named undoN, N being an integer. The default size of an undo tablespace is 10MB.From , multiple undo tablespaces are enabled by default, and the default is changed to 3 so that the space occupied by possible bursts of undo log records can be reclaimed after is set. Before , must have a non-zero setting for innodb_undo_tablespaces to take effect.

    innodb_use_atomic_writes

    • Description: Implement atomic writes on supported SSD devices. See for other variables affected when this is set.

    • Command line: innodb-use-atomic-writes={0|1}

    • Scope: Global

    • Dynamic: No

    innodb_use_fallocate

    • Description: Preallocate files fast, using operating system functionality. On POSIX systems, posix_fallocate system call is used.

      • Automatically set to 1 when is set - see .

      • See for more information.

    innodb_use_global_flush_log_at_trx_commit

    • Description: Determines whether a user can set the variable . If set to 1, a user cannot reset the value with a SET command, while if set to 1, a user can reset the value of innodb_flush_log_at_trx_commit. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: innodb-use-global-flush-log-at-trx_commit={0|1}

    innodb_use_mtflush

    • Description: Whether to enable Multi-Threaded Flush operations. For more information, see Fusion.

      • InnoDB's multi-thread flush feature was deprecated in and removed from . In later versions of MariaDB, use system variable instead.

      • See for more information.

    • Command line:

    innodb_use_native_aio

    • Description: For Linux systems only, specified whether to use Linux's asynchronous I/O subsystem. Set to ON by default, it may be changed to 0 at startup if InnoDB detects a problem, or from /, if a 5.11 - 5.15 Linux kernel is detected, to avoid an io-uring bug/incompatibility (). MariaDB-10.6.6/MariaDB-10.7.2 and later also consider 5.15.3+ as a fixed kernel and default to ON. To really benefit from the setting, the files should be opened in O_DIRECT mode (, default from ), to bypass the file system cache. In this way, the reads and writes can be submitted with DMA, using the InnoDB buffer pool directly, and no processor cycles need to be used for copying data.

    • Command line: --innodb-use-native-aio={0|1}

    innodb_use_purge_thread

    • Description: Usually with InnoDB, data changed by a transaction is written to an undo space to permit read consistency, and freed when the transaction is complete. Many, or large, transactions, can cause the main tablespace to grow dramatically, reducing performance. This option, introduced in XtraDB 5.1 and removed for 5.5, allows multiple threads to perform the purging, resulting in slower, but much more stable performance.

    • Command line: --innodb-use-purge-thread=#

    • Scope: Global

    innodb_use_stacktrace

    • Description: If set to ON (OFF is default), a signal handler for SIGUSR2 is installed when the InnoDB server starts. When a long semaphore wait is detected at sync/sync0array.c, a SIGUSR2 signal is sent to the waiting thread and thread that has acquired the RW-latch. For both threads a full stacktrace is produced as well as if possible. XtraDB only. Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

    • Command line: --innodb-use-stacktrace={0|1}

    • Scope: Global

    innodb_use_sys_malloc

    • Description: If set the 1, the default, XtraDB/InnoDB will use the operating system's memory allocator. If set to 0 it will use its own. Deprecated in and removed in along with InnoDB's internal memory allocator.

    • Command line: --innodb-use-sys-malloc={0|1}

    • Scope: Global

    innodb_use_sys_stats_table

    • Description: If set to 1 (0 is default), XtraDB will use the SYS_STATS system table for extra table index statistics. When a table is opened for the first time, statistics will then be loaded from SYS_STATS instead of sampling the index pages. Statistics are designed to be maintained only by running an . Replaced by MySQL 5.6's Persistent Optimizer Statistics.

    • Command line: innodb-use-sys-stats-table={0|1}

    • Scope: Global

    innodb_use_trim

    • Description: Use trim to free up space of compressed blocks.

      • See for more information.

    • Command line: --innodb-use-trim={0|1}

    • Scope: Global

    innodb_version

    • Description: InnoDB version number. From , as the InnoDB implementation in MariaDB has diverged from MySQL, the MariaDB version is instead reported. For example, the InnoDB version reported in (which is based on MySQL 5.6) included encryption and variable-size page compression before MySQL 5.7 introduced them. (based on MySQL 5.7) introduced persistent AUTO_INCREMENT () in a GA release before MySQL 8.0. (based on MySQL 5.7) introduced instant ADD COLUMN () before MySQL.

    • Scope: Global

    • Dynamic: No

    innodb_write_io_threads

    • Description: Prior to , this was simply the number of I/O threads for InnoDB writes. From , asynchronous I/O functionality in the InnoDB Background Thread Pool replaces the old InnoDB I/O Threads. This variable is now multiplied by 256 to determine the maximum number of concurrent asynchronous I/O write requests that can be completed by the Background Thread Pool. The default is therefore 4*256 = 1024 conccurrent asynchronous write requests. You may on rare occasions need to reduce this default on Linux systems running multiple MariaDB servers to avoid exceeding system limits, or increase if spending too much time waiting on I/O requests.

    • Command line: --innodb-write-io-threads=#

    • Scope: Global

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

    Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • estimate The default, and independent of innodb_io_capacity. If the oldest modified age exceeds 1/2 of the maximum age capacity, blocks are flushed every second at a rate determined by the number of modified blocks, LSN progress speed and the average age of all modified blocks.
  • keep_average Attempts to keep the I/O rate constant by using a shorter loop cycle of one tenth of a second. Designed for SSD cards.

  • Command line: --innodb-adaptive-checkpoint=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: string

  • Default Value: estimate

  • Valid Values: none or 0, reflex or 1, estimate or 2, keep_average or 3

  • Removed: XtraDB 5.5 - replaced with innodb_adaptive_flushing_method

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Data Type: double

  • Default Value: 10.000000

  • Range: 0 to 70

  • Command line: innodb-adaptive-flushing-method=value

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value: estimate

  • Valid Values: native or 0, estimate or 1, keep_average or 2

  • Removed: - replaced with InnoDB flushing method from MySQL 5.6

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF (>= ), ON (<= )

  • Dynamic: No
  • Data Type: numeric

  • Default Value: 1

  • Range: 1 to 64

  • Data Type: numeric

  • Default Value: 8

  • Range: 1 to 512

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value:

    • 0 (>= )

    • 150000 (<= )

  • Range: 0 to 1000000

  • Introduced:

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Dynamic: No
  • Data Type: numeric

  • Default Value: 8388608

  • Range: 2097152 to 4294967295

  • Deprecated:

  • Removed:

  • Default Value: ON

  • Introduced: MariaDB 10.11.9, , , MariaDB 11.4.3, ,

  • Data Type: numeric

  • Default Value: 5

  • Range: 1 to 1073741824

  • Introduced:

  • Removed:

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Removed:

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Removed:

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Removed:

  • Data Type: numeric

  • Default Value: 0

  • Introduced:

  • Removed:

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 64 (from ) 8 (before ),

  • Range: 1 to 1000

  • 1 is the consecutive lock mode.
  • 2 is the interleaved lock mode.

  • In order to use Galera Cluster, the lock mode needs to be set to 2.

  • See AUTO_INCREMENT Handling in InnoDB: AUTO_INCREMENT Lock Modes for more information.

  • Command line: --innodb-autoinc-lock-mode=#

  • Scope: Global

  • Dynamic: No

  • Data Type: numeric

  • Default Value: 1

  • Range: 0 to 2

  • Data Type: numeric

  • Default Value: 3600

  • Range: 1 to 4294967295

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: boolean

  • Default Value: 0

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: numeric

  • Default Value: 604800

  • Range: 1 to 4294967295

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: boolean

  • Default Value: 0

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 100

  • Dynamic: No
  • Data Type: numeric

  • Default Value:

    • autosize (0), resulting in innodb_buffer_pool_size/64, if large_pages round down to multiple of largest page size, with 1MiB minimum (from )

    • 134217728 (until )

  • Range:

    • 0, as autosize, and then 1048576 to 18446744073709551615 (from )

    • 1048576 to innodb_buffer_pool_size/innodb_buffer_pool_instances (until )

  • Block size: 1048576

  • Deprecated and ignored from MariaDB 10.11.12, MariaDB 11.4.6, MariaDB 11.8.2

  • Data Type: boolean

  • Default Value: ON

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Data Type: boolean

  • Default Value:

    • 25

  • Range: 1 to 100

  • Data Type: string

  • Default Value: ""

  • Valid Values: "" or "uncompressed"

  • Data Type: string

  • Default Value: ib_buffer_pool

  • Introduced:

  • Scope: Global

  • Dynamic: No

  • Data Type: numeric

  • Default Value: >= : 8, 1 (>= if innodb_buffer_pool_size < 1GB), or dependent on innodb_buffer_pool_size (Windows 32-bit)

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: No
  • Data Type: boolean

  • Default Value: ON

  • Data Type: boolean

  • Default Value: OFF

  • Data Type: numeric

  • Default Value: 9223372036854775807

  • Range: 1 to 9223372036854775807

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range - 32 bit: 0 to 4294967295

  • Range - 64 bit: 0 to 18446744073709547520

  • Removed: - replaced by innodb_buffer_pool_load_at_startup

  • Data Type: boolean

  • Default Value: ON

  • Removed:

  • Data Type: boolean

  • Default Value: 0

  • Removed:

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 134217728 (128MiB)

  • Range:

    • Minimum: 5242880 (5MiB ) for InnoDB Page Size <= 16k otherwise 25165824 (24MiB) for InnoDB Page Size > 16k (for versions less than next line)

    • Minimum: 2MiB InnoDB Page Size = 4k, 3MiB InnoDB Page Size = 8k, 5MiB = 16k, 10MiB = 32k, 20MiB = 64k, (>= , >= , >= , >= , >= , >= )

    • Minimum: 1GiB for > 1 (<= )

    • Maximum: 9223372036854775807 (8192PB) (all versions)

  • Block size: 1048576

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 134217728 (128MiB)

  • Range: 0 to 18446744073701163008

  • Block size: 8388608 (8 MB on 64-bit systems)

  • Introduced: MariaDB 10.11.12, MariaDB 11.4.6, MariaDB 11.8.2

  • Data Type: numeric

  • Default Value: specified by the initial value of innodb_buffer_pool_size, rounded up to the block size of that variable. See the section about buffer pool changes in MariaDB 10.11.12, 11.4.6, and 11.8.2.

  • Range: 0 to 18446744073701163008

  • Block size: 8388608 (8 MB on 64-bit systems)

  • Introduced: MariaDB 10.11.12, MariaDB 11.4.6, MariaDB 11.8.2

  • Default Value: OFF

  • Introduced: , ,

  • Data Type: numeric

  • Default Value: 25

  • Range: 0 to 50

  • Introduced:

  • Deprecated:

  • Removed:

  • Data Type: enumeration (>= ), string (<= )

  • Default Value:

    • = , MariaDB 10.6.7, , : none

    • <= , MariaDB 10.6.6, , :all

  • Valid Values: inserts, none, deletes, purges, changes, all

  • Deprecated:

  • Removed:

  • Scope: Global
  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 2

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 0

  • Range: 0 upwards

  • Removed: - replaced with InnoDB flushing method from MySQL 5.6.

  • full_crc32 and strict_full_crc32: From . Permits encryption to be supported over a SPATIAL INDEX, which crc32 does not support. Newly-created data files will carry a flag that indicates that all pages of the file will use a full CRC-32C checksum over the entire page contents (excluding the bytes where the checksum is stored, at the very end of the page). Such files will always use that checksum, no matter what parameter innodb_checksum_algorithm is assigned to. Even if innodb_checksum_algorithm is modified later, the same checksum will continue to be used. A special flag are set in the FSP_SPACE_FLAGS in the first data page to indicate the new format of checksum and encryption/page_compressed. ROW_FORMAT=COMPRESSED tables will only use the old format. These tables do not support new features, such as larger innodb_page_size or instant ADD/DROP COLUMN. Also cleans up the MariaDB tablespace flags - flags are reserved to store the page_compressed compression algorithm, and to store the compressed payload length, so that checksum can be computed over the compressed (and possibly encrypted) stream and can be validated without decrypting or decompressing the page. In the full_crc32 format, there no longer are separate before-encryption and after-encryption checksums for pages. The single checksum is computed on the page contents that is written to the file.See MDEV-12026 for details.

  • none: Writes a constant rather than calculate a checksum. Deprecated in , , and removed in MariaDB 10.6 as was mostly used to disable the original, slow, page checksum for benchmarking purposes.

  • strict_crc32, strict_innodb and strict_none: The options are the same as the regular options, but InnoDB will halt if it comes across a mix of checksum values. These are faster, as both new and old checksum values are not required, but can only be used when setting up tablespaces for the first time.

  • Command line: --innodb-checksum-algorithm=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value:

    • full_crc32 (>= )

    • crc32 (>= to <= )

    • innodb (<= )

  • Valid Values:

    • = MariaDB 10.6.0: crc32, full_crc32, strict_crc32, strict_full_crc32

    • , >= : innodb, crc32, full_crc32, none, strict_innodb, strict_crc32, strict_none, strict_full_crc32

    • <= : innodb, crc32, none, strict_innodb, strict_crc32, strict_none

  • ,
    --skip-innodb-checksums
  • Scope: Global

  • Dynamic: No

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: enum

  • Default Value:

    • deprecated

  • Valid Values:

    • deprecated, high_checkpoint, legacy

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 1000

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • lz4: Pages are compressed using the lz4 compression algorithm.
  • lzo: Pages are compressed using the lzo compression algorithm.

  • lzma: Pages are compressed using the lzma compression algorithm.

  • bzip2: Pages are compressed using the bzip2 compression algorithm.

  • snappy: Pages are compressed using the snappy algorithm.

  • On many distributions, MariaDB may not support all page compression algorithms by default. From , libraries can be installed as a plugin. See Compression Plugins.

  • See InnoDB Page Compression: Configuring the InnoDB Page Compression Algorithm for more information.

  • Command line: --innodb-compression-algorithm=value

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Default Value: zlib

  • Valid Values:none, zlib, lz4, lzo, lzma, bzip2 or snappy

  • --innodb-compression-default={0|1}
  • Scope: Global, Session

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 5

  • Range: 0 to 100

  • Introduced:

  • 1
    is the fastest and
    9
    is the most compact.
  • See InnoDB Page Compression: Configuring the Default Compression Level for more information.

  • Command line: --innodb-compression-level=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 6

  • Range: 1 to 9

  • Introduced:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 50

  • Range: 0 to 75

  • Introduced:

  • Data Type: numeric

  • Default Value:

    • 0 (>= )

    • 5000 (<= )

  • Range: 1 to 18446744073709551615

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • If set to salvage, read access is permitted, but corrupted pages are ignored. innodb_file_per_table must be enabled for this option. Previously named innodb_pass_corrupt_table.

  • Added as a deprecated and ignored option in (which uses InnoDB as default instead of XtraDB) to allow for easier upgrades.

  • Command line: innodb-corrupt-table-action=value

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value:

    • assert (<= )

    • deprecated (<= )

  • Valid Values:

    • deprecated, assert, warn, salvage

  • Deprecated:

  • Removed:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Dynamic: No

  • Data Type: numeric

  • Default Value: ibdata1:12M:autoextend (from ), ibdata1:10M:autoextend (before )

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Data Type: directory name

  • Default Value: The MariaDB data directory

  • Data Type: boolean

  • Default Value: 1

  • full: Default. Report transactions, waiting locks and blocking locks.
  • Command line: --innodb-deadlock-report=val

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Default Value: full

  • Valid Values: off, basic, full

  • Introduced: MariaDB 10.6.0

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 1

  • Range: 1 to 255

  • Introduced:

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 1

  • Range: 1 to 4294967295

  • Scope: Global
  • Dynamic: Yes

  • Data Type: enum

  • Default Value: dynamic

  • Valid Values: redundant, compact or dynamic

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Data Type: double

  • Default Value: 0.9

  • Range: 0.7 to 1

  • Deprecated:

  • Removed:

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 20

  • Range: 1 to 100

  • Deprecated:

  • Removed:

  • Dynamic: Yes
  • Data Type: integer

  • Default Value: 40

  • Range: 1 to 1000

  • Deprecated:

  • Removed:

  • Data Type: numeric

  • Default Value: 7

  • Range: 2 to 32

  • Deprecated:

  • Removed:

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 4294967295

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Default Value - 32 bit: 2147483648

  • Default Value - 64 bit: 9223372036854775807

  • Removed: - replaced by MySQL 5.6's table_definition_cache implementation.

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: OFF

  • Data Type: boolean
  • Default Value: OFF

  • Removed: , , , MariaDB 10.6.8,

  • The setting innodb_doublewrite=fast could be safe when the doublewrite buffer (the first file of the system tablespace) and the data files reside in the same file system.

  • Command line: --innodb-doublewrite{=val}, --skip-innodb-doublewrite

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Default Value: ON

  • Valid Values: OFF, ON, fast

    • Description: If set to 1, the default, to improve fault tolerance InnoDB first stores data to a doublewrite buffer before writing it to data file. Disabling will provide a marginal performance improvement.

    • Command line: --innodb-doublewrite, --skip-innodb-doublewrite

    • Scope: Global

    • Dynamic:No

    • Data Type: boolean

    • Default Value: ON

    Dynamic: No
  • Data Type: filename

  • Default Value: NULL

  • Removed:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Default Value:

    • deprecated

  • Valid Values:

    • deprecated, backoff, legacy

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 1

  • Removed: Not needed after XtraDB 1.0.5

  • Scope: Global
  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • , but allows unencrypted tables to be created.
  • FORCE - Enables table encryption for all new and existing tables that have the ENCRYPTED table option set to DEFAULT, and doesn't allow unencrypted tables to be created (CREATE TABLE ... ENCRYPTED=NO will fail).

  • See Data-at-Rest Encryption and Enabling InnoDB Encryption: Enabling Encryption for Automatically Encrypted Tablespaces for more information.

  • Command line: --innodb-encrypt-tables={0|1}

  • Scope: Global

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Valid Values: ON, OFF, FORCE

  • Scope: Global
  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Valid Values: ON, OFF

  • Introduced: , ,

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 1

  • Range: 0 to 4294967295

  • Scope: Global
  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 100

  • Range: 0 to 4294967295

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range:

    • 0 to 4294967295 (<= , , , , )

    • 0 to 255 (>= , , , , )

  • Dynamic: No
  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 126

  • Removed: XtraDB 5.5 - replaced by innodb_rollback_segments

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Removed: XtraDB 5.5

  • Scope: Global, Session
  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Scope: Global

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Removed: /XtraDB 5.6 - replaced with innodb_checksum_algorithm

  • 2, the InnoDB redo log is flushed and a cold shutdown takes place, similar to a crash. The resulting startup then performs crash recovery. Extremely fast, in cases of emergency, but risks corruption. Not suitable for upgrades between major versions!

  • 3 (from ) - active transactions will not be rolled back, but all changed pages are written to data files. The active transactions are rolled back by a background thread on a subsequent startup. The fastest option that will not involve InnoDB redo log apply on subsequent startup. See MDEV-15832.

  • Command line: --innodb-fast-shutdown[=#]

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 1

  • Range: 0 to 3 (>= ), 0 to 2 (<= )

  • Data Type: numeric

  • Default Value: 600

  • Range: 1 to 4294967295

  • Dynamic: Yes

  • Data Type: string

  • Default Value:

    • Barracuda

  • Valid Values: Antelope, Barracuda

  • Deprecated:

  • Removed:

  • Re-introduced: (for compatibility purposes)

  • Removed: MariaDB 10.6.0

  • Dynamic: No

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • Dynamic: Yes
  • Data Type: string

  • Default Value: Antelope

  • Valid Values: Antelope, Barracuda

  • Deprecated:

  • Removed:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 100

  • Range: 10 to 100

  • Default Value: 1

  • Range: 0 to 2700

  • once a second. This gives better performance, but a server crash can erase the last second of transactions.
  • 2 The log buffer is written to the InnoDB redo log after each commit, but flushing takes place every innodb_flush_log_at_timeout seconds (by default once a second). Performance is slightly better, but a OS or power outage can cause the last second's transactions to be lost.

  • 3 Emulates group commit (3 syncs per group commit). See Binlog group commit and innodb_flush_log_at_trx_commit. This option has not been working correctly since 10.2 and may be removed in future, see 1873

  • Command line: --innodb-flush-log-at-trx-commit[=#]

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value: 1

  • Valid Values: 0, 1, 2 or 3

  • - O_DIRECT or directio(), is used to open data files, and fsync() to flush data and logs. Default on Unix from
    .
  • fsync - Default on Unix until . Can be specified directly, but if the variable is unset on Unix, fsync() are used by default.

  • O_DIRECT_NO_FSYNC - introduced in . Uses O_DIRECT during flushing I/O, but skips fsync() afterwards. Not suitable for XFS filesystems. Generally not recommended over O_DIRECT, as does not get the benefit of innodb_use_native_aio=ON.

  • ALL_O_DIRECT - introduced in and available with XtraDB only. Uses O_DIRECT for opening both data and logs and fsync() to flush data but not logs. Use with large InnoDB files only, otherwise may cause a performance degradation. Set innodb_log_block_size to 4096 on ext4 filesystems. This is the default log block size on ext4 and will avoid unaligned AIO/DIO warnings.

  • unbuffered - Windows-only default

  • async_unbuffered - Windows-only, alias for unbuffered

  • normal - Windows-only, alias for fsync

  • littlesync - for internal testing only

  • nosync - for internal testing only

  • Deprecated in and replaced by four boolean dynamic variables that can be changed while the server is running: innodb_log_file_buffering (disable O_DIRECT, added by MDEV-28766 in 10.8.4, 10.9.2), innodb_data_file_buffering (disable O_DIRECT on data files), innodb_log_file_write_through (enable O_DSYNC on the log), innodb_data_file_write_through (enable O_DSYNC on persistent data files) From , if set to one of the following values, then the values of the four boolean flags are set as follows:

    • O_DSYNC: innodb_log_file_write_through=ON, innodb_data_file_write_through=ON,innodb_data_file_buffering=OFF, and (if supported) innodb_log_file_buffering=OFF.

    • fsync, littlesync, nosync, or (Microsoft Windows specific) normal: , , and .

  • Command line: --innodb-flush-method=name

  • Scope: Global

  • Dynamic: No

  • Data Type: enumeration (>= ), string (<= )

  • Default Value:

    • O_DIRECT (Unix, >= MariaDB 10.6.0)

    • fsync (Unix, >= , <= )

    • Not set (<= )

  • Valid Values:

    • Unix: fsync, O_DSYNC, littlesync, nosync. O_DIRECT, O_DIRECT_NO_FSYNC

    • Windows: unbuffered, async_unbuffered, normal

  • Deprecated:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value: area

  • Valid Values: none or 0, area or 1, cont or 2

  • Removed: /XtraDB 5.6 - replaced by innodb_flush_neighbors

  • 0: No other dirty pages are flushed.
  • 2: Flushes dirty pages in the same extent from the buffer pool.

  • Command line: --innodb-flush-neighbors=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value: 1

  • Valid Values: 0, 1, 2

  • Data Type: boolean

  • Default Value: ON

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 30

  • Range: 1 to 1000

  • Scope: Global

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Removed: MariaDB 10.6.6

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: No
  • Data Type: enumeration

  • Default Value: 0

  • Range: 0 to 6

  • sync_preflush
    - thread issues a flush list batch, and waits for it to complete. This is the same as is used when the page cleaner thread is not running.
  • Command line: innodb-foreground-preflush=value

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Default Value:

    • deprecated

  • Valid Values:

    • deprecated, exponential_backoff, sync_preflush

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: string

  • Data Type: numeric

  • Default Value: 8000000

  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Data Type: numeric

  • Default Value: 84

  • Range: 10 to 84

  • Dynamic: No
  • Data Type: numeric

  • Default Value: 3

  • Range: 1 to 16

  • Data Type: numeric

  • Default Value: 2000

  • Range: 1000 to 10000

  • Data Type: numeric

  • Default Value: 2000000000

  • Range: 1000000 to 18446744073709551615

  • Dynamic: Yes
  • Data Type: string

  • Default Value: Empty

  • Data Type: numeric

  • Default Value: 2

  • Range: 1 to 32

  • Data Type: numeric

  • Default Value: 640000000

  • Range: 32000000 to 1600000000

  • Introduced:

  • Dynamic: Yes
  • Data Type: string

  • Default Value: Empty

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 100

  • Range: 100 to 999999999

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 1

  • Range: 0 to 1

  • Removed:

  • Dynamic: No

  • Data Type: numeric

  • Default Value: 1/2 the size of the InnoDB buffer pool

  • Range: 0 to 1/2 the size of the InnoDB buffer pool

  • Removed:

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 100

  • Range: 0 to 100

  • Deprecated: , ,

  • Removed:

  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 1

  • Removed:

  • , or to be able to export tables to older versions of the server.
  • This variable has been introduced as a result, with the following values:

  • never (0): Do not allow instant add/drop/reorder, to maintain format compatibility with MariaDB 10.x and MySQL 5.x. If the table (or partition) is not in the canonical format, then any ALTER TABLE (even one that does not involve instant column operations) will force a table rebuild.

  • add_last (1, default in 10.3): Store a hidden metadata record that allows columns to be appended to the table instantly (MDEV-11369). In 10.4 or later, if the table (or partition) is not in this format, then any ALTER TABLE (even one that does not involve column changes) will force a table rebuild.

  • add_drop_reorder (2, default): From only. Like 'add_last', but allow the metadata record to store a column map, to support instant add/drop/reorder of columns.

  • Command line: --innodb-instant-alter-column-allowed=value

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Valid Values:

    • <= : never, add_last

    • = : never, add_last, add_drop_reorder

  • Default Value:

    • <= : add_last

    • = : add_drop_reorder

  • Introduced: , ,

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated: (treated as if OFF)

  • Removed:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 200

  • Range: 100 to 18446744073709551615 (264-1)

  • Data Type: numeric

  • Default Value: 2000 or twice innodb_io_capacity, whichever is higher.

  • Range : 100 to 18446744073709551615 (264-1)

  • numeric
  • Default Value: 0

  • Range: 0 to 9223372036854775807

  • Deprecated:

  • Removed:

  • Command line: --innodb-large-prefix

  • Scope: Global

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value:

    • ON

  • Deprecated:

  • Removed:

  • Re-introduced: (for compatibility purposes)

  • Removed: MariaDB 10.6.0

  • Scope: Global
  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: 0

  • Deprecated: XtraDB 5.5.30-30.2

  • Removed:

  • Command line: --innodb-lock-schedule-algorithm=#

  • Scope: Global

  • Dynamic: No (>= , ), Yes (<= , )

  • Data Type: enum

  • Valid Values: FCFS, VATS

  • Default Value: FCFS (, ), VATS (), FCFS ()

  • Deprecated: , , ,

  • Removed: MariaDB 10.6.0

  • Scope: Global, Session

  • Dynamic: Yes

  • Data Type: INT UNSIGNED (>= MariaDB 10.6.3), BIGINT UNSIGNED (<= MariaDB 10.6.2)

  • Default Value: 50

  • Range:

    • 0 to 100000000 (>= MariaDB 10.6.3)

    • 0 to 1073741824 (>= to <= MariaDB 10.6.2)

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Data Type: string

  • Default Value: ./

  • Deprecated:

  • Removed:

  • Data Type: numeric

  • Default Value: 0

  • Deprecated:

  • Removed:

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Scope: Global

  • Dynamic: No

  • Data Type: numeric

  • Default Value: 512

  • Deprecated:

  • Removed:

  • Data Type: numeric

  • Default Value: 16777216 (16MB)

  • Range: 262144 to 2147479552 (256KB to 2GB - 4K) (>= MariaDB 10.11.8)

  • Range: 262144 to 18446744073709551615 (<= MariaDB 10.11.7) - limit to the above maximum because this is an operating system limit.

  • Block size: 4096

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: OFF

  • Introduced: MariaDB 10.11.12, MariaDB 11.4.6, MariaDB 11.8.2

  • crc32 - CRC32© is used for log block checksums, which also permits recent CPUs to use hardware acceleration (on SSE4.2 x86 machines and Power8 or later) for the checksums.

  • strict_* - Whether or not to accept checksums from other algorithms. If strict mode is used, checksums blocks are considered corrupt if they don't match the specified algorithm. Normally they are considered corrupt only if no other algorithm matches.

  • Command line: innodb-log-checksum-algorithm=value

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enum

  • Default Value:

    • deprecated (>= )

    • innodb (<= )

  • Valid Values:

    • deprecated, innodb, none, crc32, strict_none, strict_innodb, strict_crc32 (>= )

    • innodb, none, crc32, strict_none, strict_innodb, strict_crc32 (<= )

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: boolean

  • Default Value:

    • ON

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Scope: Global

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Introduced: MariaDB 10.8.4, MariaDB 10.9.2

  • Scope: Global
  • Dynamic: No

  • Data Type: boolean

  • Default Value: ON (Linux, FreeBSD), OFF (Other platforms)

  • Introduced: MariaDB 10.11.10, , MariaDB 11.4.4, ,

  • Dynamic: Yes (>= ), No (<= )

  • Data Type: numeric

  • Default Value: 100663296 (96MB) (>= ), 50331648 (48MB) (<= )

  • Range:

    • = : 4194304 to 512GB (4MB to 512GB)

    • <= : 1048576 to 512GB (1MB to 512GB)

  • Block size: 4096

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Data Type: numeric

  • Default Value: 1 (>= ), 2 (<= )

  • Range: 1 to 100 (>= )

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: directory name

    Dynamic: Yes
  • Data Type: boolean

  • Default Value:

    • OFF (>= , , , )

    • ON (<= , , , )

  • Introduced: ,

  • Deprecated: , , ,

  • Removed: MariaDB 10.6.0

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 6000

  • Introduced: MariaDB 10.11.8, , , , MariaDB 11.4.2,

  • Dynamic: No (>= MariaDB 10.11.9), Yes (<= )
  • Data Type: numeric

  • Default Value: 512 (>= MariaDB 10.11.9), 8192 (<= )

  • Range:

    • 512 to 4096 (>= MariaDB 10.11.9)

    • 512 to innodb_page_size (<= )

  • Removed:

  • Re-introduced: MariaDB 10.11.9, , , MariaDB 11.4.3,

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value:

    • 0 (>=MariaDB 10.6.20, MariaDB 10.11.10, , MariaDB 11.4.4. , )

    • 32 (<= MariaDB 10.6.19, MariaDB 10.11.9, , MariaDB 11.4.3)

  • Range: 1 to 18446744073709551615

  • Introduced:

  • Deprecated: MariaDB 10.6.20, MariaDB 10.11.10, and MariaDB 11.4.4. ,

  • Scope: Global
  • Dynamic: Yes

  • Data Type: numeric

  • Default Value:

    • 1536 (>= )

    • 1024 (<= )

  • Range - 32bit: 100 to 2^32-1

  • Range - 64bit: 100 to 2^64-1

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 4096 (4KB)

  • Range: 4096 (4KB) to 18446744073709551615 (16EB)

  • Deprecated:

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 1000000

  • Range: 0 to 18446744073709551615

  • Deprecated:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value:

    • 90.000000 (>= )

    • 75.000000 (<= )

  • Range: 0 to 99.999

  • Scope: Global
  • Dynamic: Yes

  • Data Type: numeric

  • Default Value:

    • 0 (>= )

    • 0.001 (<= )

  • Range: 0 to 99.999

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 4294967295

  • Data Type: numeric

  • Default Value: 0

  • Data Type: numeric

  • Default Value: 4294967295

  • Range: 0 to 4294967295

  • Introduced: , , ,

  • Data Type: numeric

  • Default Value:

    • 10485760

  • Range: 10485760 to 18446744073709551615

  • Data Type: numeric

  • Default Value: 1048576 (1M)

  • Range: 1048576 (1M) to 1073741824 (1G)

  • Removed: - replaced by innodb_sort_buffer_size

  • Command line:
    --innodb-mtflush-threads=#
  • Scope: Global

  • Dynamic: No

  • Data Type: numeric

  • Default Value: 8

  • Range: 1 to 64

  • Deprecated:

  • Removed:

  • Data Type: string

    Data Type: string

    Data Type: string

    Data Type: string

    Data Type: boolean

  • Default Value: OFF

  • Removed: , ,

  • Data Type: numeric

  • Default Value: 37

  • Range: 5 to 95

  • Data Type: numeric

  • Default Value: 1000

  • Range: 0 to 2^32-1

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 134217728

  • Range: 65536 to 2^64-1

  • Dynamic: No

  • Data Type: numeric

  • Default Value: autosized

  • Range: 10 to 4294967295

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • --innodb-page-cleaners=#
  • Scope: Global

  • Dynamic: Yes (>= ), No (<= )

  • Data Type: numeric

  • Default Value: 4 (or set to innodb_buffer_pool_instances if lower)

  • Range: 1 to 64

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • InnoDB's page size can be as large as 64k for tables using the following row formats: DYNAMIC, COMPACT, and REDUNDANT.
  • InnoDB's page size must still be 16k or less for tables using the COMPRESSED row format.

  • This system variable's value cannot be changed after the datadir has been initialized. InnoDB's page size is set when a MariaDB instance starts, and it remains constant afterwards.

  • Command line: --innodb-page-size=#

  • Scope: Global

  • Dynamic: No

  • Data Type: enumeration

  • Default Value: 16384

  • Valid Values: 4k or 4096, 8k or 8192, 16k or 16384, 32k and 64k.

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: OFF

  • Data Type: numeric

  • Default Value:

    • 127 (>= MariaDB 10.6.20, MariaDB 10.11.10, , MariaDB 11.4.4, )

    • 1000 (>= MariaDB 10.6.16, , MariaDB 10.11.6, , )

    • 300 (<= , , , , )

  • Range: 1 to 5000

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 128

  • Range: 1 to 128

  • Deprecated: MariaDB 10.6.16, , MariaDB 10.11.6, , ,

  • Dynamic: No

  • Data Type: numeric

  • Default Value: 4

  • Range: 1 to 32

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value: linear

  • Valid Values: none, random, linear, both

  • Removed: /XtraDB 5.6 - replaced by MySQL 5.6's innodb_random_read_ahead

  • Data Type: numeric

  • Default Value: 56

  • Range: 0 to 64

  • Dynamic: Yes (>= MariaDB 10.11), No (<= )

  • Data Type: numeric

  • Default Value: 4

  • Range: 1 to 64

  • Dynamic: No
  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: OFF (>= MariaDB 10.6.6), ON (<= MariaDB 10.6.5)

  • Introduced: MariaDB 10.6.0

  • Dynamic: No
  • Data Type: boolean

  • Default Value: OFF

  • Removed:

  • Scope: Global
  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Removed: - replaced by MySQL 5.6's relay-log-recovery

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 4294967295

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: boolean

  • Default Value: 0

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value: 128

  • Range: 1 to 128

  • Deprecated:

  • Removed:

  • Dynamic: No
  • Data Type: boolean

  • Default Value: ON

  • Introduced:

  • Removed:

  • Dynamic: No
  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Data Type: numeric

  • Default Value: 56

  • Range: 0 to 50000

  • Introduced:

  • Removed:

  • Data Type: numeric

  • Default Value: 256

  • Range: 1 to 50000

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Command line: innodb-sched-priority-cleaner=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 19

  • Range: 0 to 39

  • Deprecated:

  • Removed:

  • Data Type: numeric

  • Default Value: 10

  • Range: 0 to 1000

  • Deprecated:

  • Removed:

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 1

  • Deprecated:

  • Removed:

  • Data Type: numeric
  • Default Value: 0

  • Range: 0 to 99

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: ON (>= ), OFF (<= )

  • Introduced: MariaDB 10.6.18, MariaDB 10.11.8, , , , MariaDB 11.4.2

  • Dynamic: No
  • Data Type: numeric

  • Default Value: 1048576 (1M)

  • Range: 65536 to 67108864

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 4 (>= ), 6 (<= )

  • Range: 0 to 4294967295

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Data Type: boolean
  • Default Value: 1

  • Removed: - replaced by innodb_stats_auto_recalc.

  • Default Value: OFF

  • nulls_ignored: Ignore NULLs altogether from index group calculations.

  • See also Index Statistics, aria_stats_method and myisam_stats_method.

  • Command line: --innodb-stats-method=name

  • Scope: Global

  • Dynamic: Yes

  • Data Type: enumeration

  • Default Value: nulls_equal

  • Valid Values: nulls_equal, nulls_unequal, nulls_ignored

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 18446744073709551615

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: ON

  • Data Type: numeric

  • Default Value: 20

  • If persistent statistics are enabled, then the innodb_stats_persistent_sample_pages system variable applies instead. persistent statistics are enabled with the innodb_stats_persistent system variable.

  • This system variable has been deprecated. The innodb_stats_transient_sample_pages system variable should be used instead.

  • Command line: --innodb-stats-sample-pages=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 8

  • Range: 1 to 2^64-1

  • Deprecated:

  • Removed:

  • This system variable does not affect the calculation of persistent statistics.
  • Command line: --innodb-stats-traditional={0|1}

  • Scope: Global

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • If persistent statistics are enabled, then the innodb_stats_persistent_sample_pages system variable applies instead. persistent statistics are enabled with the innodb_stats_persistent system variable.

  • Command line: --innodb-stats-transient-sample-pages=#

  • Scope: Global

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 8

  • Range: 1 to 2^64-1

  • Data Type: boolean

  • Default Value: 1

  • Removed: /XtraDB 5.6

  • Data Type: boolean

  • Default Value: OFF

  • Data Type: boolean

  • Default Value: OFF

  • Dynamic: Yes
  • Data Type: boolean

  • Default Value: ON

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • Data Type: numeric

  • Default Value: 1

  • Range: 1 to 1024

  • Removed: MariaDB 10.6.0

  • Data Type: numeric

  • Default Value: 30

  • Range: 0 to 4294967295

  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 0

  • Range: 0 to 1000

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Dynamic: No
  • Data Type: boolean

  • Default Value: OFF

  • Removed: /XtraDB 5.6

  • Dynamic: Yes
  • Data Type: numeric

  • Default Value:

    • 0 (>= .)

    • 10000 (<= )

  • Range: 0 to 1000000

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Scope: Global
  • Dynamic: No

  • Data Type: string

  • Default Value: ibtmp1:12M:autoextend

  • Documentation & examples: innodb-temporary-tablespaces

  • Dynamic: Yes
  • Data Type: string

  • Default Value: Empty

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Data Type: boolean

  • Default Value: OFF

  • Introduced:

  • Dynamic: No

  • Data Type: string

  • Default Value: NULL

  • Data Type: boolean

  • Default Value: OFF

  • Scope: Global
  • Dynamic: Yes

  • Data Type: numeric

  • Default Value: 128

  • Range: 0 to 128

  • Deprecated:

  • Removed: MariaDB 10.6.0

  • Command line: --innodb-undo-tablespaces=#

  • Scope: Global

  • Dynamic: No

  • Data Type: numeric

  • Default Value: 3 (>= ), 0 (<= MariaDB 10.11)

  • Range: 0, or 2 to 95

  • Data Type: boolean

  • Default Value: ON

  • Command line: innodb-use-fallocate={0|1}
  • Scope: Global

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated: (treated as if ON)

  • Removed:

  • Scope: Global
  • Dynamic: Yes

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • --innodb-use-mtflush={0|1}
  • Scope: Global

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Scope: Global

  • Dynamic: No

  • Data Type: boolean

  • Default Value: ON

  • Dynamic: No
  • Data Type: numeric

  • Default Value: 1

  • Range: 0 to 32

  • Removed: XtraDB 5.5

  • Dynamic: No

  • Data Type: boolean

  • Default Value: OFF

  • Deprecated:

  • Removed:

  • Dynamic: No

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • Dynamic: No

  • Data Type: boolean

  • Default Value: 0

  • Removed: /XtraDB 5.6

  • Dynamic: No

  • Data Type: boolean

  • Default Value: ON

  • Deprecated:

  • Removed:

  • Data Type: string
  • Removed:

  • Dynamic: Yes (>= MariaDB 10.11), No (<= )

  • Data Type: numeric

  • Default Value: 4

  • Range: 1 to 64

  • InnoDB tables
    Information Schema PLUGINS
    SHOW ENGINES
    plugin-load=innodb=ha_innodb
    innodb_adaptive_flushing_method
    innodb_max_dirty_pages_pct
    innodb_io_capacity
    InnoDB buffer pool
    innodb_adaptive_flushing_lwm
    InnoDB redo log
    innodb_adaptive_flushing
    buffer pool
    innodb_io_capacity
    InnoDB
    MDEV-17492
    DROP TABLE
    TRUNCATE TABLE
    ALTER TABLE
    DROP INDEX
    innodb_adaptive_hash_index_parts
    innodb_thread_sleep_delay
    InnoDB
    innodb_buffer_pool_restore_at_startup
    innodb_buffer_pool_load_at_startup
    innodb_file_per_table
    AUTO_INCREMENT
    innodb_background_scrub_data_check_interval
    Data Scrubbing
    Data Scrubbing
    Data Scrubbing
    Data Scrubbing
    buffer pool
    large-pages
    large-page-size
    Setting Innodb Buffer Pool Size Dynamically
    buffer pool size
    buffer pool
    innodb_buffer_pool_load_at_startup
    buffer pool
    innodb_buffer_pool_load_now
    buffer pool
    buffer pool
    innodb_buffer_pool_dump_at_shutdown
    innodb_buffer_pool_dump_now
    innodb_buffer_pool_size
    InnoDB
    innodb_buffer_pool_size
    innodb_buffer_pool_size
    buffer pool
    innodb_buffer_pool_load_at_startup
    innodb_buffer_pool_load_now
    buffer pool
    innodb_buffer_pool_dump_at_shutdown
    innodb_io_capacity
    buffer pool
    innodb_buffer_pool_dump_now
    innodb_buffer_pool_load_abort=1
    buffer pool
    innodb_buffer_pool_load_at_startup
    InnoDB
    InnoDB Buffer Pool
    Setting InnoDB Buffer Pool Size Dynamically
    innodb_buffer_pool_size_max
    InnoDB Change Buffer
    InnoDB
    InnoDB Change Buffering
    InnoDB Change Buffering
    MariaDB 10.6
    innochecksum
    InnoDB
    innodb_checksum_algorithm
    INFORMATION_SCHEMA.INNODB_CMP_PER_INDEX
    InnoDB page compression
    zlib
    InnoDB page compression
    InnoDB Page Compression: Enabling InnoDB Page Compression by Default
    InnoDB page compression
    innodb_compression_pad_pct_max
    InnoDB Page Compression: Configuring the Failure Threshold and Padding
    InnoDB page compression
    InnoDB page compression
    innodb_compression_failure_threshold_pct
    InnoDB Page Compression: Configuring the Failure Threshold and Padding
    InnoDB
    innodb_thread_concurrency
    innodb_flush_method
    InnoDB
    innodb_data_home_dir
    autoshrink
    innodb_flush_method
    InnoDB
    innodb_file_per_table
    innodb_data_file_path
    innodb_lock_wait_timeout
    innodb_deadlock_detect=ON
    Data-at-Rest Encryption
    InnoDB Encryption Keys
    Data-at-Rest Encryption
    InnoDB Encryption Keys
    row format
    InnoDB Row Formats Overview: Default Row Format
    Defragmenting InnoDB Tablespaces
    innodb_defragment_fill_factor_n_recs
    Defragmenting InnoDB Tablespaces
    innodb_defragment_fill_factor
    Defragmenting InnoDB Tablespaces
    Defragmenting InnoDB Tablespaces
    Defragmenting InnoDB Tablespaces
    Defragmenting InnoDB Tablespaces
    table_definition_cache
    InnoDB
    doublewrite buffer
    innodb_page_size
    innodb_flush_method=NO_FSYNC
    doublewrite buffer
    #1651657
    binary log
    InnoDB redo log
    Data-at-Rest Encryption
    Enabling InnoDB Encryption: Enabling Encryption for the Redo Log
    ENCRYPTED
    ENCRYPTED
    temporary tablespace
    Data-at-Rest Encryption
    InnoDB Enabling Encryption: Enabling Encryption for Temporary Tablespaces
    innodb_encrypt_tables
    Data-at-Rest Encryption
    InnoDB Encryption Keys: Key Rotation
    Data-at-Rest Encryption
    InnoDB Encryption Keys: Key Rotation
    scrubbing
    innodb_encrypt_tables
    Data-at-Rest Encryption
    InnoDB Background Encryption Threads
    innodb_rollback_segments
    undo log
    replication
    innodb_checksum_algorithm
    MDEV-13603
    InnoDB
    InnoDB
    compression
    ALTER TABLE
    XtraDB/InnoDB File Format
    InnoDB
    innodb_file_format_max
    XtraDB/InnoDB File Format
    XtraDB/InnoDB
    innodb_file_format_check
    XtraDB/InnoDB File Format
    InnoDB
    InnoDB file-per-table tablespaces
    InnoDB system tablespace
    Page compression
    ALTER TABLE
    InnoDB redo log
    sync_binlog=1
    innodb_use_global_flush_log_at_trx_commit
    InnoDB redo log
    InnoDB
    MariaDB 10.6.0
    innodb_flush_neighbors
    buffer pool
    information_schema.innodb_tablespaces_scrubbing_table
    innodb_io_capacity
    InnoDB
    MDEV-11412
    MDEV-17567
    MDEV-25506
    MariaDB 10.6.6
    InnoDB
    InnoDB Recovery Modes
    XtraDB redo log
    FULLTEXT index
    INNODB_FT_INDEX_TABLE
    INNODB_FT_INDEX_CACHE
    INNODB_FT_DELETED
    INNODB_FT_BEING_DELETED
    FULLTEXT index
    full-text
    stopwords
    FULLTEXT index
    innodb_ft_user_stopword_table
    innodb_ft_server_stopword_table
    built-in list
    FULLTEXT index
    FULLTEXT index
    character set
    OPTIMIZE TABLE
    FULLTEXT index
    FULLTEXT index
    FULLTEXT index
    VARCHAR
    innodb_ft_enable_stopword
    FULLTEXT index
    innodb_sort_buffer_size
    FULLTEXT index
    FULLTEXT index
    VARCHAR
    innodb_ft_enable_stopword
    innodb_io_capacity
    buffer pool
    Data Scrubbing
    XtraBackup
    innodb_flush_sync
    InnoDB Page Flushing: Configuring the InnoDB I/O Capacity
    innodb_io_capacity
    InnoDB Page Flushing: Configuring the InnoDB I/O Capacity
    row formats
    smaller otherwise
    DYNAMIC
    COMPRESSED
    DROP TABLE
    innodb_file_per_table
    buffer pool
    DROP TABLE
    buffer pool
    MariaDB 10.6.0
    MDEV-16664
    MDEV-16664
    innodb_rollback_on_timeout
    WAIT and NOWAIT
    MariaDB 10.6.3
    innodb_fake_changes
    gap locking
    READ COMMITTED transaction isolation level
    XtraDB redo log
    XtraDB redo log
    XtraDB redo log
    XtraDB redo log
    innodb_flush_method
    InnoDB redo log
    buffer pool
    MariaDB 10.11.12
    MariaDB 11.4.6
    MariaDB 11.8.2
    XtraDB redo log
    InnoDB redo log
    InnoDB redo log
    innodb_flush_trx_log_at_commit=2
    innodb_flush_log_at_trx_commit=2
    innodb_flush_method
    InnoDB redo log
    innodb_buffer_pool_size
    SET GLOBAL
    innodb_log_buffer_size
    innodb_flush_method
    InnoDB redo log
    InnoDB redo log
    innodb_log_files_in_group
    innodb_log_file_size
    InnoDB redo log
    mariadb-backup
    InnoDB redo log
    MariaDB 10.11.9
    MariaDB 10.6.18
    MariaDB 10.11.8
    MariaDB 11.4.2
    InnoDB Page Flushing
    Xtrabackup
    XtraDB redo log
    innodb_track_changed_pages
    innodb_max_changed_pages
    Information Schema INNODB_CHANGED_PAGES table
    innodb_max_bitmap_file_size
    innodb_track_changed_pages
    InnoDB Page Flushing
    innodb_max_dirty_pages_pct
    InnoDB Page Flushing
    innodb_max_purge_lag
    innodb_undo_log_truncate
    innodb_sort_buffer_size
    Fusion-io Multi-threaded Flush
    innodb_page_cleaners
    InnoDB Page Flushing: Page Flushing with Multi-threaded Flush Threads
    INFORMATION_SCHEMA.INNODB_METRICS
    INFORMATION_SCHEMA.INNODB_METRICS
    INFORMATION_SCHEMA.INNODB_METRICS
    INFORMATION_SCHEMA.INNODB_METRICS
    InnoDB buffer pool
    buffer pool
    buffer pool
    innodb_old_blocks_pct
    innodb_sort_buffer_size
    open_files_limit
    innodb_file_per_table
    table_open_cache
    OPTIMIZE TABLE
    FULLTEXT index
    innodb_buffer_pool_instances
    buffer pool
    InnoDB Page Flushing: Page Flushing with Multiple InnoDB Page Cleaner Threads
    maximum row size
    innodb_corrupt_table_action
    error log
    InnoDB undo log
    innodb_purge_threads
    innodb_undo_log_truncate
    innodb_undo_log_truncate=ON
    MariaDB 10.6.16
    MariaDB 10.11.6
    MDEV-32050
    innodb_purge_batch_size
    innodb_read_ahead_threshold
    innodb_random_read_ahead
    MariaDB 10.6.6
    ROW_FORMAT=COMPRESSED
    innodb_thread_concurrency
    innodb_lock_wait_timeout
    undo log
    innodb_undo_logs
    TRUNCATE TABLE
    mariadb-backup
    InnoDB redo log
    Data Scrubbing
    MDEV-13019
    MDEV-18370
    innodb_encrypt_log
    innodb_log_file_size
    Data Scrubbing
    innodb_scrub_log_speed
    InnoDB redo log
    InnoDB redo log
    Data Scrubbing
    SHOW ENGINE INNODB STATUS
    innodb_status_output_locks
    INFORMATION_SCHEMA.INNODB_METRICS
    REPEATABLE READ
    CREATE TABLE
    ALTER TABLE
    CREATE TABLE
    innodb_stats_persistent
    innodb_stats_persistent_sample_pages
    InnoDB Persistent Statistics
    ANALYZE TABLE
    innodb_stats_auto_recalc
    SHOW INDEX
    SHOW TABLE STATUS
    ANALYZE TABLE
    CREATE TABLE
    InnoDB Persistent Statistics
    ANALYZE TABLE
    InnoDB Persistent Statistics
    innodb_stats_traditional
    innodb_stats_traditional
    innodb_stats_transient_sample_pages
    innodb_stats_traditional
    innodb_stats_traditional
    innodb_stats_traditional
    innodb_stats_traditional
    SHOW TABLE STATUS
    InnoDB monitor
    error log
    InnoDB lock monitor
    error log
    SHOW ENGINE INNODB STATUS
    innodb_status_output=ON
    InnoDB Strict Mode
    XA transactions
    binary log
    replication
    autocommit
    LOCK TABLE
    InnoDB
    autoshrink
    tmpdir
    Xtrabackup
    XtraDB redo log
    innodb_max_changed_pages
    innodb_max_bitmap_file_size
    undo logs
    datadir
    innodb_undo_logs
    innodb_undo_tablespaces
    innodb_undo_tablespaces
    innodb_max_undo_log_size
    innodb_purge_rseg_truncate_frequency
    undo logs
    Innodb_available_undo_logs
    innodb_undo_directory
    innodb_undo_tablespaces
    innodb_rollback_segments
    Information Schema XTRADB_RSEG Table
    undo logs
    MariaDB 10.11.1
    innodb_undo_directory
    innodb_undo_log_truncate
    MariaDB 10.6
    innodb_undo_logs
    atomic write support
    innodb_use_atomic_writes
    FusionIO DirectFS atomic write support
    InnoDB Page Compression: Saving Storage Space with Sparse Files
    innodb_flush_log_at_trx_commit
    innodb_page_cleaners
    InnoDB Page Flushing: Page Flushing with Multi-threaded Flush Threads
    MariaDB 10.6.5
    MDEV-26674
    innodb_flush_method=O_DIRECT
    MariaDB 10.6
    ANALYZE TABLE
    InnoDB Page Compression: Saving Storage Space with Sparse Files
    MDEV-6076
    MDEV-11369
    Galera
    InnoDB redo log
    MariaDB 10.6.0
    MDEV-19916
    InnoDB Page Size
    InnoDB Page Size
    InnoDB Page Size
    MariaDB 10.6.6
    innodb_buffer_pool_instances
    innodb_log_file_write_through=OFF
    innodb_data_file_write_through=OFF
    innodb_data_file_buffering=ON
    MariaDB 10.6.15
    MariaDB 10.11.5
    MariaDB 10.0.14
    MariaDB 10.0.14
    MariaDB 10.0.14
    MariaDB 10.0.14
    MariaDB 10.0.14
    MariaDB 10.0.14
    MariaDB 5.3
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.2.1
    MariaDB 10.2.2
    MariaDB 10.1
    MariaDB 10.2.2
    MariaDB Enterprise Server
    MariaDB 10.4
    MariaDB 10.4
    MariaDB 10.5.15
    MariaDB 10.7.3
    MariaDB 10.8.2
    MariaDB 10.9.0
    MariaDB 11.0.0
    MariaDB 11.0
    MariaDB 5.5
    MariaDB 10.5.14
    MariaDB 10.7.2
    MariaDB 10.8.1
    MariaDB 10.5.15
    MariaDB 10.7.3
    MariaDB 10.8.2
    MariaDB 10.2.3
    MariaDB 10.2.4
    MariaDB 10.3
    MariaDB 10.5
    MariaDB 11.5
    MariaDB 11.0
    MariaDB 10.0
    MariaDB 11.0
    MariaDB 10.5
    MariaDB 10.2
    MariaDB 11.3.0
    MariaDB 10.0
    MariaDB 10.3
    MariaDB 10.4
    MariaDB 10.3
    MariaDB 10.4
    11.2
    MariaDB 11.2.0
    MariaDB 11.2.3
    11.2.0
    MariaDB 11.2
    MariaDB Enterprise Server 10.5
    MariaDB Enterprise Server 10.5
    MariaDB 10.5
    MariaDB 10.5
    MariaDB 10.5
    MariaDB 10.9
    MariaDB 10.9
    10.5
    10.5
    MariaDB 10.5
    MariaDB 10.8
    MariaDB 10.8
    MariaDB 10.8.1
    MariaDB 10.8.1
    MariaDB 10.8.1
    MariaDB 10.1
    MariaDB 10.2
    MariaDB 10.3
    MariaDB 10.3
    MariaDB 10.2
    MariaDB 10.1
    MariaDB 10.0
    MariaDB 10.3.7
    MariaDB 10.3.3
    MariaDB 10.3.1
    MariaDB 10.3.0
    MariaDB 10.2.33
    MariaDB 10.2.17
    MariaDB 10.2.15
    MariaDB 10.2.13
    MariaDB 10.2.10
    MariaDB 10.2.8
    MariaDB 10.1.46
    MariaDB 10.1.44
    MariaDB 10.1.39
    MariaDB 10.1.37
    MariaDB 10.1.31
    MariaDB 10.1.26
    MariaDB 10.0.38
    MariaDB 10.0.37
    MariaDB 10.0.35
    MariaDB 10.0.34
    MariaDB 10.0.33
    MariaDB 10.0.32
    MariaDB 10.2.7
    MariaDB 10.2.2
    MariaDB 10.1.24
    MariaDB 10.1.21
    MariaDB 10.1.18
    MariaDB 10.1.17
    MariaDB 10.1.16
    MariaDB 10.1.14
    MariaDB 10.1.12
    MariaDB 10.0.31
    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.9
    MariaDB 10.0.8
    11.2.1
    MariaDB 11.2.1
    MariaDB 10.1.2
    MariaDB 10.1.2
    MariaDB 10.2.17
    MariaDB 10.2
    MariaDB 10.2.7
    MariaDB 10.2.7
    MariaDB 10.2.6
    MariaDB 10.2.7
    MariaDB 10.2.7
    MariaDB 10.2.7
    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
    MariaDB 10.7
    MariaDB 10.7
    MariaDB 10.7
    MariaDB 10.1
    MariaDB 10.2.3
    MariaDB 10.3
    MariaDB 10.2
    MariaDB 10.2.3
    MariaDB 10.1.21
    MariaDB 10.2.4
    MariaDB 10.1.22
    MariaDB 10.3.2
    MariaDB 10.4
    MariaDB 10.4
    MariaDB 10.4.3
    MariaDB 10.3.8
    MariaDB 10.3.10
    MariaDB 10.3.6
    MariaDB 10.3.2
    MariaDB 10.4
    MariaDB 10.4
    MariaDB 10.4
    MariaDB 10.4
    MariaDB 10.4.3
    MariaDB 10.4.3
    MariaDB 10.4.3
    MariaDB 10.4.3
    MariaDB 10.4.3
    MariaDB 10.4.3
    MariaDB 10.3.8
    MariaDB 10.3.10
    MariaDB 10.3.6
    MariaDB 10.3.18
    MariaDB 10.4.8
    MariaDB 10.4.9
    MariaDB 10.3.17
    MariaDB 10.4.7
    MariaDB 10.4.3
    MariaDB 10.3.17
    MariaDB 10.4.7
    MariaDB 10.4.9
    MariaDB 10.7.5
    MariaDB 10.8.4
    MariaDB 10.9.2
    MariaDB 10.2.2
    MariaDB 10.4.3
    MariaDB 10.2.2
    MariaDB 10.2.2
    MariaDB 10.3.8
    MariaDB 10.3.10
    MariaDB 10.3.6
    MariaDB 10.1
    MariaDB 10.2
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.0.1
    MariaDB 10.0.8
    MariaDB 10.0
    MariaDB 10.5
    MariaDB 10.2.6
    MariaDB 10.5.5
    MariaDB 10.0
    MariaDB 10.2
    MariaDB 10.0
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.8.0
    MariaDB 5.5
    MariaDB 10.2
    MariaDB 10.2.2
    MariaDB 10.3
    MariaDB 10.5.1
    MariaDB 10.0.23
    MariaDB 10.2.6
    MariaDB 10.0
    MariaDB 10.9.0
    MariaDB 10.0
    MariaDB 5.5
    MariaDB 10.3.29
    MariaDB 10.4.19
    MariaDB 10.5.10
    MariaDB 10.0
    MariaDB 10.2.6
    MariaDB 10.5.5
    MariaDB 10.5.5
    MariaDB 10.0
    MariaDB 11.0.6
    MariaDB 10.1.24
    MariaDB 10.2.6
    MariaDB 5.5
    MariaDB 10.1
    MariaDB 10.2.6
    MariaDB 10.3
    MariaDB 10.0
    MariaDB 10.3.6
    MariaDB 11.0
    MariaDB 10.0
    MariaDB 10.4.4
    MariaDB 10.5.4
    MariaDB 10.2.6
    MariaDB 10.2.2
    MariaDB 10.2.37
    MariaDB 10.3.28
    MariaDB 10.4.18
    MariaDB 10.5.9
    MariaDB 10.0
    MariaDB 10.4
    MariaDB 10.2.6
    MariaDB 10.2.12
    MariaDB 5.5
    MariaDB 10.1
    MariaDB 10.2.6
    MariaDB 10.0
    MariaDB 10.5
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.0.9
    MariaDB 10.2.6
    MariaDB 10.5.0
    MariaDB 10.5.3
    MariaDB 10.8.3
    MariaDB 10.5
    MariaDB 10.9
    MariaDB 10.5.2
    MariaDB 10.5.1
    MariaDB 10.4.16
    MariaDB 10.3.26
    MariaDB 10.2.35
    MariaDB 10.8
    MariaDB 11.0.6
    MariaDB 11.1.5
    MariaDB 11.2.4
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.0
    MariaDB 10.2.6
    MariaDB 10.0
    MariaDB 10.2.2
    MariaDB 10.2.5
    MariaDB 10.2.9
    MariaDB 10.3.2
    MariaDB 10.2.4
    MariaDB 10.2.1
    MariaDB 10.5.1
    MariaDB 10.10
    MariaDB 10.10.7
    MariaDB 11.0.4
    MariaDB 11.1.3
    MariaDB 11.2.2
    MariaDB 5.5
    MariaDB 10.0
    MariaDB 10.5
    MariaDB 10.5
    MariaDB 10.0
    MariaDB 10.5.5
    MariaDB 5.5
    MariaDB 10.0
    MariaDB 10.5
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 11.6.2
    MariaDB 10.3.5
    MariaDB 10.0
    MariaDB 10.3
    MariaDB 10.5.5
    MariaDB 10.5.5
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.2.2
    MariaDB 10.0
    MariaDB 10.5.0
    MariaDB 11.0
    MariaDB 11.0
    MariaDB 10.2.6
    MariaDB 10.2.9
    MariaDB 10.3.2
    MariaDB 10.7.1
    MariaDB 10.2.6
    MariaDB 10.0
    MariaDB 10.2
    MariaDB 10.3.7
    MariaDB 10.1
    MariaDB 10.2
    MariaDB 10.3
    MariaDB 10.5
    MariaDB 10.5
    MariaDB 10.0
    MariaDB 10.5
    MariaDB 10.4
    MariaDB 10.5.5
    MariaDB 10.5.4
    MariaDB 10.0
    MariaDB 10.5.5
    MariaDB 10.0
    MariaDB 10.2.2
    MariaDB 11.1.6
    MariaDB 11.2.5
    MariaDB 11.5.2
    MariaDB 11.6.1
    MariaDB 10.0
    MariaDB 10.2.4
    MariaDB 10.0
    MariaDB 10.2.4
    MariaDB 10.0
    MariaDB 10.2.4
    MariaDB 10.0
    MariaDB 10.2.4
    MariaDB 10.0
    MariaDB 10.2.4
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.5.2
    MariaDB 10.0.0
    MariaDB 10.8.1
    MariaDB 10.8.0
    MariaDB 10.8
    MariaDB 10.7
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.0.4
    MariaDB 10.2.2
    MariaDB 10.5.1
    MariaDB 10.0.23
    MariaDB 10.3.0
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.2.28
    MariaDB 10.3.19
    MariaDB 10.4.9
    MariaDB 10.0
    MariaDB 10.9.0
    MariaDB 11.0.0
    MariaDB 10.3.7
    MariaDB 10.3.6
    MariaDB 10.5.15
    MariaDB 10.7.3
    MariaDB 10.8.2
    MariaDB 10.5.14
    MariaDB 10.7.2
    MariaDB 10.8.1
    MariaDB 10.9.0
    MariaDB 11.0.0
    MariaDB 10.0
    MariaDB 10.4.3
    MariaDB 10.3.29
    MariaDB 10.4.19
    MariaDB 10.5.10
    MariaDB 10.5.0
    MariaDB 10.2.2
    MariaDB 10.4
    MariaDB 10.5
    MariaDB 10.4.3
    MariaDB 10.0
    MariaDB 10.5.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.0
    MariaDB 10.5.5
    MariaDB 10.7
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.5.5
    MariaDB 10.5.4
    MariaDB 10.5.5
    MariaDB 10.2.6
    MariaDB 10.1
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 11.0.0
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 11.0.0
    MariaDB 10.1.3
    MariaDB 10.1.4
    MariaDB 11.0.1
    MariaDB 11.1.0
    MariaDB 11.0.1
    MariaDB 11.1.0
    MariaDB 11.0.1
    MariaDB 11.1.0
    MariaDB 11.0.1
    MariaDB 11.1.0
    MariaDB 11.0.1
    MariaDB 11.1.0
    MariaDB 11.0.1
    MariaDB 11.1.0
    MariaDB 10.0
    MariaDB 10.3.35
    MariaDB 10.4.25
    MariaDB 10.5.16
    MariaDB 10.7.4
    MariaDB 10.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.26
    MariaDB 10.3.17
    MariaDB 10.4.7
    MariaDB 10.1.45
    MariaDB 10.2.32
    MariaDB 10.3.23
    MariaDB 10.4.13
    MariaDB 10.5.3
    MariaDB 10.1.46
    MariaDB 10.2.33
    MariaDB 10.3.24
    MariaDB 10.4.14
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.0
    MariaDB 10.3.6
    MariaDB 10.3.6
    MariaDB 10.3.5
    MariaDB 10.2
    MariaDB 10.3.1
    MariaDB 10.4.3
    MariaDB 10.2
    MariaDB 10.3.1
    MariaDB 10.2
    MariaDB 10.3.1
    MariaDB 11.0.1
    MariaDB 5.5
    MariaDB 10.5
    MariaDB 10.0
    MariaDB 5.5
    MariaDB 11.0
    MariaDB 11.0
    MariaDB 10.3.7
    MariaDB 10.3.6
    MariaDB 10.3.7
    MariaDB 10.5
    MariaDB 11.0
    MariaDB 10.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.0.9
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.2.37
    MariaDB 10.3.28
    MariaDB 10.4.18
    MariaDB 10.5.9
    MariaDB 10.0
    MariaDB 10.4
    MariaDB 10.3
    MariaDB 10.4
    MariaDB 10.3
    MariaDB 10.4
    MariaDB 10.3.23
    MariaDB 10.4.13
    MariaDB 10.5.3
    MariaDB 10.2.5
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2
    MariaDB 10.3.1
    MariaDB 10.4.3
    MariaDB 10.0.0
    MariaDB 10.2.12
    MariaDB 10.1.30
    MariaDB 10.2.11
    MariaDB 10.1.29
    MariaDB 10.3.9
    MariaDB 10.2.17
    MariaDB 10.2.3
    MariaDB 10.1
    MariaDB 10.5.7
    MariaDB 10.4.16
    MariaDB 10.3.26
    MariaDB 10.2.35
    MariaDB 10.3
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.0
    MariaDB 10.5.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.1
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.5.0
    MariaDB 10.5.3
    MariaDB 11.2.6
    MariaDB 11.6.2
    MariaDB 11.7.1
    MariaDB 10.9
    MariaDB 10.8
    MariaDB 10.5
    MariaDB 10.4
    MariaDB 10.8.3
    MariaDB 10.8.2
    MariaDB 11.0.0
    MariaDB 10.5
    MariaDB 10.4
    MariaDB 10.2.4
    MariaDB 10.5.2
    MariaDB 10.5.1
    MariaDB 10.4.16
    MariaDB 10.3.26
    MariaDB 10.2.35
    MariaDB 10.5.0
    MariaDB 10.4.15
    MariaDB 10.3.25
    MariaDB 10.2.34
    MariaDB 10.2.17
    MariaDB 10.3.9
    MariaDB 10.5.1
    MariaDB 10.4.16
    MariaDB 10.3.26
    MariaDB 10.2.35
    MariaDB 11.0.6
    MariaDB 11.1.5
    MariaDB 11.2.4
    MariaDB 11.5.1
    MariaDB 10.7
    MariaDB 10.7
    MariaDB 10.7
    MariaDB 10.8
    MariaDB 11.1.6
    MariaDB 11.2.5
    MariaDB 11.5.2
    MariaDB 11.2.6
    MariaDB 11.6.1
    MariaDB 11.7.1
    MariaDB 11.2.5
    MariaDB 10.5.7
    MariaDB 11.2.6
    MariaDB 11.6.1
    MariaDB 11.7.1
    MariaDB 10.5.7
    MariaDB 10.5.6
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 10.5.7
    MariaDB 10.5.6
    MariaDB 10.2.1
    MariaDB 10.2.0
    MariaDB 10.5.7
    MariaDB 10.4.16
    MariaDB 10.3.26
    MariaDB 10.2.35
    MariaDB 10.0
    MariaDB 10.2.9
    MariaDB 10.3.2
    MariaDB 10.2.23
    MariaDB 10.3.14
    MariaDB 10.4.4
    MariaDB 10.3.3
    MariaDB 10.3.2
    MariaDB 10.5.1
    MariaDB 10.10.1
    MariaDB 11.2.6
    MariaDB 11.6.2
    MariaDB 10.10.7
    MariaDB 11.0.4
    MariaDB 11.1.3
    MariaDB 11.2.2
    MariaDB 10.10.7
    MariaDB 11.0.4
    MariaDB 11.1.3
    MariaDB 11.2.2
    MariaDB 10.0
    MariaDB 10.10
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.5.5
    MariaDB 10.0
    MariaDB 10.5.0
    MariaDB 10.2.19
    MariaDB 10.3.0
    MariaDB 10.5.2
    MariaDB 10.1.3
    MariaDB 10.1.4
    MariaDB 10.5.2
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 11.6.2
    MariaDB 11.6.1
    MariaDB 11.0.6
    MariaDB 11.1.5
    MariaDB 11.2.4
    MariaDB 10.3.5
    MariaDB 10.3.4
    MariaDB 10.0
    MariaDB 10.0
    MariaDB 10.5.0
    MariaDB 10.0
    MariaDB 10.2
    MariaDB 10.3.0
    MariaDB 10.5.5
    MariaDB 10.0
    MariaDB 10.5.5
    MariaDB 10.5.4
    MariaDB 10.5.5
    MariaDB 10.2.6
    MariaDB 10.2.6
    MariaDB 11.3.0
    MariaDB 10.5.0
    MariaDB 11.0
    MariaDB 10.2.5
    MariaDB 10.3.0
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.2.9
    MariaDB 10.3.2
    MariaDB 10.2.6
    MariaDB 10.3.0
    MariaDB 10.0
    MariaDB 10.2.2
    MariaDB 10.0
    MariaDB 10.2.4
    MariaDB 10.3.0
    MariaDB 10.10
    MariaDB 10.10
    MariaDB 10.2.42
    MariaDB 10.3.33
    MariaDB 10.4.23
    MariaDB 10.5.14
    MariaDB 10.7.2
    MariaDB 10.7
    MariaDB 10.2.1
    MariaDB 10.4.2
    MariaDB 10.5.4
    MariaDB 10.3.6
    MariaDB 10.1
    MariaDB 10.10.6
    MariaDB 11.0.3
    MariaDB 11.1.2
    MariaDB 11.2.1