Hints used in sql server

  • Hi,

    My query is taking long time for fetching the records.Its not giving me any result because its taking long time for execution.my sql having so many joins.

    So provide me that which HINT will be work for better performance.

    Best Regards,

    Kiran

  • None.

    There's no OPTION(Run SQL Fast)[/url] hint. If the query is not performing, you need to tune it, not try random hints that you don't understand.

    Using hints is like saying that you know better than the SQL Query Optimiser. There are places for them, but they are generally rare and are a last resort when everything else reasonable has been tried, SQL is just doing things the wrong way and you fully understand exactly what the hint is, what it does and why you are applying it.

    If you would like some advice on tuning the query, please post execution plans, query, table definition and index definitions. See http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I just want to reiterate and reinforce one statement. Hints are a last resort. You need to do every other method of tuning before you get to hints. Not only are they the last choice of tuning, but they can easily make performance worse, not better.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (4/14/2011)


    I just want to reiterate and reinforce one statement. Hints are a last resort. You need to do every other method of tuning before you get to hints. Not only are they the last choice of tuning, but they can easily make performance worse, not better.

    And I want to add to this - if you do use hints, you need to evaluate those queries on a regular basis to determine whether or not the hints are useful anymore.

    In most cases that I have come across, hints added years ago when the system was still SQL Server 2000 were no longer valid. Removing those hints actually improved performance because of the changes in the system (more data, upgrade to 2005, new indexes, etc...).

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Expecting any kind of useful answer with such description of the problem is futile.


    * Noel

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply