Home Forums SQL Server 2008 T-SQL (SS2K8) Troubleshooting\Tuning sql query taking more than 40 secs RE: Troubleshooting\Tuning sql query taking more than 40 secs

  • GilaMonster (8/9/2014)


    Remember the optimiser is NEVER looking for the best plan, it's looking for a good plan fast. In one case if found a good plan that was actually crap, in the other it found a good plan that was good. In that case, I'd be looking over the query to see if there's anything in it which is prone to cause the optimiser problems.

    An excellent reminder, thanks. Due to the nature of the concern I actually took the query apart completely and rebuilt it using a temp table mid-point with indexes to control the optimizations and expectations.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA