Aria Storage Engine

The Aria storage engine is compiled in by default from MariaDB 5.1 and it is required to be 'in use' when mysqld is started.

From MariaDB 10.4, all system tables are Aria.

Additionally, internal on-disk tables are in the Aria table format instead of the MyISAM table format. This should speed up some GROUP BY and DISTINCT queries because Aria has better caching than MyISAM.

Note: The Aria storage engine was previously called Maria (see The Aria Name for details on the rename) and in previous versions of MariaDB the engine was still called Maria.

There are also some new options to CREATE TABLE:

  • TRANSACTIONAL= 0 | 1 : Not set by default, if set to 1, tables will be transactional, meaning all changes are logged to a transaction log, and synced at the end of the statement. This will marginally slow down writes and updates, but makes the table crash-proof, so that if the server dies before the statement ends, all changes will roll back to the state at the beginning of the statement. This also needs up to 6 bytes more for each row and key to store the transaction id (to allow concurrent insert's and selects). TRANSACTIONAL=1 is not supported for partitioned tables. If left unset, tables may still be transactional (see below).
  • PAGE_CHECKSUM= 0 | 1 : If index and data should use page checksums for extra safety.
  • TABLE_CHECKSUM= 0 | 1 : Same as CHECKSUM in MySQL 5.1
  • ROW_FORMAT=PAGE : Default row format for Aria data tables and only row format that can be used if TRANSACTIONAL=1. To emulate MyISAM, use ROW_FORMAT=FIXED or ROW_FORMAT=DYNAMIC
  • The default row format is PAGE, and the PAGE by default means transactional. The TRANSACTIONAL and ROW_FORMAT options interact as follows:
    • If TRANSACTIONAL=1 was specified, the row format will be PAGE. If a user has specified some other row format, Aria issues a warning, but still forces the row format to be PAGE.
    • If TRANSACTIONAL=0 was specified, the table will be not transactional and the row format will be whatever the user has specified (or PAGE, by default).
    • If TRANSACTIONAL was not specified at all, the row format will be whatever the user has specified (or PAGE, by default), and the table will be transactional if the row format will end up being PAGE and non-transactional otherwise.
  • CHECKSUM TABLE now ignores values in NULL fields. This makes CHECKSUM TABLE faster and fixes some cases where same table definition could give different checksum values depending on row format. The disadvantage is that the value is now different compared to other MySQL installations. The new checksum calculation is fixed for all table engines that uses the default way to calculate and MyISAM which does the calculation internally. Note: Old MyISAM tables with internal checksum will return the same checksum as before. To fix them to calculate according to new rules you have to do an ALTER TABLE. You can use the old ways to calculate checksums by using the option --old to mysqld or set the system variable '@@old' to 1 when you do CHECKSUM TABLE ... EXTENDED;
  • At startup Aria will check the Aria logs and automatically recover the tables from the last checkpoint if mysqld was not taken down correctly.

mysqld Startup Options for Aria

For a full list, see Aria System Variables.

In normal operations, the only variables you have to consider are:

  • aria-pagecache-buffer-size
    • This is where all index and data pages are cached. The bigger this is, the faster Aria will work.
  • aria-block-size
    • The default value 8192, should be ok for most cases. The only problem with a higher value is that it takes longer to find a packed key in the block as one has to search roughly 8192/2 to find each key. We plan to fix this by adding a dictionary at the end of the page to be able to do a binary search within the block before starting a scan. Until this is done and key lookups takes too long time even if you are not hitting disk, then you should consider making this smaller.
    • Possible values to try are 2048, 4096 or 8192
    • Note that you can't change this without dumping, deleting old tables and deleting all log files and then restoring your Aria tables. (This is the only option that requires a dump and load)
  • aria-log-purge-type
    • Set this to "at_flush" if you want to keep a copy of the transaction logs (good as an extra backup). The logs will stay around until you execute FLUSH ENGINE LOGS.

See Also

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.