Re: adVarWChar slower than adVarChar
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Wed, 23 Aug 2006 13:49:28 +0100
Well, now we get the special characters properly imported into the table.
But the importing time for one file containing some thousand lines
increased from 8 minutes to more than 8 hours!!!
Have you profiled this? Is it really the case that the 1 call of the SP via
the Command object is what takes 8 hours? Nothing else? That is where the
time goes. And the Command object persists between each call does it?
Also how many parameters does this Command object have, direction and type
of them? Just the 1 you showed us?
Also - version of MDAC are you using?
Any ideas?
It is a pure guess. Nothing more than that. I am guessing that despite what
you showed us, ADO is having to do some translation internally before
sending the parameter. And to do that it might be allocating and
deallocating a buffer to do that. And that takes time (but it is hard to
account for 8 minutes -> 8 hours).
Point 1:
I would follow this procedure:
(i) comment out the setting up of the Parameters and replace with
cmdADO.Parameters.Refresh
and see if that is faster. Let ADO setup the parameters
(ii) If it is faster, dump the Parameters : type, direction, other
properties to file/screen and this time setup your parameters manually using
the same values just dumped. Comment out cmdADO.Parameters.Refresh, it has
done its job. The only thing to change is that ADO uses direction
adParamInputOutput when it may just be adParamInput. Adjust appropriately.
Point 2:
Are you calling this SP right? It does not return any recordsets, right?
Many VB programmers should be shot through the head because they allow the
defaults (a _MASSIVE_ mistake on RecordSet.Open()) on important ADO methods.
Assuming that parameters have been set:
cmdADO.Execute ,, adCmdStoredProc OR adExecuteNoRecords
Point 3
And does the SP have "SET NOCOUNT ON" at the top on entry?
I know that if I was doing the programming, my first action would be to find
out where the time is spent and what proportions are on the execution of the
SP. Are you sure it is this and not some ghastly inefficiency in surrounding
code?
Stephen Howe
.
- References:
- adVarWChar slower than adVarChar
- From: N. Scheller
- adVarWChar slower than adVarChar
- Prev by Date: Re: adVarWChar slower than adVarChar
- Next by Date: Re: adVarWChar slower than adVarChar
- Previous by thread: Re: adVarWChar slower than adVarChar
- Next by thread: Re: VB6 Access97
- Index(es):
Relevant Pages
|
|