MySQL Forums
Forum List  »  Merge Storage Engine

Is this a correct way to use MERGE tables?
Posted by: Chris Padfield
Date: March 26, 2007 12:49AM

Hi,

I have seen general MERGE table usage for logging where a table is created for a fixed period of time, e.g. a month.

I am looking to do something different. I currently have a very large table, let's call it emails. There are say a million rows in here. The problem is queries running against this can be slow especially any queries against rows that are not indexed (not all of them can be).

What I am thus thinking is to use MERGE tables. Any email that has not been opened in the last year would be moved into an acrhive table. Then what is now the emails table would be renamed so I have emails_archive and emails_current and create the MERGE table emails.

Then, any searches would be run on emails_current unless a checkbox was clicked to run on *all* emails.

Is this a correct way to use MERGE tables? Is moving rows from emails_current to emails_archive going to be a problem with indexes and unique keys? I believe I can insert rows into the MERGE table and they will by phyiscally put inside emails_current but will check the unique indexes on both the tables.

Please let me know if I am off base here or anything I need to take into account.

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
Is this a correct way to use MERGE tables?
6491
March 26, 2007 12:49AM


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.