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


Let the optimizer drive


Let the optimizer drive

Author
Message
Tony Davis
Tony Davis
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: Administrators
Points: 1361 Visits: 1162
Comments posted to this topic are about the item Let the optimizer drive
Ken Lee-263418
Ken Lee-263418
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
Points: 56 Visits: 59
I'm not sure I understand how the query optimizer can fix up a poor performing query just by letting it figure out the problem and fixing it. I've never seen that happen, so I just don't believe it is possible. Especially when I analyze the schema, think about what the query is doing. Realize what is wrong. Change the query and get immediate improvement in performance. Run a quick query and verify my query is 50 to a 1000 times faster. (Does the same thing, but aborts itself within seconds to not impact the production system.)

I then let the existing production code continue ineffectively cleaning up the data a few days, while I report back to the developement team about the pour performing query, how to fix it, and why it will fix it. They take my suggestion, apply it to their production code after doing their own tests.
About this time the "daily" update process is running 3 days straight before the job finishes. We stop the job, apply the updates and restart the job. It takes 3 hours to complete the updates to catch up with the backlog. The daily update runs in 1 hour.

Sorry, understanding the schema, optimizing the query to take advantage of the schema trumps a pour performing query every time.
Fabiano Neves Amorim
Fabiano Neves Amorim
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 319
Hi Ken, if you wish I've some samples where QO can and do change your queries to get better performance...

I think the main point about this topic is to understand what is happening, and why something is not good for performance (in terms of code optimization).

I agree that sometimes is hard to apply change in a production environment, but unfortunately that’s life . But this still cheaper than an hardware improvement.

Cheers
[]s

Fabiano Amorim
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