Connecting Tech Pros Worldwide Help | Site Map

sql server session state stored proc recompilation

Jason Collins
Guest
 
Posts: n/a
#1: Nov 17 '05
There are a number of stored procedures involved in sql server based session
maintenance:

- TempUpdateStateItemShort
- TempResetTimeout
- TempUpdateStateItemLong

etc. These stored procs are executed by the framework, e.g.,

exec TempResetTimeout @id = '1iucllii0f42ksvfg4zsajae00000001'

Performing a trace shows many SP:CacheMiss (indicating perhaps that the
stored proc is recompiling everytime).

According to Q263889
(http://support.microsoft.com/default...;en-us;263889), the stored
proc owner (e.g., "dbo") should be specified in the call to avoid this
recompilation (or at least the cache miss).

Can anyone tell me if my assessment is correct? Will this optimization be
included in future .NET (1.1) Service Packs?

Thanks,
Jason Collins


Jerry III
Guest
 
Posts: n/a
#2: Nov 17 '05

re: sql server session state stored proc recompilation


Frank gave you all the details... You just need to call the procedure as
owner.sp, in your case (probably) as dbo.TempResetTimeout instead of just
simply TempResetTimeout. This has absolutely nothing to do with .NET, unless
you want it to be magically guessing and changing your SQL statements when
it feels like you didn't really mean them...

Jerry

"MS News (MS ILM)" <sql_agentman@hotmail.com> wrote in message
news:eeJtdsBbDHA.2368@TK2MSFTNGP09.phx.gbl...[color=blue]
> What does that mean please give us more details
>
>
> "Frank Drebin" <noemail@imsickofspam.com> wrote in message
> news:1QO2b.33925$Vx2.14784300@newssvr28.news.prodi gy.com...[color=green]
> > That's a general SQL thing.. technically you should always reference as
> > dbo.StoredProcName
> >
> > "Jason Collins" <jcollins.nospam@point2.com> wrote in message
> > news:ucCZ5qAbDHA.2588@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > There are a number of stored procedures involved in sql server based[/color]
> > session[color=darkred]
> > > maintenance:
> > >
> > > - TempUpdateStateItemShort
> > > - TempResetTimeout
> > > - TempUpdateStateItemLong
> > >
> > > etc. These stored procs are executed by the framework, e.g.,
> > >
> > > exec TempResetTimeout @id = '1iucllii0f42ksvfg4zsajae00000001'
> > >
> > > Performing a trace shows many SP:CacheMiss (indicating perhaps that[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > stored proc is recompiling everytime).
> > >
> > > According to Q263889
> > > (http://support.microsoft.com/default...;en-us;263889), the[/color]
> > stored[color=darkred]
> > > proc owner (e.g., "dbo") should be specified in the call to avoid this
> > > recompilation (or at least the cache miss).
> > >
> > > Can anyone tell me if my assessment is correct? Will this optimization[/color][/color]
> be[color=green][color=darkred]
> > > included in future .NET (1.1) Service Packs?
> > >
> > > Thanks,
> > > Jason Collins
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Jason Collins
Guest
 
Posts: n/a
#3: Nov 17 '05

re: sql server session state stored proc recompilation



Except that the TempResetTimeout, etc. methods are .NET methods for session
maintenance; i.e., I have nothing to do with them, and can't alter them.

j

"Jerry III" <jerryiii@hotmail.com> wrote in message
news:%23XxUJcGbDHA.2620@TK2MSFTNGP09.phx.gbl...[color=blue]
> Frank gave you all the details... You just need to call the procedure as
> owner.sp, in your case (probably) as dbo.TempResetTimeout instead of just
> simply TempResetTimeout. This has absolutely nothing to do with .NET,[/color]
unless[color=blue]
> you want it to be magically guessing and changing your SQL statements when
> it feels like you didn't really mean them...
>
> Jerry
>
> "MS News (MS ILM)" <sql_agentman@hotmail.com> wrote in message
> news:eeJtdsBbDHA.2368@TK2MSFTNGP09.phx.gbl...[color=green]
> > What does that mean please give us more details
> >
> >
> > "Frank Drebin" <noemail@imsickofspam.com> wrote in message
> > news:1QO2b.33925$Vx2.14784300@newssvr28.news.prodi gy.com...[color=darkred]
> > > That's a general SQL thing.. technically you should always reference[/color][/color][/color]
as[color=blue][color=green][color=darkred]
> > > dbo.StoredProcName
> > >
> > > "Jason Collins" <jcollins.nospam@point2.com> wrote in message
> > > news:ucCZ5qAbDHA.2588@TK2MSFTNGP09.phx.gbl...
> > > > There are a number of stored procedures involved in sql server based
> > > session
> > > > maintenance:
> > > >
> > > > - TempUpdateStateItemShort
> > > > - TempResetTimeout
> > > > - TempUpdateStateItemLong
> > > >
> > > > etc. These stored procs are executed by the framework, e.g.,
> > > >
> > > > exec TempResetTimeout @id = '1iucllii0f42ksvfg4zsajae00000001'
> > > >
> > > > Performing a trace shows many SP:CacheMiss (indicating perhaps that[/color][/color]
> the[color=green][color=darkred]
> > > > stored proc is recompiling everytime).
> > > >
> > > > According to Q263889
> > > > (http://support.microsoft.com/default...;en-us;263889),[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > stored
> > > > proc owner (e.g., "dbo") should be specified in the call to avoid[/color][/color][/color]
this[color=blue][color=green][color=darkred]
> > > > recompilation (or at least the cache miss).
> > > >
> > > > Can anyone tell me if my assessment is correct? Will this[/color][/color][/color]
optimization[color=blue][color=green]
> > be[color=darkred]
> > > > included in future .NET (1.1) Service Packs?
> > > >
> > > > Thanks,
> > > > Jason Collins
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Jerry III
Guest
 
Posts: n/a
#4: Nov 17 '05

re: sql server session state stored proc recompilation


You should do both, create it with a fully qualified name and call it with
one too. As for the tracing - I don't know, try using the SQL Server
profiler and look around. And if you can't figure it out ask in a SQL Server
newsgroup.

Jerry

"MS News (MS ILM)" <sql_agentmans@hotmail.com> wrote in message
news:u7MdriLbDHA.880@TK2MSFTNGP09.phx.gbl...[color=blue]
> Jerry,
>
> Couple of questions:
> call the procedure: is it like "create procedure dbo.AddModuleDefinition"
> and not as "create procedure AddModuleDefinition" OR when you actually
> invoke it? via exec or from Code?
>
> How do you Performing a trace in SQL to show SP:CacheMiss
>
>
> Thank you.
>
>
> "Jerry III" <jerryiii@hotmail.com> wrote in message
> news:%23XxUJcGbDHA.2620@TK2MSFTNGP09.phx.gbl...[color=green]
> > Frank gave you all the details... You just need to call the procedure as
> > owner.sp, in your case (probably) as dbo.TempResetTimeout instead of[/color][/color]
just[color=blue][color=green]
> > simply TempResetTimeout. This has absolutely nothing to do with .NET,[/color]
> unless[color=green]
> > you want it to be magically guessing and changing your SQL statements[/color][/color]
when[color=blue][color=green]
> > it feels like you didn't really mean them...
> >
> > Jerry
> >
> > "MS News (MS ILM)" <sql_agentman@hotmail.com> wrote in message
> > news:eeJtdsBbDHA.2368@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > What does that mean please give us more details
> > >
> > >
> > > "Frank Drebin" <noemail@imsickofspam.com> wrote in message
> > > news:1QO2b.33925$Vx2.14784300@newssvr28.news.prodi gy.com...
> > > > That's a general SQL thing.. technically you should always reference[/color][/color]
> as[color=green][color=darkred]
> > > > dbo.StoredProcName
> > > >
> > > > "Jason Collins" <jcollins.nospam@point2.com> wrote in message
> > > > news:ucCZ5qAbDHA.2588@TK2MSFTNGP09.phx.gbl...
> > > > > There are a number of stored procedures involved in sql server[/color][/color][/color]
based[color=blue][color=green][color=darkred]
> > > > session
> > > > > maintenance:
> > > > >
> > > > > - TempUpdateStateItemShort
> > > > > - TempResetTimeout
> > > > > - TempUpdateStateItemLong
> > > > >
> > > > > etc. These stored procs are executed by the framework, e.g.,
> > > > >
> > > > > exec TempResetTimeout @id = '1iucllii0f42ksvfg4zsajae00000001'
> > > > >
> > > > > Performing a trace shows many SP:CacheMiss (indicating perhaps[/color][/color][/color]
that[color=blue][color=green]
> > the[color=darkred]
> > > > > stored proc is recompiling everytime).
> > > > >
> > > > > According to Q263889
> > > > > (http://support.microsoft.com/default...;en-us;263889),[/color][/color]
> the[color=green][color=darkred]
> > > > stored
> > > > > proc owner (e.g., "dbo") should be specified in the call to avoid[/color][/color]
> this[color=green][color=darkred]
> > > > > recompilation (or at least the cache miss).
> > > > >
> > > > > Can anyone tell me if my assessment is correct? Will this[/color][/color]
> optimization[color=green][color=darkred]
> > > be
> > > > > included in future .NET (1.1) Service Packs?
> > > > >
> > > > > Thanks,
> > > > > Jason Collins
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


MS News \(MS ILM\)
Guest
 
Posts: n/a
#5: Nov 17 '05

re: sql server session state stored proc recompilation


Jerry,

Thank you for your answer(s)


"Jerry III" <jerryiii@hotmail.com> wrote in message
news:O4TjkRObDHA.2412@TK2MSFTNGP10.phx.gbl...[color=blue]
> You should do both, create it with a fully qualified name and call it with
> one too. As for the tracing - I don't know, try using the SQL Server
> profiler and look around. And if you can't figure it out ask in a SQL[/color]
Server[color=blue]
> newsgroup.
>
> Jerry
>
> "MS News (MS ILM)" <sql_agentmans@hotmail.com> wrote in message
> news:u7MdriLbDHA.880@TK2MSFTNGP09.phx.gbl...[color=green]
> > Jerry,
> >
> > Couple of questions:
> > call the procedure: is it like "create procedure[/color][/color]
dbo.AddModuleDefinition"[color=blue][color=green]
> > and not as "create procedure AddModuleDefinition" OR when you[/color][/color]
actually[color=blue][color=green]
> > invoke it? via exec or from Code?
> >
> > How do you Performing a trace in SQL to show SP:CacheMiss
> >
> >
> > Thank you.
> >
> >
> > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > news:%23XxUJcGbDHA.2620@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > Frank gave you all the details... You just need to call the procedure[/color][/color][/color]
as[color=blue][color=green][color=darkred]
> > > owner.sp, in your case (probably) as dbo.TempResetTimeout instead of[/color][/color]
> just[color=green][color=darkred]
> > > simply TempResetTimeout. This has absolutely nothing to do with .NET,[/color]
> > unless[color=darkred]
> > > you want it to be magically guessing and changing your SQL statements[/color][/color]
> when[color=green][color=darkred]
> > > it feels like you didn't really mean them...
> > >
> > > Jerry
> > >
> > > "MS News (MS ILM)" <sql_agentman@hotmail.com> wrote in message
> > > news:eeJtdsBbDHA.2368@TK2MSFTNGP09.phx.gbl...
> > > > What does that mean please give us more details
> > > >
> > > >
> > > > "Frank Drebin" <noemail@imsickofspam.com> wrote in message
> > > > news:1QO2b.33925$Vx2.14784300@newssvr28.news.prodi gy.com...
> > > > > That's a general SQL thing.. technically you should always[/color][/color][/color]
reference[color=blue][color=green]
> > as[color=darkred]
> > > > > dbo.StoredProcName
> > > > >
> > > > > "Jason Collins" <jcollins.nospam@point2.com> wrote in message
> > > > > news:ucCZ5qAbDHA.2588@TK2MSFTNGP09.phx.gbl...
> > > > > > There are a number of stored procedures involved in sql server[/color][/color]
> based[color=green][color=darkred]
> > > > > session
> > > > > > maintenance:
> > > > > >
> > > > > > - TempUpdateStateItemShort
> > > > > > - TempResetTimeout
> > > > > > - TempUpdateStateItemLong
> > > > > >
> > > > > > etc. These stored procs are executed by the framework, e.g.,
> > > > > >
> > > > > > exec TempResetTimeout @id = '1iucllii0f42ksvfg4zsajae00000001'
> > > > > >
> > > > > > Performing a trace shows many SP:CacheMiss (indicating perhaps[/color][/color]
> that[color=green][color=darkred]
> > > the
> > > > > > stored proc is recompiling everytime).
> > > > > >
> > > > > > According to Q263889
> > > > > >[/color][/color][/color]
(http://support.microsoft.com/default...;en-us;263889),[color=blue][color=green]
> > the[color=darkred]
> > > > > stored
> > > > > > proc owner (e.g., "dbo") should be specified in the call to[/color][/color][/color]
avoid[color=blue][color=green]
> > this[color=darkred]
> > > > > > recompilation (or at least the cache miss).
> > > > > >
> > > > > > Can anyone tell me if my assessment is correct? Will this[/color]
> > optimization[color=darkred]
> > > > be
> > > > > > included in future .NET (1.1) Service Packs?
> > > > > >
> > > > > > Thanks,
> > > > > > Jason Collins
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Jason Collins
Guest
 
Posts: n/a
#6: Nov 17 '05

re: sql server session state stored proc recompilation



Yes, basically, I was posting here to bring it to someone at MS's
attention...
j

"Jerry III" <jerryiii@hotmail.com> wrote in message
news:%23HKTpQObDHA.2368@TK2MSFTNGP09.phx.gbl...[color=blue]
> I see... Well, not much you can do unless you want to create your own
> session management. Maybe Microsoft will start following their own advice
> sometime in the future...
>
> Jerry
>
> "Jason Collins" <jcollins.nospam@point2.com> wrote in message
> news:%231ShSdMbDHA.1580@tk2msftngp13.phx.gbl...[color=green]
> >
> > Except that the TempResetTimeout, etc. methods are .NET methods for[/color]
> session[color=green]
> > maintenance; i.e., I have nothing to do with them, and can't alter them.
> >
> > j
> >
> > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > news:%23XxUJcGbDHA.2620@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > Frank gave you all the details... You just need to call the procedure[/color][/color][/color]
as[color=blue][color=green][color=darkred]
> > > owner.sp, in your case (probably) as dbo.TempResetTimeout instead of[/color][/color]
> just[color=green][color=darkred]
> > > simply TempResetTimeout. This has absolutely nothing to do with .NET,[/color]
> > unless[color=darkred]
> > > you want it to be magically guessing and changing your SQL statements[/color][/color]
> when[color=green][color=darkred]
> > > it feels like you didn't really mean them...
> > >
> > > Jerry
> > >
> > > "MS News (MS ILM)" <sql_agentman@hotmail.com> wrote in message
> > > news:eeJtdsBbDHA.2368@TK2MSFTNGP09.phx.gbl...
> > > > What does that mean please give us more details
> > > >
> > > >
> > > > "Frank Drebin" <noemail@imsickofspam.com> wrote in message
> > > > news:1QO2b.33925$Vx2.14784300@newssvr28.news.prodi gy.com...
> > > > > That's a general SQL thing.. technically you should always[/color][/color][/color]
reference[color=blue][color=green]
> > as[color=darkred]
> > > > > dbo.StoredProcName
> > > > >
> > > > > "Jason Collins" <jcollins.nospam@point2.com> wrote in message
> > > > > news:ucCZ5qAbDHA.2588@TK2MSFTNGP09.phx.gbl...
> > > > > > There are a number of stored procedures involved in sql server[/color][/color]
> based[color=green][color=darkred]
> > > > > session
> > > > > > maintenance:
> > > > > >
> > > > > > - TempUpdateStateItemShort
> > > > > > - TempResetTimeout
> > > > > > - TempUpdateStateItemLong
> > > > > >
> > > > > > etc. These stored procs are executed by the framework, e.g.,
> > > > > >
> > > > > > exec TempResetTimeout @id = '1iucllii0f42ksvfg4zsajae00000001'
> > > > > >
> > > > > > Performing a trace shows many SP:CacheMiss (indicating perhaps[/color][/color]
> that[color=green][color=darkred]
> > > the
> > > > > > stored proc is recompiling everytime).
> > > > > >
> > > > > > According to Q263889
> > > > > >[/color][/color][/color]
(http://support.microsoft.com/default...;en-us;263889),[color=blue][color=green]
> > the[color=darkred]
> > > > > stored
> > > > > > proc owner (e.g., "dbo") should be specified in the call to[/color][/color][/color]
avoid[color=blue][color=green]
> > this[color=darkred]
> > > > > > recompilation (or at least the cache miss).
> > > > > >
> > > > > > Can anyone tell me if my assessment is correct? Will this[/color]
> > optimization[color=darkred]
> > > > be
> > > > > > included in future .NET (1.1) Service Packs?
> > > > > >
> > > > > > Thanks,
> > > > > > Jason Collins
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Closed Thread