MySQL Forums
Forum List  »  Merge Storage Engine

Re: merge and temporary tables
Posted by: Peter Douglas
Date: January 30, 2006 03:10PM

Thanks Ingo,

>> MERGE is not an option in table creation.
>> In contrast to a view, the MERGE table cannot be expressed by a SELECT command

Well, I meant use of table creation + select as it says in documentation....


CREATE TABLE total (
-> a INT NOT NULL AUTO_INCREMENT,
-> message CHAR(20), INDEX(a))
-> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST

After creating the MERGE table, you can issue queries that operate on the group of tables as a whole:

mysql> SELECT * FROM total;


The system I access is MySQL 4.0.20-standard
Ok the documentation page
http://dev.mysql.com/doc/refman/4.1/en/merge-storage-engine.html
doesnt have such clear examples, and only 1 comment
and not seen much more elsewhere.

I did try to create a table like 'total' above, cutting out primary keys etc of original tables as per instruction but it doesn't work.

It's not a big thing, I'll get it eventually but was hoping for some simple examples of creation and use

On a general note,
I don't think it's possible with just 1 database server request
to access 2 (equivalent) day tables (as above) with a program table using UNION and JOIN, or any other way ?

Options: ReplyQuote


Subject
Views
Written By
Posted
6500
January 29, 2006 01:22PM
4032
January 30, 2006 03:51AM
Re: merge and temporary tables
4222
January 30, 2006 03:10PM
4907
January 31, 2006 03:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.