Monday, March 26, 2012

PErformance Question

Hi All,
Its kinda very vague question.. but I can't help it..
While trying to optimize a stored procedure which was taking 3 to 5 secs on
a development server. I could see it was doing
14000 reads (in profiler). I introduced 2 indexes to the tables used in the
SP and rewrote in a better way(removed cursor and introduced set based
operation).
After the change I could see the reads came down to 700, but the duration
remained the same.
Why doesnt the duration come down when the reads came down so much.
Is this a valid question? im not sure.. ie can we expect a better duration
if the reads are minimized?
If yes why doesnt the duration come down?
Thanks,
Pradeep KuttyAre there varchar fields in your table or in any index you have a datetime
field?
Perhaps a good idea would be to store these indexes in another filegroup (if
they are clustered)
regards,
"Pradeep Kutty" wrote:

> Hi All,
> Its kinda very vague question.. but I can't help it..
> While trying to optimize a stored procedure which was taking 3 to 5 secs o
n
> a development server. I could see it was doing
> 14000 reads (in profiler). I introduced 2 indexes to the tables used in th
e
> SP and rewrote in a better way(removed cursor and introduced set based
> operation).
> After the change I could see the reads came down to 700, but the duration
> remained the same.
> Why doesnt the duration come down when the reads came down so much.
> Is this a valid question? im not sure.. ie can we expect a better duration
> if the reads are minimized?
> If yes why doesnt the duration come down?
> Thanks,
> Pradeep Kutty
>
>|||Hi
Post your DDL and DML, without that, we can't pass much comment
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Pradeep Kutty" wrote:

> Hi All,
> Its kinda very vague question.. but I can't help it..
> While trying to optimize a stored procedure which was taking 3 to 5 secs o
n
> a development server. I could see it was doing
> 14000 reads (in profiler). I introduced 2 indexes to the tables used in th
e
> SP and rewrote in a better way(removed cursor and introduced set based
> operation).
> After the change I could see the reads came down to 700, but the duration
> remained the same.
> Why doesnt the duration come down when the reads came down so much.
> Is this a valid question? im not sure.. ie can we expect a better duration
> if the reads are minimized?
> If yes why doesnt the duration come down?
> Thanks,
> Pradeep Kutty
>
>

No comments:

Post a Comment