is only one plan is kept for one query in plan cache?

  • hi,

    Is only one plan is kept for one query in plan cache?

    i heard generaly hash is created for a query and plan is search with this hash.

    yours sincerley

  • At the most basic level, yes, only one plan is in the cache for a given query. But, things can affect this. For example, if the same query is called from two different connections and those two connections have different ANSI settings, you'll have two different plans. But for the most part, you'll see one per query.

    "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

  • You may see what looks like multiple entries in the plan cache for the same sproc if the sproc has multiple select statements. Each part of the query will have its own plan.

Viewing 3 posts - 1 through 2 (of 2 total)

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