Article View: borland.public.cppbuilder.database.ado
Article #861Looking to Optimize TADOQuery's
From: Heinz Ketchup
Date: Tue, 28 Jun 2005 19:32
Date: Tue, 28 Jun 2005 19:32
58 lines
3036 bytes
3036 bytes
Hello to Everyone,
I've been googling, trying to find different advice pages on suggestions to increase the speed of Querying / Updating. Some of them have been quite helpful.
Such as Setting up your Cursor for ctStatic; Cursor Location clUseClient or clUseServer.
Now I've managed to reduce the query time of 5000 records from 4.5 minutes down to 1 minute... Yeah, I said 5000 records...
I have problems updating 1536 records in a decent amount of time... Right now it takes 3.25 minutes to update/insert records into the database.
We are using a Sybase Database through an ODBC Connection.
Personally, I don't understand why querying and updating is so ridiculously slow. Different programs we have updating our DB are practically instantaneous.
My method for Updating are based around using the
SQL Exec Method.
//SQL Query Method
AssignAndQueryDateParameters(TADOQuery* QueryPointer, TDateTime SQLStartDate, TDateTime SQLEndDate)
{
// Perform SQL Operations
QueryPointer->Close();
QueryPointer->Parameters->ParamByName("StartDate")->Value = SQLStartDate;
QueryPointer->Parameters->ParamByName("EndDate")->Value = SQLEndDate;
QueryPointer->DisableControls();
QueryPointer->Open();
}
// Used for Updating / Inserting
// SQL Statement String has the SQL Statement with Value for
// Updating / Inserting
ExecuteADOMethodSQLStatement(TADOQuery* QueryPointer, AnsiString SQLStatementString)
{
QueryPointer->Close();
QueryPointer->SQL->Clear();
QueryPointer->SQL->Text = SQLStatementString;
QueryPointer->ExecSQL();
}
Does anyone, have any suggestions on how I can increase the speed of the updates? Each Query / Update is executed individually. The SQL Where clause is quite specific. Hence, individual updates.
Oh yes, there are NO DB Visual components of any sort in the application being built.
I'm open to anything that will speed the DB process up.
Query or Update.
I can tolerate the slow query, but the update I can't. Anything more than a minute is painful.
Again, Any and All Suggestions / Feedback are greatly Appreciated!!!!!
Thanks,
Heinz
Technical Details
Message-ID:
<42c1a5b2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,9d14f203a64d9cbb,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Heinz Ketchup" <heinz_like_the_ketchup@h0tmail.n0spam.c0m.n0spam> Sender: "Heinz Ketchup" <heinz_like_the_ketchup@h0tmail.n0spam.c0m.n0spam> Reply-To: "Heinz Ketchup" <heinz_like_the_ketchup@h0tmail.n0spam.c0m.n0spam> Subject: Looking to Optimize TADOQuery's Newsgroups: borland.public.cppbuilder.database.ado X-User-Info: 146.131.120.2 NNTP-Posting-Host: 207.105.83.66 Message-ID: <42c1a5b2$1@newsgroups.borland.com> Date: 28 Jun 2005 12:32:02 -0700 X-Trace: newsgroups.borland.com 1119987122 207.105.83.66 (28 Jun 2005 12:32:02 -0700) Lines: 58 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail