very slow to insert a record
-
maxchenjun
- Posts: 8
- Joined: Tue 13 Nov 2007 10:26
very slow to insert a record
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!!
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
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...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.
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.
-
maxchenjun
- Posts: 8
- Joined: Tue 13 Nov 2007 10:26
Re: very slow to insert a record
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
Do you still have this example?kaffeburk wrote:done.
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
-
maxchenjun
- Posts: 8
- Joined: Tue 13 Nov 2007 10:26
-
maxchenjun
- Posts: 8
- Joined: Tue 13 Nov 2007 10:26