Unix Technical Forum

Sp:Cachemiss and no sp:recompile

This is a discussion on Sp:Cachemiss and no sp:recompile within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello: The installation details: W2K SP4, SQL Server 2000 Ent with 1GB RAM. It is a Bi-P3. When I ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:44 PM
J?r?my
 
Posts: n/a
Default Sp:Cachemiss and no sp:recompile

Hello:

The installation details:

W2K SP4, SQL Server 2000 Ent with 1GB RAM. It is a Bi-P3.

When I run the Profiler to trace Stored Procedure performance, I get a
bunch of SP:CacheMiss for couple of stored procedure I invoke quite
often in a web app.
But I do not see SP:Recompile.

Here are my questions:

i) If the plan is not in the Cache, why am I not see SP: Recompile.
Where else can it be tugged.
ii) What are the other counters I need to monitor to see if I need more
memory.

Thanks in advance for any leads on this.

Regards:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:44 PM
Simon Hayes
 
Posts: n/a
Default Re: Sp:Cachemiss and no sp:recompile


"J?r?my" <esteban_calle@hotmail.com> wrote in message
news:6e7e2caf.0311100245.4f0d6e63@posting.google.c om...
> Hello:
>
> The installation details:
>
> W2K SP4, SQL Server 2000 Ent with 1GB RAM. It is a Bi-P3.
>
> When I run the Profiler to trace Stored Procedure performance, I get a
> bunch of SP:CacheMiss for couple of stored procedure I invoke quite
> often in a web app.
> But I do not see SP:Recompile.
>
> Here are my questions:
>
> i) If the plan is not in the Cache, why am I not see SP: Recompile.
> Where else can it be tugged.
> ii) What are the other counters I need to monitor to see if I need more
> memory.
>
> Thanks in advance for any leads on this.
>
> Regards:


Are you also seeing SP:ExecContextHit or SP:CacheInsert right after the
SP:CacheMiss? If so, one possibility is that your stored proc is called
sp_Something but is in a user database. In that case, since the name beings
with sp_, MSSQL looks first in the master database but doesn't find the proc
(SP:CacheMiss), then it tries the user database and finds the proc
(SP:ExecContextHit). If that isn't the case, then perhaps you can give more
information about what the proc is doing, which database it's in, exactly
which SP events you see when you execute the procedure, and in what order?

Regarding memory, have a look at "Monitoring Memory Usage" in Books Online,
as well as this page:

http://www.sql-server-performance.co...ers_memory.asp

Simon


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 06:46 PM
J?r?my
 
Posts: n/a
Default Re: Sp:Cachemiss and no sp:recompile

Hi Simon,

Thanks for your comments.

So, what I have in the Profiler:

RPC:Starting --> EXEC dbname.dbo.Myproc @Param
SP:CacheMiss --> Myproc
SP:ExecContextHit -->
SP:Starting --> EXEC dbname.dbo.Myproc @Param
....

The stored procedure that have the same profiling don't begin with
sp_*
but with Misc_* and return a recordset.

Regarding Monitoring memory, I have already checked it, before sending
a messsage to this group, and I didn't find any problem.
The server has 7Gb with 6Gb set to SQLServer (with AWE)
The SQL cache Memory is about 12Mb.

Then I don't know what happened.

Best,
Jeremy

> Are you also seeing SP:ExecContextHit or SP:CacheInsert right after the
> SP:CacheMiss? If so, one possibility is that your stored proc is called
> sp_Something but is in a user database. In that case, since the name beings
> with sp_, MSSQL looks first in the master database but doesn't find the proc
> (SP:CacheMiss), then it tries the user database and finds the proc
> (SP:ExecContextHit). If that isn't the case, then perhaps you can give more
> information about what the proc is doing, which database it's in, exactly
> which SP events you see when you execute the procedure, and in what order?
>
> Regarding memory, have a look at "Monitoring Memory Usage" in Books Online,
> as well as this page:
>
> http://www.sql-server-performance.co...ers_memory.asp
>
> Simon

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 06:46 PM
Simon Hayes
 
Posts: n/a
Default Re: Sp:Cachemiss and no sp:recompile

esteban_calle@hotmail.com (J?r?my) wrote in message news:<6e7e2caf.0311120247.674d4cad@posting.google. com>...
> Hi Simon,
>
> Thanks for your comments.
>
> So, what I have in the Profiler:
>
> RPC:Starting --> EXEC dbname.dbo.Myproc @Param
> SP:CacheMiss --> Myproc
> SP:ExecContextHit -->
> SP:Starting --> EXEC dbname.dbo.Myproc @Param
> ...
>
> The stored procedure that have the same profiling don't begin with
> sp_*
> but with Misc_* and return a recordset.
>
> Regarding Monitoring memory, I have already checked it, before sending
> a messsage to this group, and I didn't find any problem.
> The server has 7Gb with 6Gb set to SQLServer (with AWE)
> The SQL cache Memory is about 12Mb.
>
> Then I don't know what happened.
>
> Best,
> Jeremy
>


<snip>

In that case, another possibility is that you are not calling the proc
with exactly the same name, ie. you have changed the case of the
procedure name:

create proc dbo.p
as
select 1
go

exec dbo.p -- SP:CacheInsert
exec dbo.p -- SP:ExecContextHit
exec dbo.P -- SP:CacheMiss, then SP:ExecContextHit

Changing the case of the database name or owner doesn't result in a
cache miss, but changing the case of the procedure name does.

Simon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 06:48 PM
J?r?my
 
Posts: n/a
Default Re: Sp:Cachemiss and no sp:recompile

Thanks for your answer Simon,
I will check that.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com