[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
MERGE
Table Problems
The following are the known problems with MERGE
tables:
MERGE
table cannot maintain UNIQUE
constraints over the
whole table. When you do INSERT
, the data goes into the first or
last table (according to INSERT_METHOD=xxx
) and this MyISAM
table ensures that the data are unique, but it knows nothing about
others MyISAM
tables.
DELETE FROM merge_table
used without a WHERE
will clear only the mapping for the table, not delete everything in the
mapped tables.
RENAME TABLE
on a table used in an active MERGE
table may
corrupt the table. This will be fixed in MySQL 4.1.x.
MERGE
doesn't check if the underlying
tables are of compatible types or if they exists. MySQL will do a quick check
if the record length is equal between mapped tables when the MERGE
table is used, but this is not a fullproof check.
If you use MERGE
tables in this fashion, you are very likely to
run into strange problems.
ALTER TABLE
to first add an UNIQUE
index to a
table used in a MERGE
table and then use ALTER TABLE
to
add a normal index on the MERGE
table, the key order will be
different for the tables if there was an old non-unique key in the
table. This is because ALTER TABLE
puts UNIQUE
keys before
normal keys to be able to detect duplicate keys as early as possible.
DROP TABLE
on a table that is in use by a MERGE
table will
not work on Windows because the MERGE
storage engine does the table
mapping hidden from the upper layer of MySQL. Because Windows doesn't allow
you to drop files that are open, you first must flush all MERGE
tables (with FLUSH TABLES
) or drop the MERGE
table before
dropping the table. We will fix this at the same time we introduce
views.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |