MySQL Forums
Forum List  »  Optimizer & Parser

How to optimize this program? Thanks
Posted by: li grewat
Date: June 28, 2007 08:31PM

I have to load some data into mysql database.
1. I have read the Manual of Mysql and use the "load data infile" form. It is very fast without any trigger,only takes about 3 seconds.
2. However, if I use a trigger, it takes about 70 seconds.
3. And I have to load data into 20 tables from 20 files severally.That is to say, each file for one table. The tables is irrespective each other.And the triggers of these tables is irrespective each other.
Some tables of them are very small, It takes very little time to load data into them.
4. I create 20 thread to load data into one table synchronously,Each thread with one connection. However, It takes about 3 minutes to finish loading data.
During this course , I use "top" to see the instance of system. There are only 4 process named "migration/x" ,where x from 0 to 3. And the cpu is only used about 20%.
Can I speed up the load data process ?How to do that?Thanks very much.
BW: The tables are created without type,It seems like
create table xxx
( a ....,
b ....,
prime key(a)
);

Options: ReplyQuote


Subject
Views
Written By
Posted
How to optimize this program? Thanks
2689
June 28, 2007 08:31PM


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.