Page 1 of 1

very slow to insert a record

Posted: Wed 13 Aug 2008 19:50
by maxchenjun
Hello, I have a table with more than 100,000 records. And I have to sometimes add a few new records. Just insert, no need to read and show.
But I found the speed is very very slow. I think even though I just want to insert the record, but TMyTable load at first all the data records, so it is very very slow. Is this the case? Or how I can solve this problem? Thanks in advance.

And more for my slow solution:

I tried to set fetchAll property to false, and just fetch one row from the table.
And using both table.InsertRecord method and table.Insert and then table.post.
From debuging I know the program waits at the Post point.
Also I tried with MyQuery, but I need unicode value support and I could not insert unicode value directly to the sql statement.

Please help. Thanks!!

Re: very slow to insert a record

Posted: Thu 14 Aug 2008 22:54
by kaffeburk
maxchenjun wrote:Hello, I have a table with more than 100,000 records. And I have to sometimes add a few new records. Just insert, no need to read and show.
I have a similar problem, with 800 000 records... What i did was using TmyDump (maybe i should have used TMyLoader...). Works a lot faster specially if You lock the table during the import. If i remeber right the problem is that TQuery cashes the information regardless if You have set fetch all or not...

A drawback is that You have to spend some time writing code that convert the data to SQL code first. Let me know if u need a object to generate the insert statements.

Re: very slow to insert a record

Posted: Fri 15 Aug 2008 01:04
by maxchenjun
kaffeburk wrote: A drawback is that You have to spend some time writing code that convert the data to SQL code first. Let me know if u need a object to generate the insert statements.

Hi Kaffeburk,

Thanks for your suggestion. I will try as you suggested with TMyDump. Anyway if you could provide an object to generate the insert statements, it will be very useful for me. Thanks for your help. And if possible you can send this to me via email: [email protected]

Re: very slow to insert a record

Posted: Sat 16 Aug 2008 11:36
by kaffeburk
done.

Re: very slow to insert a record

Posted: Mon 18 Aug 2008 07:21
by oz8hp
kaffeburk wrote:done.
Do you still have this example?

I have an application that imports records from >200 Paradox tables and inserts them in MySQL and it is very slow, so any speedup suggestions is welcome.

You may use oz8hp @ hotmail . com for direct contact

Posted: Mon 18 Aug 2008 09:23
by maxchenjun
TMyLoad is the solution.

It was fast enough for my situation. Thanks all!

Posted: Mon 18 Aug 2008 09:47
by oz8hp
maxchenjun wrote:TMyLoad is the solution.

It was fast enough for my situation. Thanks all!
Any sample apps where used??

Posted: Tue 19 Aug 2008 13:08
by maxchenjun
Any sample apps where used??
See help files for TMyLoad. There is an example that shows how it works.