Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Execution Plan being changed.


Execution Plan being changed.

Author
Message
nitin.varshney
nitin.varshney
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 270
Hi,
When I am creating the index on 1 table of the sp, it is executing faster. after creating the Index, when I just alter the same sp with no any other changes in the code, that sp is taking time and execution plan is being chnaged.
Aaing if i am Drop & creating the same index, sp executing fatser but after again alter it is performing slow.
What can be reason of change the execution plan only after alter sp even no any code change is there.
Please suggest.
Farlzy
Farlzy
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 361
Sounds to me like you have a an operation in your sp which can affect the way the optimizer calculates the plan. This could be something like a parameter in a join clause which dramatically changes the row counts etc... Sounds like the best thing to do would be to create the procedure using the WITH RECOMPILE option. I'd imagine that the overhead of recompilation will be low compared with using the wrong plan.

http://msdn.microsoft.com/en-us/library/ms190439.aspx
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search