G
Guest
I have an old and proven stored procedure that takes on average 0.2 seconds
to execute. I always develop and perfom all measurements using VS .NET debug
configuration. This SP has always performed the same being called from Query
Analyzer, Enterprize manager or VB.NET code.
Recently I've done some changes (that should not affect the speed) to it and
from then the SP takes 10 seconds to execute from VB.NET. It still takes 0.2
seconds from Query Analyzer.
It took me whole day to figure out that when I change the configuration to
Release that query goes back to 0.2 seconds.
I have tried to recompile the SP drop all execution plans, change the query
from using parameters to text form (EXEC sp_xxxx @Param1=1, @Param2='A') and
all sort of other things but no luck, still 10 seconds in debug mode.
The funny thing is that when I put a break point in the SP, I can step
through it and see which SELECT statement takes 9 secs to execute. If I copy
that statement to Query Analyzer it takes 0.1 seconds.
I've searched the Net for an answer and although I have found simmilar
questions (Query Analyzer vs .NET code query speed ) nobody has linked this
to the debug configuration.
Any comments?
to execute. I always develop and perfom all measurements using VS .NET debug
configuration. This SP has always performed the same being called from Query
Analyzer, Enterprize manager or VB.NET code.
Recently I've done some changes (that should not affect the speed) to it and
from then the SP takes 10 seconds to execute from VB.NET. It still takes 0.2
seconds from Query Analyzer.
It took me whole day to figure out that when I change the configuration to
Release that query goes back to 0.2 seconds.
I have tried to recompile the SP drop all execution plans, change the query
from using parameters to text form (EXEC sp_xxxx @Param1=1, @Param2='A') and
all sort of other things but no luck, still 10 seconds in debug mode.
The funny thing is that when I put a break point in the SP, I can step
through it and see which SELECT statement takes 9 secs to execute. If I copy
that statement to Query Analyzer it takes 0.1 seconds.
I've searched the Net for an answer and although I have found simmilar
questions (Query Analyzer vs .NET code query speed ) nobody has linked this
to the debug configuration.
Any comments?