Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Recomplie option Expand / Collapse
Author
Message
Posted Friday, May 7, 2010 7:51 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 5:01 AM
Points: 2,840, Visits: 3,968
Hi, can any one tell me when we need to use recompile option in Stored proc ?
How can we figure out it ?
Is execution plan show any sign that SP needs recompilation?


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #917968
Posted Friday, May 7, 2010 7:53 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:15 AM
Points: 39,975, Visits: 36,334
When the query(s) have no single optimal plan. One example is when you have severe parameter sniffing, data skew or similar.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #917972
Posted Friday, May 7, 2010 8:05 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 5:01 AM
Points: 2,840, Visits: 3,968
GilaMonster (5/7/2010)
When the query(s) have no single optimal plan. One example is when you have severe parameter sniffing, data skew or similar.
how do we come to know this ?
through exec plan ? how ? please explain or direct me to any link ?


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #917988
Posted Friday, May 7, 2010 9:25 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 9:27 PM
Points: 13,776, Visits: 28,178
There is no hard and fast formula as in "You MUST use it here, you MAY NOT use it there." It's a case by case basis.

However, one general rule you could apply, if the procedure builds dynamic TSQL statements, then it might benefit from the recompile option.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #918073
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse