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

Let the optimizer drive Expand / Collapse
Author
Message
Posted Saturday, February 5, 2011 12:18 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: Administrators
Last Login: Today @ 4:15 AM
Points: 569, Visits: 1,017
Comments posted to this topic are about the item Let the optimizer drive
Post #1059157
Posted Sunday, February 6, 2011 2:25 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, December 21, 2012 1:46 AM
Points: 28, 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.
Post #1059212
Posted Sunday, February 6, 2011 9:46 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, March 28, 2014 7:18 AM
Points: 26, Visits: 252
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
Post #1059262
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse