Merge table is a collection of MyISAM tables, having identical columns and indexes, that can be used as one.
Creating a Merge Table
- Click Create New Database Object and specify type Table in the dialog.
- Input name of the table.
- Click the Create button and, if specified name is unique, the table will appear in Database Explorer.
- Specify the MERGE Table type.
- You can set table columns and indexes manually. They must be the same as in the underlying MyISAM tables. This step is optional.
- Switch to the Merge Options tab.
- Select Insert Method to determine the MyISAM table to insert rows into when they are inserted in the merge table.
- Select the owner of the underlying tables.
- Add the tables you need from the Available tables list to the Underlying tables list using the button.
- If you have skipped step 5, select a table in the Underlying tables list and click the Import button to import the table structure from the selected table. You may inspect the selected table structure by clicking the blue-colored table name near the Import button.
- Save the document.
MySQL does not check if the underlying tables have the same structure or even if they are MyISAM tables when creating the merge table. However, if you create a merge table with non-MyISAM tables or tables with different structure, or if you drop or alter the underlying table after creating the merge table, you are very likely to encounter errors when working with the merge table.
Editing a Merge Table
You can edit a merge table by selecting Edit Table on the Database Explorer node shortcut menu. If you change the Table type of the merge table, you will lose the mapping to the underlying tables. Data rows will be copied to the altered table and stored using the new storage engine.
Dropping a Merge Table
You can drop view by selecting Delete on the Database Explorer node shortcut menu.