🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #217

Re: Fastest Way to Insert a Number of Records via SQL

#217
From: DeanB
Date: Fri, 22 Jun 2007 18:43
42 lines
2717 bytes
On Jun 8, 4:53 pm, Dan <D...@do.not.spam> wrote:
> I'm still not at copy and paste speeds but was able to decrease insert
> times by over 80%.
>
> I started with this:
>
> TADOQuery *SQLObject = (pointer of actual object);
> do
> {
>    SQLObject->SQL->Text = "Insert into [tablename] (fields...) VALUES
> (values..)";}
>
> while (still have to import huge number of records);
> SQLObject->ExecSQL();
>
> To increase I changed the above to something like this:
> TADOQuery *SQLObject = (pointer of actual object);
> SQLObject->SQL->Text = "Select (field) from [tablename] where (field
> doesn't already exist); //fast query to turn on SQL
> do
> {
>    SQLObject->InsertRecords(ARRAYOFCONST((fieldvalues...)));}
>
> while (still have to import huge number of records);
> SQLObject->BatchUpdate(arAll);
>
> Any other suggestions on how to increase speed?  I am presently at
> around 200ms for 520 records, and I'd like to be well less than 100ms
>
> Dan

Hey Dan,

What's this line:

SQLObject->InsertRecords(ARRAYOFCONST((fieldvalues...)));


I don't see InsertRecords as a function in TADO components. I see an
InsertRecord function, note that's singular event.

-Dean
Technical Details
Message-ID: <1182537800.146406.36130@i13g2000prf.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!i13g2000prf.googlegroups.com!not-for-mail
References: <46645ac3@newsgroups.borland.com> <466477c6$1@newsgroups.borland.com> <466580d1@newsgroups.borland.com> <4665925c@newsgroups.borland.com> <46659f88@newsgroups.borland.com> <4666194d@newsgroups.borland.com> <46665d06@newsgroups.borland.com> <4669c1e0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,d0a6c05550b4cac9
X-Google-Attributes: gid10698b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!i13g2000prf.googlegroups.com!not-for-mail
From:  DeanB <deanbrown3d@yahoo.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Fastest Way to Insert a Number of Records via SQL
Date: Fri, 22 Jun 2007 18:43:20 -0000
Organization: http://groups.google.com
Lines: 43
Message-ID: <1182537800.146406.36130@i13g2000prf.googlegroups.com>
References: <46645ac3@newsgroups.borland.com>
   <466477c6$1@newsgroups.borland.com>
   <466580d1@newsgroups.borland.com>
   <4665925c@newsgroups.borland.com>
   <46659f88@newsgroups.borland.com>
   <4666194d@newsgroups.borland.com>
   <46665d06@newsgroups.borland.com>
   <4669c1e0$1@newsgroups.borland.com>
NNTP-Posting-Host: 151.204.192.233
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1182537800 19029 127.0.0.1 (22 Jun 2007 18:43:20 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 22 Jun 2007 18:43:20 +0000 (UTC)
In-Reply-To: <4669c1e0$1@newsgroups.borland.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: i13g2000prf.googlegroups.com; posting-host=151.204.192.233;
   posting-account=Cef3nA0AAACwumsbf6m0Ses922aBOB8w