There are a number of options available when you create a new
Maria
table:
PAGE_CHECKSUM
The PAGE_CHECKSUM
table option specifies
whether a page checksum for the table should be enabled. The
checksum can either be switched on (value 1) or off (value 0).
The default value of this option is implied by the
maria_page_checksum
variable.
Because the default value of the
PAGE_CHECKSUM
option is configurable, the
checksum setting is always included in the output of
SHOW CREATE TABLE
if it was
enabled when the table was created.
TRANSACTIONAL
Maria
tables can be either transactional or
non-transactional. For Maria
versions less
than 2.0, TRANSACTIONAL
means crash-safe.
Full transaction support will only be available with
Maria
2.0 and later.
Changes to transactional tables are recorded in the
Maria
log and use slightly more space per
row than non-transactional tables. By default all tables are
transactional; that is, TRANSACTIONAL=1
is
implied within the CREATE TABLE
definition. This means that the transactional status of the
table is not written in the output of the
SHOW CREATE TABLE
output:
mysql> create table maria_trans (id int, title char(20)) engine=Maria; Query OK, 0 rows affected (0.05 sec) mysql> SHOW CREATE TABLE maria_trans; +-------------+---------------------------------------+ | Table | Create Table | +-------------+---------------------------------------+ | maria_trans | CREATE TABLE `maria_trans` ( `id` int(11) DEFAULT NULL, `title` char(20) DEFAULT NULL ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 | +-------------+---------------------------------------+ 1 row in set (0.00 sec)
If you create a non-crash safe (non-transactional) table then the option is shown
mysql> CREATE TABLE maria_nontrans (id INT, title CHAR(20)) ENGINE=Maria TRANSACTIONAL=0; Query OK, 0 rows affected (0.02 sec) mysql> SHOW CREATE TABLE maria_nontrans; +----------------+----------------------------------------------------+ | Table | Create Table | +----------------+----------------------------------------------------+ | maria_nontrans | CREATE TABLE `maria_nontrans` ( `id` int(11) DEFAULT NULL, `title` char(20) DEFAULT NULL ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=0 | +----------------+----------------------------------------------------+ 1 row in set (0.00 sec)
Currently, transactional tables cannot handle
SPATIAL
or FULLTEXT
indexes. You must use a non-transactional table if you want to
use these index key types. If you try to create a table with
these options, then an error will occur during
CREATE TABLE
.
TABLE_CHECKSUM
, CHECKSUM
Forces MySQL to maintain a live checksum for all rows in the
table. This maintains a rolling checksum (that is, one that
changes when the table data changes), and can be used to
identify corrupted tables. This is identical to the
CHECKSUM
on MyISAM
tables.
The CHECKSUM TABLE
statement,
which returns the checksum for a given table, ignores record's
columns which have a NULL
value. This is
different behavior from standard MySQL 5.1.
In addition, Maria
supports the following row
formats:
FIXED
— identical to the
FIXED
row format used by
MyISAM
. Must be used with non-transactional
tables (that is, where TRANSACTIONAL=0
).
DYNAMIC
— identical to the
DYNAMIC
row format used by
MyISAM
. Must be used with non-transactional
tables (that is, where TRANSACTIONAL=0
).
PAGE
— new Maria
row format where data and index information is written into
pages. The PAGE
option can be used with
TRANSACTIONAL=0
or
TRANSACTIONAL=1
. The
PAGE
format uses a different caching
mechanism than MyISAM
. For more
information, see Section 13.5.1, “Maria
Configuration”.
Maria
data pages in PAGE
format have an overhead of 10 bytes/page and 5 bytes/row.
Transaction and multiple concurrent writer support will use an
additional overhead of 7 bytes for new rows, 14 bytes for
deleted rows and 0 bytes for old compacted rows.
User Comments
Add your own comment.