Home >Database >Mysql Tutorial >Introduction to the Merge storage engine of Mysql storage engine
MERGE storage engine is also mentioned in the MySQL user manual and is also known as the MRG_MyISAM engine. Why? Because the MERGE storage engine can be simply understood as its function is to implement a MyISAM table with the same structure and provide a single access entrance through some special packaging to reduce the complexity of the application. To create a MERGE table, not only the structure of the base table must be completely consistent, including the order of the fields, but the indexes of the base table must also be completely consistent.
The MERGE table itself does not store data, it just provides an agreed storage entry for multiple base tables. Therefore, when creating a MERGE table, MySQL will only generate two smaller files, one is the .frm structure definition file, and the other is the .MRG file, which is used to store the name of the table participating in MERGE (including the database schema to which it belongs) . The reason why you need to have a schema belonging to the database is because the MERGE table can not only merge tables in the same database, but also merge tables in different databases. As long as the permissions allow it and it is under the same mysqld, you can merge . After the MERGE table is created, the underlying base table can still be changed through related commands.
The MERGE table can not only provide reading services, but also write services. In order for the MERGE table to provide INSERT services, you must specify which base table the INSERT data is to be written to when the table is created, which can be controlled through the insert_method parameter. If this parameter is not specified, any attempt to INSERT data into the MERGE table will result in an error. In addition, the full-text index on the base table cannot be directly used through the MERGE table. To use the full-text index, it must be accessed through the base table itself.
The above is the introduction of the Merge storage engine of Mysql storage engine. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!