Query Hints

  • Comments posted to this topic are about the item Query Hints

  • A good ( and interesting ) question that I have been able to reply only because I remembered a SQL Server Days session which was about the query hints and the plan recompiles.

    Thanks for it.

  • Only using KEEP PLAN, didn`t use the rest yet.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Thanks Steve for the question. I scored 1 mark.

    But, one question, does this option has any real significance? Can you please suggest in which circumstances DBA should look for enforcing this option?

    Have a great weekend.

    Thanks.

  • Hi SQL-DBA-01 ,

    it seems that KEEPPLAN is for mainly for queries using many temp tables

    See :

    I found only these links which could be interesting for you.

  • patricklambin (4/6/2015)


    Hi SQL-DBA-01 ,

    it seems that KEEPPLAN is for mainly for queries using many temp tables

    See :

    I found only these links which could be interesting for you.

    Cannot see this as specific to temp tables ( more like any high activity tables )

    😎

    KEEP PLAN

    Forces the query optimizer to relax the estimated recompile threshold for a query. The estimated recompile threshold is the point at which a query is automatically recompiled when the estimated number of indexed column changes have been made to a table by running UPDATE, DELETE, MERGE, or INSERT statements. Specifying KEEP PLAN makes sure that a query will not be recompiled as frequently when there are multiple updates to a table.

  • Thanks. I had to research this one, which is a good way to get the brain moving on a Monday morning.

  • Thanks for the question.

  • Good one, Steve.

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • Good one, Thanks Steve

  • Thank you for the post, Steve, really interesting one.

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Nice question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 12 posts - 1 through 11 (of 11 total)

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