🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Performance damn LOW!!! Please fix my codes

#2533
From: booker
Date: Tue, 20 May 2003 06:26
79 lines
3711 bytes
I follow  your instruction and Change all the TADOQuery to TADOCommand using
Parameters...The speed is quite fast....thanks alot.

Bob H

"Viatcheslav V. Vassiliev" <support@oledbdirect.com> д���ʼ�
news:3ec8e3b7@newsgroups.borland.com...
> You should optimize 2 things:
>
> 1. Your cycle:
>
> TStrings has OnChange event and ADOQuery->SQL handles it. When you do
> query->SQL->Add("something") TADOQuery sends this command to provider (it
> gets Text, sets internal ADOCommand->CommandText etc.). So you should
create
> temporary TStringList, fill it with your cycle and then do
> query->SQL->Assign(StringList).
>
> 2. ExecSQL itself.
>
> You create script and send it to OLEDB provider. It is not the best way to
> perform multiple insert operations. You should use TADOCommand, set
command
> text with parameters, prepare it and inside cycle set parameters and
> execute.
>
> Bulk inserts could be done from application. For this you should use OLEDB
> interfaces. OLEDB Direct (http://www.oledbdirect.com) let you use them -
> look $(OLEDBDirect)\SQL Server\1 000 000 rows demo.
>
> ----------------------------------------------------------------
> Regards,
> Viatcheslav V. Vassiliev
> http://www.oledbdirect.com
> The fastest way to access MS SQL Server, MS Jet (MS Access)
> and Interbase (through OLEDB) databases.
>
>
>
> "booker" <diablohsh@163.net> ������?�������� ?�������� ��������?
> news:3ec8a054$1@newsgroups.borland.com...
> > My codes:
> >
> > for(;node;node=node->mNext)
> > {
> >     cmdstr.printf("insert int tbl_some values(some1,some2....somen)");
> >     adoquery->SQL->Add(cmdstr);
> > }
> > adoquery->ExecSQL();
> >
> >     the loop may execute for more than 10000 times....runing in a
PIII850
> > use 32 seconds(not including the ExecSQL). The speed is
> inacceptable......i
> > did some test and found that the slowest part is:
> >
> >     query->SQL->Add(cmdstr);
> >
> >     if i remove this line,the code only execute for 1500 ms ,i think it
> must
> > be the AnsiString allocation in the Add methord slow it down.
> >
> >     I know that Bulk Insert may greatlly inprove the performance ,but i
> > can't use it. because in my case,the appserver and sqlserver are in
> > different computer,so the bulk insert must be able to locate the file in
> the
> > appserver via UNC file path.This require the sqlserver to run in a
Windows
> > Domain Acount,but i don't know how to setup a Windows Domain at all.
> >
> >    So can any body point me out a way to boost the performance?
> >
> >
> > Best regards,
> > Bob H
> >
> >
>
>
Technical Details
Message-ID: <3ec9caa8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ec8a054$1@newsgroups.borland.com> <3ec8e3b7@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,447c08d7d7d81fe
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-05-19 23:31:57 PST
From: "booker" <diablohsh@163.net>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3ec8a054$1@newsgroups.borland.com> <3ec8e3b7@newsgroups.borland.com>
Subject: Re: Performance damn LOW!!! Please fix my codes
Date: Tue, 20 May 2003 14:26:58 +0800
Lines: 81
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 210.21.34.181
Message-ID: <3ec9caa8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1053412008 210.21.34.181 (19 May 2003 23:26:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail