SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Fixing Plan Issues in the Middle of the Night


Fixing Plan Issues in the Middle of the Night

Author
Message
Jovan Popovic
Jovan Popovic
Valued Member
Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)

Group: General Forum Members
Points: 66 Visits: 73
Comments posted to this topic are about the item Fixing Plan Issues in the Middle of the Night
Arsh
Arsh
Old Hand
Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)

Group: General Forum Members
Points: 327 Visits: 182
Hi Jovan,
Want to know the effect of recompile option with SP execution in these versions considering the introduction of the mentioned query plan enhancements.


Thanks...Arshad
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)

Group: General Forum Members
Points: 278084 Visits: 42244

From the headline:
Do you hate when someone wakes you up in the middle of the night and tells you that some query is slower and you need to investigate it?


No. I actually love it. It means I get to kick someone's butt when I get into work because I will have already told them several times that it would be slow before they promoted it to production. ;-)


--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Arsh
Arsh
Old Hand
Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)

Group: General Forum Members
Points: 327 Visits: 182
Good one Jeff . I love it too ..and for the same reason :-)

.Arshad
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)SSC Guru (278K reputation)

Group: General Forum Members
Points: 278084 Visits: 42244
The problem with all this automatic stuff is that it may never actually do anything to help you identify the actual root of the problem and even the alleged better plan is a train-wreck to begin with. For example, if you aren't updating statistics on large volumes of data changes, either the new or old plans could be absolutely horrible. And there may be no good plan to be had because the ORM created a non-sargable bit of code that must recompile every time it's used (like we had) and it takes 2 to 22 seconds with an average of 7 seconds to compile each time.

Yes, I agree that such automatic selection can help with occasional bad parameter sniffing but make sure this magical cure isn't giving you the nice-warm-fuzzies about things that you really should be proactively looking for and fixing instead.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Arsh
Arsh
Old Hand
Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)Old Hand (327 reputation)

Group: General Forum Members
Points: 327 Visits: 182
Jeff Moden - Tuesday, August 8, 2017 10:09 PM
The problem with all this automatic stuff is that it may never actually do anything to help you identify the actual root of the problem and even the alleged better plan is a train-wreck to begin with. For example, if you aren't updating statistics on large volumes of data changes, either the new or old plans could be absolutely horrible. And there may be no good plan to be had because the ORM created a non-sargable bit of code that must recompile every time it's used (like we had) and it takes 2 to 22 seconds with an average of 7 seconds to compile each time.

Yes, I agree that such automatic selection can help with occasional bad parameter sniffing but make sure this magical cure isn't giving you the nice-warm-fuzzies about things that you really should be proactively looking for and fixing instead.

Absolutely true Jeff . Held similar views about statistics update on large volumes on a poorly designed fast increasing group of large tables (the largest is at 135 million rows increasing by over 1 million per day).Though there's a manual update every 24 hours stats become stale because of the volume of data change (not large enough for SQL server for auto update).


Arshad

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