Hi Michael,
Problem for this variant: merge table has to be dropped and recreated periodically. during the short lag interval the log merge table does not exist
You don't have to drop and re-create the table. Please don't edit the MRG file directly either.
You can accomplish this easily by using the ALTER TABLE statement:
CREATE TABLE t1 (id INT NOT NULL, c CHAR(10) NOT NULL, PRIMARY KEY(id)); CREATE TABLE t2 (id INT NOT NULL, c CHAR(10) NOT NULL, PRIMARY KEY(id));
CREATE TABLE t_merge (id INT NOT NULL, c CHAR(10) NOT NULL, KEY(id)) TYPE=MERGE UNION=(t1, t2);
So now you have a MERGE table containing both tables. If you want to add a third one later:
CREATE TABLE t3 (id INT NOT NULL, c CHAR(10) NOT NULL, PRIMARY KEY(id));
ALTER TABLE t_merge UNION=(t1, t2, t3);
Using ALTER TABLE with a MERGE table is an atomic operation and can be done while the server is up and running full-speed without any problems.
Regards,
Jeremy
-- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Jeremy Cole <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Training and Consulting Manager /_/ /_/\_, /___/\___\_\___/ Streetsboro, Ohio USA <___/ www.mysql.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]