Re: Possibilities for batch insert
"klaasvanschelven" <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <[email protected]> |
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 Ink Cartridges at Myinks.com - Save 80%. Quality inkjet cartridges & refill kits! FREE s/h on $50 orders to the US & Canada. Fast shipping. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/hwZBYB/zoVGAA/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/