Wednesday, March 7, 2012

cache of stored procedure

Dear sir,
On one of my page, it often reach a connection time out for the first hit.
After the first hit, that page will be much faster for the second visitor.
However after a while, that page back to original situation, waiting for the
first hit to make it faster.
I think this is because SQL server cache the execution plan after first hit.
Is it possible to make SQL server always cache this execution plan, so that
this page will always be that faster.
Thanks in advanced for your help!!!
regards,
Guoqi Zheng
http://www.ureader.comSQL Server will reuse cached plans whenever it can but sometimes it
needs to recalculate a given plan. It's a fairly complicated area with
many possible scenarios. If you want to know more about query plan
caching and reuse read this whitepaper (it's much better than any
summary I could give):
Batch Compilation, Recompilation, and Plan Caching Issues in SQL Server
2005 <http://www.microsoft.com/technet/pr...005/recomp.mspx>
It deals specifically with SQL 2005 but most of it (the theory at least)
applies to SQL 2000 as well.
*mike hodgson*
http://sqlnerd.blogspot.com
guoqi zheng wrote:

>Dear sir,
>On one of my page, it often reach a connection time out for the first hit.
>After the first hit, that page will be much faster for the second visitor.
>However after a while, that page back to original situation, waiting for th
e
>first hit to make it faster.
>I think this is because SQL server cache the execution plan after first hit
.
>Is it possible to make SQL server always cache this execution plan, so that
>this page will always be that faster.
>Thanks in advanced for your help!!!
>regards,
>Guoqi Zheng
>http://www.ureader.com
>|||thanks, I will read it!
regards,
Guoqi Zheng
http://www.ureader.com

No comments:

Post a Comment