🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: It is too many slow...

#3864
From: Vassiliev V.V.
Date: Sun, 09 Jun 2002 11:04
110 lines
5558 bytes
Use server-side cursor and do NOT use batch updates - they are not supported
by Jet provider and Client Cursor Engine performs them very slow. You can
also try OLEDB Direct at http://www.oledbdirect.com. OLEDB Direct is more
difficult to use than ADO Express but it is much faster and powerfull.

Demo for your case you can get at
http://www.oledbdirect.com/downloads/Insert60000rows.zip. It inserts 60 000
rows in Jet table with structure similar to yours in 50 seconds on PII-300
192 MB RAM computer - on your system it could be done in 10-15 seconds.  The
database size is ~20 MB and requires no compacting (compare with results you
get with your code). Demo is for BCB5. To compile it you should download
OLEDB Direct components and set include and lib paths in demo project. To
run it - just press every button from top to bottom and wait result.

If you will test this demo please send your times to
support@oledbdirect.com.

Regards,
Vassiliev V.V.
http://www.oledbdirect.com

"M. Noroozi Eghbali" <galaxy@irandoc.ac.ir> �������/�������� � ��������
���������: news:3d021be7_2@dnews...
> Hi,
>
> I am using an ADOTable and a DataSource (Microsoft.Jet.OLEDB.4.0) to save
my
> database in an Access file. It has about 25 fields and none of them are
> indexed. The number of records is about 60000. When I start the saving to
> the Access file, in the first second about 100 records were saved. The
> saving speed gradually decreases inasmuch as after 15000 records the
saving
> speed reaches to maximum 1 record per second. I wrote the code of the
saving
> function here. please tell me what is the wrong.
>
> Regards,
> Mehrdad
>
> void __fastcall TForm1::Save(TTreeNode *Node)
> {
>  typedef CNodeData* PNodeData;
>      TTreeNode *ChildNode;
>
>  do
>      {
>       DataModule1->ADOTable1->Append();
>           DataModule1->ADOTable1->FieldByName("Level")->AsInteger =
> Node->Level;
>           DataModule1->ADOTable1->FieldByName("Term")->AsString =
> Node->Text;
>           DataModule1->ADOTable1->FieldByName("BT")->AsString =
> PNodeData(Node->Data)->BT;
>           DataModule1->ADOTable1->FieldByName("NT")->AsString =
> PNodeData(Node->Data)->NT;
>           DataModule1->ADOTable1->FieldByName("RT")->AsString =
> PNodeData(Node->Data)->RT;
>           DataModule1->ADOTable1->FieldByName("SN")->AsString =
> PNodeData(Node->Data)->SN;
>           DataModule1->ADOTable1->FieldByName("UF")->AsString =
> PNodeData(Node->Data)->UF;
>           DataModule1->ADOTable1->FieldByName("Translate1")->AsString =
> PNodeData(Node->Data)->Translate1;
>           DataModule1->ADOTable1->FieldByName("Translate2")->AsString =
> PNodeData(Node->Data)->Translate2;
>           DataModule1->ADOTable1->FieldByName("Translate3")->AsString =
> PNodeData(Node->Data)->Translate3;
>           DataModule1->ADOTable1->FieldByName("Hide")->AsBoolean =
> PNodeData(Node->Data)->Hide;
>           DataModule1->ADOTable1->FieldByName("Status")->AsInteger =
> PNodeData(Node->Data)->Status;
>           DataModule1->ADOTable1->FieldByName("InputDate")->AsString =
> PNodeData(Node->Data)->InputDate;
>           DataModule1->ADOTable1->FieldByName("ApprovalDate")->AsString =
> PNodeData(Node->Data)->ApprovalDate;
>           DataModule1->ADOTable1->FieldByName("LastUpdate")->AsString =
> PNodeData(Node->Data)->LastUpdate;
>           DataModule1->ADOTable1->FieldByName("NotValidDate")->AsString =
> PNodeData(Node->Data)->NotValidDate;
>           DataModule1->ADOTable1->FieldByName("ABB")->AsString =
> PNodeData(Node->Data)->ABB;
>           DataModule1->ADOTable1->FieldByName("SC")->AsString =
> PNodeData(Node->Data)->SC;
>   DataModule1->ADOTable1->FieldByName("HN")->AsString =
> PNodeData(Node->Data)->HN;
>   DataModule1->ADOTable1->FieldByName("SF")->AsString =
> PNodeData(Node->Data)->SF;
>   DataModule1->ADOTable1->FieldByName("CA")->AsString =
> PNodeData(Node->Data)->CA;
>   DataModule1->ADOTable1->FieldByName("EC")->AsString =
> PNodeData(Node->Data)->EC;
>   if(PNodeData(Node->Data)->Frequency.IsEmpty())
>            DataModule1->ADOTable1->FieldByName("Frequency")->AsInteger =
0;
>           else
>            DataModule1->ADOTable1->FieldByName("Frequency")->AsInteger =
> StrToInt(PNodeData(Node->Data)->Frequency);
>           DataModule1->ADOTable1->FieldByName("Description")->AsString =
> PNodeData(Node->Data)->Description;
>
>           DataModule1->ADOTable1->Post();
>
> ...
> //Some codes to obtain next record from memory.
> ...
>
>      }while(Node);
> }
>
>
Technical Details
Message-ID: <3d03364b_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3d021be7_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,856e9c01d3c42b29
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-06-09 04:09:27 PST
From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3d021be7_2@dnews>
Subject: Re: It is too many slow...
Date: Sun, 9 Jun 2002 15:04:41 +0400
Lines: 114
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 62.118.131.38
Message-ID: <3d03364b_1@dnews>
X-Trace: dnews 1023620683 62.118.131.38 (9 Jun 2002 04:04:43 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!dnews