G
Guest
We have a rather stored procedure which works like countless others in our
application, but for some reason, this specific sproc is taking an
extraordinary amount of time to return when called.
We have tried using data adapters to fill a dataset, and we've tried using
a data reader, and in both cases, the call to the sproc takes 25-30 seconds
to execute when the sproc itself only takes 6 seconds. (It's a
multiparameter search of a table with millions of rows.)
I have used SQL Profiler and captured the exact sql used to execute the
sproc and even that only takes 6 seconds to execute.
This is the SQL statement that ADO.NET is using:
declare @P1 int
set @P1=1
declare @P2 int
set @P2=1
exec dbo.nt_Module_SelectBySearchParams @HasAlertFlag = 0,
@SerialNumber = N'0100000259ce%',
@PartDescription = NULL, @PartNumber = NULL,
@OrderByColumn = N'SerialNumber', @OrderByDirection = N'DESC',
@Page = 1, @Size = 10, @PageCount = @P1 output, @RecordCount = @P2 output
select @P1, @P2
I have traced this down using both data adapters and data readers and in
each case the line that takes control of the thread out of our hands and off
to the data layer is what takes 6 times as long to run as the sproc itself.
We have many other queries with similar interfaces and parameters that run
instantaneously. So why would one query be subject to such a slowdown?
I need suggestions on where to look for trouble, Please! This is too slow
for our users and I am at a loss to find any sort of solution.
application, but for some reason, this specific sproc is taking an
extraordinary amount of time to return when called.
We have tried using data adapters to fill a dataset, and we've tried using
a data reader, and in both cases, the call to the sproc takes 25-30 seconds
to execute when the sproc itself only takes 6 seconds. (It's a
multiparameter search of a table with millions of rows.)
I have used SQL Profiler and captured the exact sql used to execute the
sproc and even that only takes 6 seconds to execute.
This is the SQL statement that ADO.NET is using:
declare @P1 int
set @P1=1
declare @P2 int
set @P2=1
exec dbo.nt_Module_SelectBySearchParams @HasAlertFlag = 0,
@SerialNumber = N'0100000259ce%',
@PartDescription = NULL, @PartNumber = NULL,
@OrderByColumn = N'SerialNumber', @OrderByDirection = N'DESC',
@Page = 1, @Size = 10, @PageCount = @P1 output, @RecordCount = @P2 output
select @P1, @P2
I have traced this down using both data adapters and data readers and in
each case the line that takes control of the thread out of our hands and off
to the data layer is what takes 6 times as long to run as the sproc itself.
We have many other queries with similar interfaces and parameters that run
instantaneously. So why would one query be subject to such a slowdown?
I need suggestions on where to look for trouble, Please! This is too slow
for our users and I am at a loss to find any sort of solution.