The
MyISAM
Storage Engine
1218
• They are safer. Even if MySQL crashes or you get hardware problems, you can get your data back,
either by automatic recovery or from a backup plus the transaction log.
• You can combine many statements and accept them all at the same time with the
COMMIT
statement
(if autocommit is disabled).
• You can execute
ROLLBACK
to ignore your changes (if autocommit is disabled).
• If an update fails, all of your changes are reverted. (With nontransaction-safe tables, all changes that
have taken place are permanent.)
• Transaction-safe storage engines can provide better concurrency for tables that get many updates
concurrently with reads.
You can combine transaction-safe and nontransaction-safe tables in the same statements to get the
best of both worlds. However, although MySQL supports several transaction-safe storage engines,
for best results, you should not mix different storage engines within a transaction with autocommit
disabled. For example, if you do this, changes to nontransaction-safe tables still are committed
immediately and cannot be rolled back. For information about this and other problems that can occur
in transactions that use mixed storage engines, see
Section 13.3.1, “
START TRANSACTION
,
COMMIT
,
and
ROLLBACK
Syntax”
.
Nontransaction-safe tables have several advantages of their own, all of which occur because there is
no transaction overhead:
• Much faster
• Lower disk space requirements
• Less memory required to perform updates
14.1. The
MyISAM
Storage Engine
MyISAM
is the default storage engine. It is based on the older (and no longer available)
ISAM
storage
engine but has many useful extensions.
Each
MyISAM
table is stored on disk in three files. The files have names that begin with the table name
and have an extension to indicate the file type. An
.frm
file stores the table format. The data file has
an
.MYD
(
MYData
) extension. The index file has an
.MYI
(
MYIndex
) extension.
To specify explicitly that you want a
MyISAM
table, indicate that with an
ENGINE
table option:
CREATE TABLE t (i INT) ENGINE = MYISAM;
The older term
TYPE
is supported as a synonym for
ENGINE
for backward compatibility, but
ENGINE
is
the preferred term and
TYPE
is deprecated.
Normally, it is unnecessary to use
ENGINE
to specify the
MyISAM
storage engine.
MyISAM
is the
default engine unless the default has been changed. To ensure that
MyISAM
is used in situations
where the default might have been changed, include the
ENGINE
option explicitly.
You can check or repair
MyISAM
tables with the
mysqlcheck
client or
myisamchk
utility. You can
also compress
MyISAM
tables with
myisampack
to take up much less space. See
Section 4.5.3,
“
mysqlcheck
— A Table Maintenance Program”
,
Section 4.6.3, “
myisamchk
— MyISAM Table-
Maintenance Utility”
, and
Section 4.6.5, “
myisampack
— Generate Compressed, Read-Only MyISAM
Tables”
.
MyISAM
tables have the following characteristics:
• All data values are stored with the low byte first. This makes the data machine and operating
system independent. The only requirements for binary portability are that the machine uses two's-
complement signed integers and IEEE floating-point format. These requirements are widely used
among mainstream machines. Binary compatibility might not be applicable to embedded systems,
which sometimes have peculiar processors.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...