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)


    faisalfarouqi (8/9/2014)


    I would also request that if some suggestions around refactoring or maybe reordering of joins could be made to retrieve data quickly.

    Reordering of joins won't do a thing, the order of joins does not matter. Refactoring's not currently indicated, the obvious problem needs to be addressed first.

    I know this isn't supposed to matter, but I recently had to deal with a query where this actually did matter. The plan said it was FULL (instead of TIMEOUT), but I doubt it. The only difference was moving an INNER JOIN around in the FROM clause and the query plan came out wildly different, as did the timings on the query (10 seconds vs. 5 minutes).


    - 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