This FAQ provides information on the Aria storage engine.
The Aria storage engine was previously known as Maria, (see, the Aria Name). In current releases of MariaDB, you can refer to the engine as Maria or Aria. As this will change in future releases, please update references in your scripts and automation to use the correct name.
Aria is a storage engine for MySQL® and MariaDB. It was originally developed with the goal of becoming the default transactional and non-transactional storage engine for MariaDB and MySQL.
It has been in development since 2007 and was first announced on Monty's blog. The same core MySQL engineers who developed the MySQL server and the MyISAM, MERGE, and MEMORY storage engines are also working on Aria.
Originally, the storage engine was called Maria, after Monty's younger daughter. Monty named MySQL after his first child, My and his second child Max gave his name to MaxDB and the MySQL-Max distributions.
In practice, having both MariaDB the database server and Maria the storage engine with such similar names proved confusing. To mitigate this, the decision was made to change the name. A Rename Maria contest was held during the first half of 2010 and names were submitted from around the world. Monty picked the name Aria from a short list of finalist. Chris Tooley, who suggested it, received the prize of a Linux-powered System 76 Meerkat NetTop from Monty Program.
For more information, see the Aria Name.
The current version of Aria is 1.5. The goal of this release is to develop a crash-safe alternative to MyISAM. That is, when MariaDB restarts after a crash, Aria recovers all tables to the state as of the start of a statement or at the start of the last LOCK TABLES
statement.
The current goal is to keep the code stable and fix all bugs.
The next version of Aria is 2.0. The goal for this release is to develop a fully transactional storage engine with at least all the major features of InnoDB.
Currently, Aria 2.0 is on hold as its developers are focusing on improving MariaDB. However, they are interested in working with interested customers and partners to add more features to Aria and eventually release 2.0.
These are some of the goals for Aria 2.0:
Beginning in Aria 2.5, the plan is to focus on improving performance.
Long term, we have the following goals for Aria:
Documentation is available at Aria and related topics. The project is maintained on GitHub.
If you want to know what happens or be part of developing Aria, you can subscribe to the maria-developers, maria-docs, or maria-discuss groups on Launchpad.
To report and check bugs in Aria, see Reporting Bugs.
You can usually find some of the Maria developers online on the IRC channel #maria at freenode.
The Core Team who develop Aria are:
Technical lead
Core Developers (in alphabetical order)
All except Guilhem Bichot are working for MariaDB Corporation Ab.
Aria follows the same release criteria as for MariaDB. Some clarifications, unique for the Aria storage engine:
aria_log.%
and maria_log.%
files before restarting MariaDB. (So far, this has only occurred in the upgrade from MariaDB 5.1 and MariaDB 5.2). Aria 1.0 was basically a crash-safe non-transactional version of MyISAM. Aria 1.5 added more concurrency (multiple inserter) and some optimizations.
Aria supports all aspects of MyISAM, except as noted below. This includes external and internal check/repair/compressing of rows, different row formats, different index compress formats, aria_chk
etc. After a normal shutdown you can copy Aria files between servers.
LOCK TABLES
statement. CREATE
, DROP
, RENAME
, TRUNCATE
tables). Therefore, you make a backup of Aria by just copying the log. The things that can't be replayed (yet) are: INSERT
into an empty table (This includes LOAD DATA INFILE
, SELECT... INSERT
and INSERT
(many rows)). ALTER TABLE
. Note that .frm
tables are NOT recreated! LOAD INDEX
can skip index blocks for unwanted indexes. ROW
formats and new PAGE
format where data is stored in pages. (default size is 8K). PAGE
format (default) row data is cached by page cache. CREATE TABLE foo (...) TRANSACTIONAL=0|1 ENGINE=Aria
. PAGE
is the only crash-safe/transactional row format. PAGE
format should give a notable speed improvement on systems which have bad data caching. (For example Windows). aria_log_control
) and log files (aria_log.%
). The log files can be automatically purged when not needed or purged on demand (after backup). INSERT DELAYED
. PAGE
format. MERGE
tables don't support Aria (should be very easy to add later). See:
TRANSACTIONAL
keyword now when Aria is not yet transactional?In the current development phase Aria tables created with TRANSACTIONAL=1
are crash safe and atomic but not transactional because changes in Aria tables can't be rolled back with the ROLLBACK
command. As we planned to make Aria tables fully transactional, we decided it was better to use the TRANSACTIONAL
keyword from the start so so that applications don't need to be changed later.
KNOWN_BUGS.txt
for open/design bugs. If Aria doesn't start or you have an unrecoverable table (shouldn't happen):
aria_log.%
files from the data directory. mysqld
and run CHECK TABLE
, REPAIR TABLE
or mysqlcheck
on your Aria tables. Alternatively,
aria_chk
on your *.MAI
files. The LOCK TABLES
statement will not start a crash-safe segment. You should use BEGIN
and COMMIT
instead.
To make things future safe, you could do this:
BEGIN; LOCK TABLES .... UNLOCK TABLES; COMMIT;
And later you can just remove the LOCK TABLES
and UNLOCK TABLES
statements.
Example:
CREATE TABLE t1 (a int) ROW_FORMAT=FIXED TRANSACTIONAL=0 PAGE_CHECKSUM=0; CREATE TABLE t2 (a int) ROW_FORMAT=DYNAMIC TRANSACTIONAL=0 PAGE_CHECKSUM=0; SHOW CREATE TABLE t1; SHOW CREATE TABLE t2;
Note that the rows are not cached in the page cache for FIXED
or DYNAMIC
format. If you want to have the data cached (something MyISAM doesn't support) you should use ROW_FORMAT=PAGE
:
CREATE TABLE t3 (a int) ROW_FORMAT=PAGE TRANSACTIONAL=0 PAGE_CHECKSUM=0; SHOW CREATE TABLE t3;
You can use PAGE_CHECKSUM=1
also for non-transactional tables; This puts a page checksums on all index pages. It also puts a checksum on data pages if you use ROW_FORMAT=PAGE
.
You may still have a speed difference (may be slightly positive or negative) between MyISAM and Aria because of different page sizes. You can change the page size for MariaDB with --aria-block-size=\
#, where \
# is 1024, 2048, 4096, 8192, 16384 or 32768.
Note that if you change the page size you have to dump all your old tables into text (with mysqldump
) and remove the old Aria log and files:
# rm datadir/aria_log*
PAGE
format compared to the old MyISAM-like row formats (DYNAMIC
and FIXED
)The MyISAM-like DYNAMIC
and FIXED
format are extremely simple and have very little space overhead, so it's hard to beat them for when it comes to simple scanning of unmodified data. The DYNAMIC
format does however get notably worse over time if you update the row a lot in a manner that increases the size of the row.
The advantages of the PAGE
format (compared to DYNAMIC
or FIXED
) for non-transactional tables are:
DYNAMIC
format during UPDATE
statements. The maximum number of fragments are very low. DYNAMIC
). The disadvantages are:
row_format=PAGE
, (the default), Aria first writes the row, then the keys, at which point the check for duplicate keys happens. This makes PAGE
format slower than DYNAMIC
(or MyISAM) if there is a lot of duplicated keys because of the overhead of writing and removing the row. If this is a problem, you can use row_format=DYNAMIC
to get same behavior as MyISAM. An Aria table consists of 3 files:
XXX.frm : The definition for the table, used by MySQL. XXX.MYI : Aria internal information about the structure of the data and index and data for all indexes. XXX.MAD : The data.
It's safe to copy all the Aria files to another directory or MariaDB instance if any of the following holds:
mysqladmin shutdown
, so that there is nothing for Aria to recover when it starts. or
FLUSH TABLES
statement and not accessed the table using SQL from that time until the tables have been copied. In addition, you must adhere the following rule for transactional tables:
You can't copy the table to a location within the same MariaDB server if the new table has existed before and the new table is still active in the Aria recovery log (that is, Aria may need to access the old data during recovery). If you are unsure whether the old name existed, run aria_chk --zerofill
on the table before you use it.
After copying a transactional table and before you use the table, we recommend that you run the command:
$ aria_chk --zerofill table_name
This will overwrite all references to the logs (LSN), all transactional references (TRN) and all unused space with 0. It also marks the table as 'movable'. An additional benefit of zerofill is that the Aria files will compress better. No real data is ever removed as part of zerofill.
Aria will automatically notice if you have copied a table from another system and do 'zerofill' for the first access of the table if it was not marked as 'movable'. The reason for using aria_chk --zerofill
is that you avoid a delay in the MariaDB server for the first access of the table.
Note that this automatic detection doesn't work if you copy tables within the same MariaDB server!
If you want to remove the Aria log files (aria_log.%
) with rm
or delete, then you must first shut down MariaDB cleanly (for example, with mysqladmin shutdown
) before deleting the old files.
The same rules apply when upgrading MariaDB; When upgrading, first take down MariaDB in a clean way and then upgrade. This will allow you to remove the old log files if there are incompatible problems between releases.
Don't remove the aria_log_control
file! This is not a log file, but a file that contains information about the Aria setup (current transaction id, unique id, next log file number etc.).
If you do, Aria will generate a new aria_log_control
file at startup and will regard all old Aria files as files moved from another system. This means that they have to be 'zerofilled' before they can be used. This will happen automatically at next access of the Aria files, which can take some time if the files are big.
If this happens, you will see things like this in your mysqld.err file:
[Note] Zerofilling moved table: '.\database\xxxx'
As part of zerofilling no vital data is removed.
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/aria-faq/