官术网_书友最值得收藏!

Merge

This storage engine is also known as a MRG_MyISAM storage engine. This storage engine merges a MyISAM table and creates it to be referred to a single view. For a merge table, all columns are listed in the same order. These tables are good for data warehousing environments.

The following example shows you how to create merge tables:

mysql> CREATE TABLE user1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name CHAR(20)) ENGINE=MyISAM;
mysql> CREATE TABLE user2 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name CHAR(20)) ENGINE=MyISAM;
mysql> INSERT INTO user1 (name) VALUES ('abc'),('xyz');
mysql> INSERT INTO user2 (name) VALUES ('def'),('pqr');
mysql> CREATE TABLE user (id INT NOT NULL AUTO_INCREMENT,name CHAR(20), INDEX(id))ENGINE=MERGE UNION=(user1,user2);

The table is used to manage log-related tables, generally. You can create different months of logs in separate MyISAM tables and merge these tables using the merge storage engine.

MyISAM tables have storage limit for the operating system but a collection of MyISAM (merge) tables do not have storage limits. So using a merge table would allow you to split data into multiple MyISAM tables, which can help in overcoming storage limits.

With the MERGE table, it is difficult to do partitioning hence it is not supported by MERGE tables and we cannot implement partition on MERGE table or any MyISAM table.

主站蜘蛛池模板: 安吉县| 株洲县| 天门市| 黎平县| 水富县| 苍梧县| 汉阴县| 五常市| 当涂县| 石城县| 鞍山市| 哈尔滨市| 霍城县| 象州县| 吴川市| 丹江口市| 大庆市| 甘南县| 台南市| 南通市| 托克逊县| 眉山市| 绥芬河市| 孙吴县| 会泽县| 湖南省| 三江| 东平县| 黄龙县| 明光市| 峨眉山市| 淮南市| 阳新县| 鄂尔多斯市| 梁平县| 手游| 信丰县| 华阴市| 昌吉市| 临清市| 县级市|