The
ARCHIVE
Storage Engine
1316
CREATE TABLE `T1`(`A` VARCHAR(100),UNIQUE KEY(`A`(30))) ENGINE=MYISAM;
The key prefix in this example is incompatible with the
FEDERATED
engine, and the equivalent
statement will fail:
CREATE TABLE `T1`(`A` VARCHAR(100),UNIQUE KEY(`A`(30))) ENGINE=FEDERATED
CONNECTION='MYSQL://127.0.0.1:3306/TEST/T1';
If possible, you should try to separate the column and index definition when creating tables on both
the remote server and the local server to avoid these index issues.
• Internally, the implementation uses
SELECT
,
INSERT
,
UPDATE
, and
DELETE
, but not
HANDLER
.
• The
FEDERATED
storage engine supports
SELECT
,
INSERT
,
UPDATE
,
DELETE
, and indexes. It
does not support
ALTER TABLE
, or any Data Definition Language statements that directly affect the
structure of the table, other than
DROP TABLE
. The current implementation does not use prepared
statements.
•
FEDERATED
accepts
INSERT ... ON DUPLICATE KEY UPDATE
statements, but if a duplicate-key
violation occurs, the statement fails with an error.
• Performance on a
FEDERATED
table when performing bulk inserts (for example, on a
INSERT
INTO ... SELECT ...
statement) is slower than with other table types because each selected
row is treated as an individual
INSERT
statement on the federated table.
• Before MySQL 5.0.46, for a multiple-row insert into a
FEDERATED
table that refers to a remote
transactional table, if the insert failed for a row due to constraint failure, the remote table would
contain a partial commit (the rows preceding the failed one) instead of rolling back the statement
completely. This occurred because the rows were treated as individual inserts.
As of MySQL 5.0.46,
FEDERATED
performs bulk-insert handling such that multiple rows are sent to
the remote table in a batch. This provides a performance improvement. Also, if the remote table is
transactional, it enables the remote storage engine to perform statement rollback properly should an
error occur. This capability has the following limitations:
• The size of the insert cannot exceed the maximum packet size between servers. If the insert
exceeds this size, it is broken into multiple packets and the rollback problem can occur.
• Bulk-insert handling does not occur for
INSERT ... ON DUPLICATE KEY UPDATE
.
• There is no way for the
FEDERATED
engine to know if the remote table has changed. The reason for
this is that this table must work like a data file that would never be written to by anything other than
the database system. The integrity of the data in the local table could be breached if there was any
change to the remote database.
• Any
DROP TABLE
statement issued against a
FEDERATED
table drops only the local table, not the
remote table.
•
FEDERATED
tables do not work with the query cache.
14.8. The
ARCHIVE
Storage Engine
The
ARCHIVE
storage engine is used for storing large amounts of data without indexes in a very small
footprint.
The
ARCHIVE
storage engine is included in MySQL binary distributions. To enable this storage engine
if you build MySQL from source, invoke
configure
with the
--with-archive-storage-engine
option.
To examine the source for the
ARCHIVE
engine, look in the
sql
directory of a MySQL source
distribution.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...