🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Too Slow

#333
From: Viatcheslav V. Vassiliev
Date: Tue, 08 Aug 2006 19:27
58 lines
2641 bytes
- Use server-side cursor for this procedure. This way you will not cache all 
your rows in memory.

- Use fields variables:

TField* fBid = CountQuery->FieldByName ("bid");
..

while ...
  v_time.push_back(fBid->AsDateTime);
...

How much time takes line CountQuery->Open(), and how much - while loop?

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Cenk" <cenk1536@yahoo.com> �������/�������� � �������� ���������: 
news:44d8a854@newsgroups.borland.com...
> Hi,
>
> i have a code sample below,
>
> TADODataSet *CountQuery = new TADODataSet(this);
>  CountQuery->ConnectionString = "Provider=SQLOLEDB.1;Integrated 
> Security=SSPI;Persist Security Info=False;Initial Catalog=Raw;Data 
> Source=CENK";
>  CountQuery->CommandTimeout = 0;
>
>
>  if  (CountQuery->Active)
>     CountQuery->Close ();
>
>
> CountQuery->CommandText = "select [bid],[fTime] from ["+table+"] order by 
> [fTime] ASC";
> CountQuery->Open ();
>
>  while (!CountQuery->Eof) -------> table has 1000000 rows of data inside 
> but this loop takes appox. 45 minutes to complete!
>  {
>
>     v_bid.push_back(CountQuery->FieldByName ("bid")->AsFloat);
>
>           v_time.push_back(CountQuery->FieldByName ("fTime")->AsDateTime);
>
>           CountQuery->Next ();
>        }
>
> why is this too slow? any suggestions?
> thanks
> 
Technical Details
Message-ID: <44d8e5be$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44d8a854@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,9e074baf94073a9a
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <44d8a854@newsgroups.borland.com>
Subject: Re: Too Slow
Date: Tue, 8 Aug 2006 23:27:50 +0400
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-Antivirus: avast! (VPS 0632-0, 08.08.2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 85.93.138.132
Message-ID: <44d8e5be$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1155065278 85.93.138.132 (8 Aug 2006 12:27:58 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail