Re: Slow Stored Procedure when run via ado, fast from query analyzer
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Fri, 29 Jul 2005 20:26:00 +0100
"barooz" <BruceTheNoble@xxxxxxxxx> wrote in message
news:1122663559.051929.160540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Greetings folks.
>
> I've got a stored procedure reading data from the database that runs in
> about 2 seconds from query analyzer, and takes 50+ seconds run from ADO
> in asp classic. I'm using SQLOLEDB. I'm totally baffled, any ideas
> what I could check?
That is quite a difference. Even inefficient coding in ADO will not account
for as much as that.
Does the SQL Profiler not reveal what is going on?
For ADO, you have set the optional parameters that say this is Stored
Procedure?
If a Recordset - have you checked to see CursorLocation, CursorType,
LockType?
If Server-sided, have you set the CacheSize?
If you have Client-sided RecordSet, no data is seen until all data is read
into memory.
The action happens at the Open() stage and Open() does not return until
_ALL_ records are in memory.
If you have Server-sided RecordSet, data is seen as soon as the Cache is
full.
Open() returns immediately. This may give the illusion of speed in that the
latency is much smaller, but if you timed when you see the last record for
Server vs Client, it should be the same ballpark in magnitude.
> I'm getting the 50+ seconds time from Sql
> Profiler...so I'm assuming that 50+ seconds is the server side
> execution time and isn't including the time to transport the data from
> the sqlserver to the webserver... Any ideas?
Nope. I would raise this in the SQLServer programming newsgroup.
Stephen Howe
.
- References:
- Prev by Date: Slow Stored Procedure when run via ado, fast from query analyzer
- Previous by thread: Slow Stored Procedure when run via ado, fast from query analyzer
- Index(es):
Relevant Pages
|