Re: Possibilities for batch insert

"klaasvanschelven" <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Oops:

This line should be removed.
GroupsCache.LogChanges := False;

The result is much better than what I started with but I still need 
speeding up and Memo-fields give an exeception.

I hope someone can help me,

Klaas

--- In [email protected], "klaasvanschelven" 
<klaas@v...> wrote:
> Hi,
> 
> A followup on my last post, on improving the speed of large batches 
> of inserts into a DB.
> 
> 1. Append vs. Insert doesn't change a thing
> 2. There are no data-aware controls linked to my table
> 3. The kind of DB is Acces via ODBC
> 4. No indices, etc.
> 5. Removing some of the larger fields doesn't produce significant 
> gains
> 
> 
> I've found the following factor 2 improvement:
> 
> var
>   GroupsCache: TClientDataSet;
>   GroupsProvider: TProvider;
> begin
>   GroupsProvider := TProvider.Create(Application);
>   GroupsProvider.DataSet := GroupsTable;
>   GroupsProvider.Name := 'aaaaaaa1';
>   GroupsCache := TClientDataSet.Create(Application);
>   GroupsCache.ProviderName := GroupsProvider.Name;
>   GroupsCache.Active := True;
>   GroupsCache.LogChanges := False;
> 
> // loop over the GroupsCache using something like this:
>   Groups.Append;
>   GroupsCache['id'] := fID;
>   GroupsCache['name'] := fName;
>   GroupsCache['index'] := etc.
> 
>   GroupsCache.ApplyUpdates(-1);
>   GroupsCache.Free;
>   GroupsProvider.Free;
> end;
> 
> 
> Unfortunatly this still isn't good enough. Has anybody got ideas on 
> improving this?
> 
> Thanx,
> Klaas


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Coral Calcium for Greater Health - $23.95
http://www.challengerone.com/t/l.asp?cid=2805&lp=calcium2.asp
http://us.click.yahoo.com/MmkSQC/NTVGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

Delphi Tips & Tutorials...
http://www.delphicollection.com
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.