﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Stored Procuders which has multiple execution plans / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 10:15:43 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>Yes i have that URL. He explained that a parallel plan can also be executed by a single processor. [url] http://sqlblog.com/blogs/paul_white/default.aspx[/url]</description><pubDate>Tue, 16 Nov 2010 08:35:09 GMT</pubDate><dc:creator>ps.</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>[quote][b]ps. (11/16/2010)[/b][hr]In some cases, query processor may keep two plans, 1) without using parallelism, 2) using parallism and use either of them.[/quote]Nope. Recently debunked by Paul White (I'll leave it to him to come up with url, I'm working on a freshly installed machine)If there are multiple plans (ie with different plan handles) then either set options are different or (user is different and query is not safe for reuse between different users)</description><pubDate>Tue, 16 Nov 2010 06:29:26 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>In some cases, query processor may keep two plans, 1) without using parallelism, 2) using parallism and use either of them.beyond that, i cant think why you are seeing several plans for one sp.</description><pubDate>Tue, 16 Nov 2010 04:55:12 GMT</pubDate><dc:creator>ps.</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>Hi Pradeep,Below is the query :SELECT db_name(st.dbid)                      DBName,       object_schema_name(st.objectid, dbid) SchemaName,       object_name(st.objectid, dbid)        StoredProcedure,       MAX(cp.usecounts)                     Execution_count,       st.text								 [Plan_Text]FROM   sys.dm_exec_cached_plans cp       CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) stWHERE  db_name(st.dbid) IS NOT NULL       AND cp.objtype = 'proc'GROUP  BY cp.plan_handle,          db_name(st.dbid),          object_schema_name(objectid, st.dbid),          object_name(objectid, st.dbid),          st.textORDER  BY MAX(cp.usecounts) DESCThanks,Vijay Singh</description><pubDate>Tue, 16 Nov 2010 04:42:42 GMT</pubDate><dc:creator>vijay.singh 97987</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>what query are you running to see that?</description><pubDate>Tue, 16 Nov 2010 04:39:15 GMT</pubDate><dc:creator>ps.</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>Thanks for the updates..:-)When i saw the Cache i got SPs with multiple cache plan even after not changing the SET options. Is there any other way to avoid this?Thanks,Vijay Singh</description><pubDate>Tue, 16 Nov 2010 04:34:11 GMT</pubDate><dc:creator>vijay.singh 97987</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>The only way you'll have multiple plans per procedure is if the procedure has been run with different SET options. Certain set options (see BoL for details) change the way the query must be executed and hence get a different plan.</description><pubDate>Tue, 16 Nov 2010 03:45:25 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>by default query processor generates multiple execution plan for any query that you submit and chooses one of them based on least cost. This is by design and you cannot control it. There are some cases where in if query processor determines that choosing amongst various execution plan is going to take more time, it generates one plan and executes the query as per that plan.you can click on include actual execution plan to see what is the plan selected by the query processor.</description><pubDate>Tue, 16 Nov 2010 03:29:32 GMT</pubDate><dc:creator>ps.</dc:creator></item><item><title>Stored Procuders which has multiple execution plans</title><link>http://www.sqlservercentral.com/Forums/Topic1021318-146-1.aspx</link><description>Hi All,I have few doubts on execution plans.1) How to find the Stored Procuders which has/Generates multiple execution plans?2) How to avoid the generation of multiple execution plans by SP's.Please help me on this guys..:-)Thanks in advance.Regards,Vijay Singh</description><pubDate>Tue, 16 Nov 2010 02:41:00 GMT</pubDate><dc:creator>vijay.singh 97987</dc:creator></item></channel></rss>