Skip navigation links

MySQL Forums :: Newbie :: How to find progress of a variable across multiple tables (speed up left join)


Advanced Search

How to find progress of a variable across multiple tables (speed up left join)
Posted by: John Doe ()
Date: May 16, 2013 07:03AM

Say I have three large tables (over 90,0000 rows) for March, April and May. Each table looks like this.
Name, BOD, Sex, ID, AssetValue

First four columns are used as the primary key (i.e. primary key (Name,BoD,Sex,ID)) in each table.

April table may have more rows than March and, May table may have more rows than April and so on.

I wan to create a new table like this
Name, BOD, Sex, ID, AssetvalueMarch, AssetValue April, AssetvalueMay

Here is what I did. Scan three tables first and create an aggretable that contains all the distinct (Name,Bod,Sex,ID) from three tables. They are primary key in it. This work quite fast.

Then I use left join that table with each of the three tables on (Name,BOD,Sex,ID) one at a time. This takes forever.

Can I approach this problem differently to speed it up?

Thank you in advance for reading this.



Edited 1 time(s). Last edit at 05/16/2013 07:15AM by John Doe.

Options: ReplyQuote


Subject Written By Posted
How to find progress of a variable across multiple tables (speed up left join) John Doe 05/16/2013 07:03AM
Re: How to find progress of a variable across multiple tables (speed up left join) Peter Brawley 05/16/2013 11:28AM
Re: How to find progress of a variable across multiple tables (speed up left join) John Doe 05/16/2013 07:43PM


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.