I am setting up a table in mysql engine type merge in mysql and wondered if I need to first create all my tables that I want to join. For instance:
CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, message CHAR(20)) ENGINE=MyISAM; CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, message CHAR(20)) ENGINE=MyISAM; INSERT INTO t1 (message) VALUES ('Testing'),('table'),('t1'); INSERT INTO t2 (message) VALUES ('Testing'),('table'),('t2'); CREATE TABLE total ( a INT NOT NULL AUTO_INCREMENT, message CHAR(20), INDEX(a)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
code>
Now, if I have code that automatically created the t3 table, would I have to modify the merge table to add this to the join? Would I use an ALTER query for this?
note: I do not use MySQL partitions because I have mysql version 5.0.
source share