The MERGE storage engine, also known as the MRG_MyISAM engine, is a collection of identical My ISAM
tables that can be used as one. “Identical" means that all tables have identical column and index
information. You cannot merge My ISAM tables in which the columns are listed in a different order, do
not have exactly the same columns, or have the indexes in different order. However, any or all of the
MylSAM tables can be compressed with myisampack. See Section 4.6.5,
“myisampack —Generate
Compressed, Read-Only MylSAM Tables”. Differences in table options such as
AVG_ROW_LENGTH,
MAX_ROWS, or PACK_KEYS do not matter.
An alternative to a MERGE table is a partitioned table. which Stores partitions of a single table in
separate files. Partitioning enables some operations to be performed morę efficiently and is not limited
to the MylSAM storage engine. For morę information, see Chapter 18, Partitioning. When you create a MERGE table, MySQL creates two files on disk. The files have names that begin with
the table name and have an extension to indicate the file type. An . f rm file Stores the table format,
and an . MRG file contains the names of the underlying MylSAM tables that should be used as one. The
tables do not have to be in the same database as the MERGE table.
You can use SELECT, DELETE, UPDATE, and INSERT on MERGE tables. You must have SELECT [775],
DELETE [774], and UPDATE [776] privileges on the MylSAM tables that you map to a MERGE table.