I had a similar setup, involving log parsing. It was impractical to put all
of the data in one table and expect to get timely results. In order to do
it, I scripted the generation of the temp table (think I used a merge,
since it is not actually moving data and is fast). So... I scripted the
date range, assembled the merge statement, then pulled the query on the
merged table. I would imagine that there is a way to do it all in sql, but
I found it much easier to script it since the end result was html.
From: Michael Monashev
To: Berman, Mikhail
ReplyTo: Michael Monashev
Sent: Jul 19, 2005 1:58 PM
Subject: Re: Multitable selection
BM> Are you looking to compare a few last records in each table or ??
BM> Can I get a little bit more details?
I have 10 similar tables. 3 years ago it was one big table. Now I
split it to 10 tables.
3 years ago I could write:
SELECT * from BigTable WHERE date_col>$some_date ORDER BY date_col
Now I have to write:
SELECT * from Table0 WHERE date_col>$some_date
SELECT * from Table1 WHERE date_col>$some_date
SELECT * from Table9 WHERE date_col>$some_date
after push this rows into temporary table and after write:
SELECT * from TempTable ORDER BY date_col
How to make it simply and faster?
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=1
Sent from my NYPL BlackBerry Handheld.