Re: ADO Performance
- From: "Tomasz Klim" <tklim-ms@xxxxxxxxxxxxxx>
- Date: Mon, 20 Feb 2006 14:47:35 +0100
It's really quite strange in my opinion...
a) Is the cursor client or server side?
Honestly, I don't know. But it's default in both programs.
b) Is the cursor type forwardonly, static or dynamic?
Dynamic. But I tried all of these, with similar effects.
I think should be able to break down this bottleneck into two (at least)
sections (this will vary a little depending on cursor location):
(1) Find out how long it takes to run the query and get the recordset
returned. (I don't think this is going to vary much...)
You're right. Besides, I start to counting time after the query executes.
(2) Find out how long it takes to loop thru the recset - I suspect this
is where the hit is...
You're still right.
Further questions:
(c) Are the loops thru the recset identical, you don't have a DoEvents
knocking around in any of them do you?
I have DoEvents in both programs, but I disabled it. Also, I removed
from the loop everything but oRS.MoveNext, with no change on performance:(
(d) What are you going when you go through the loop? Updating?
Dim dt As Date
....
dt = Now
While Not oRS.EOF
oRS.MoveNext
Wend
MsgBox DateDiff("s",dt,Now)
And it's still running slower, that the other program. And this other
program
is bigger, do more things, and still runs about 2 times faster... I don't
understand
it, it's quite abnormal IMHO :(
Tomasz Klim wrote:query,
You're of course right - but note that _both_ programs use the same
Basic,and one is almost two times faster, than the other.
Are there any interdepenciences between internal components of Visual
theCOM servers etc.?
Uzytkownik "Gman" <nah> napisal w wiadomosci
news:OgPeUOKNGHA.3460@xxxxxxxxxxxxxxxxxxxxxxx
As an aside, SELECT * will always run slower than specifying the colum
names since the engine has to figure out what columns are available,
andorder etc.
Further, loading a whole table into a recordset is often necessary if
it's a config table or such but if it's a large table you could try and
place some logic on the server side to reduce the execution time.
Tomasz Klim wrote:
Yes, both programs use ADO 2.6, the same connection strings, the same
queries, the same options and everything.
Moreover, I created new program, that connects do the same database,
executionsends the same query. After traversing the loop, it shows the
corebothtime: 45 seconds...
I traced both programs using Visual Basic debugger and found out, that
programes have identical database-related variables...
U¿ytkownik "Saga" <antiSpam@xxxxxxxxxxxxx> napisa³ w wiadomo¶ci
news:%23kIvhRANGHA.3852@xxxxxxxxxxxxxxxxxxxxxxx
Do both programs use ADO?
The same version of ADO?
The same connect strings?
The same open recordset statements?
Any differences in cursor location?
Regards
Saga
"Tomasz Klim" <tklim-msNON@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23xkPZBANGHA.3100@xxxxxxxxxxxxxxxxxxxxxxx
Hi
I have a strange question about ADO performance:
I have a program in Visual Basic 6.0, that connects to Pervasive.SQL
via
DSN, and then executes "select * from bd". Then, it slides through
Recordset:
While Not oRS.EOF
' processing part
oRS.MoveNext
Wend
And I have another program, that does exactly the same (it is
different in
many ways, but at the database part, it does the same). I don't know
if it's
important, but it's much bigger, than the first program.
The problem is, that the first program processes the table in 23-24
seconds,
while the other in 39-40 seconds!
I don't know, what's going on - I even removed everything except
While
loop with oRS.MoveNext command. I also checked the .vbp files, and
don't see
anything strange, or different between these files.
Did someone had such problem already?
.
- References:
- ADO Performance
- From: Tomasz Klim
- Re: ADO Performance
- From: Saga
- Re: ADO Performance
- From: Tomasz Klim
- Re: ADO Performance
- From: Gman
- Re: ADO Performance
- From: Tomasz Klim
- Re: ADO Performance
- From: Gman
- ADO Performance
- Prev by Date: Re: Application-wide Keyboard Hook
- Next by Date: Re: Wish I was using .net
- Previous by thread: Re: ADO Performance
- Next by thread: wordstar
- Index(es):
Relevant Pages
|