Hi All,

I am working with MYISAM tables split by year, like:
data2003, data2004, data2005, data2006, data2007, data2008, all having the same 
definitions.

To speed up the query process, I also defined MERGE tables, like:
CREATE TABLE data20032004 ... 
    ENGINE=MERGE UNION (data2003, data2004);
CREATE TABLE data20032005 ... 
    ENGINE=MERGE UNION (data2003, data2004, data2005);
CREATE TABLE data20032006 ... 
    ENGINE=MERGE UNION (data2003, data2004, data2005, data2006);
CREATE TABLE data20032007 ... 
    ENGINE=MERGE UNION (data2003, data2004, data2005, data2006, data2007);
CREATE TABLE data20032008 ... 
    ENGINE=MERGE UNION (data2003, data2004, data2005, data2006, data2007, 
data2008);
CREATE TABLE data20042005 ... 
    ENGINE=MERGE UNION (data2004, data2005);
etc. etc.
CREATE TABLE data20072008 ... 
    ENGINE=MERGE UNION (data2007, data2008);

For example, if a user query applies to 2003..2006, my app selects the 
belonging MERGE table data20032006,
excluding tables data2007 and data2008 for faster results. 
Is this assumption correct ? Or are there better ways of doing this ?
I'm using: mySQL version 5.0.15-NT

TIA, Cor

Reply via email to