Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Execution plan display change from 2005 to 2012 Expand / Collapse
Author
Message
Posted Wednesday, April 30, 2014 9:23 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, September 12, 2014 3:16 PM
Points: 11, Visits: 171
I was wondering if anyone could help me with something that I've noticed now that we've upgraded our SQL version from 2005 to 2012. We have a number of stored procedures that pass in a list of INT IDs from the application and the developers generally call a stored procedure from inside the main stored procedure to put the values in the table. The stored proc is called GetTableIntFromString and does a loop through the string to put it in the table. This doesn't cause any issues in 2005, but when I point SSMS at a SQL 2005 database and run one of these stored procedure that calls this looping stored procedure, I don't get the plan for the nested stored proc call.

When I look at the same query plan pointed at an SQL 2012 database, for the nested proc call, I get the entire plan for the proc call including every time through the loop in the query plan for the main proc. The problem I run into is that this either makes the query plan so big that it errors before I can see the whole plan or at the very least makes for a lot more scrolling while looking at the plan.

Is there any way to make the query plan output from the 2012 database not display the full plan for the nested proc call? If I need to look at how the nested one is performing, it's easy enough to do on it's own, I don't need to see the full thing every time it's used especially since it's making things that I do need to see not appear.
Post #1566458
Posted Wednesday, April 30, 2014 9:35 AM This worked for the OP Answer marked as solution


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:03 AM
Points: 5,019, Visits: 10,559
Have you tried using SQL Sentry Plan Explorer?
It shows plans in a more compact way and can display individual plans in a batch.

EDIT: Oh, last but not least, it's free.


--
Gianluca Sartori

Get your two-cent-answer quickly
spaghettidba.com
@spaghettidba
Post #1566462
Posted Wednesday, April 30, 2014 10:24 AM This worked for the OP Answer marked as solution


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:03 PM
Points: 15,729, Visits: 28,132
Instead of trying to capture the plan live, just get it from the plan cache using sys.dm_exec_query_plan. You can combine it with sys.dm_exec_sql_text to identify the specific code you're interested in.

And those plans can also be opened by SQL Sentry Plan Explorer.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1566493
Posted Wednesday, April 30, 2014 12:59 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, September 12, 2014 3:16 PM
Points: 11, Visits: 171
I've been meaning to take a look at SQL Sentry Plan Explorer for a while now. I installed it today and it looks like it solves my biggest problem looking at the query plan for these in SSMS since I can just skip the loop. It'd still be nice to have some way to ignore or group the information from the nested proc, but this fits my immediate need and also looks to have some other time saving features built in.

Thanks for the help!
Post #1566563
Posted Wednesday, April 30, 2014 2:03 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:03 AM
Points: 5,019, Visits: 10,559
You're welcome.
Don't overlook Grant's advice. It will probably be easier to extract from the cache, even though you won't have all the information stored in the actual plan.


--
Gianluca Sartori

Get your two-cent-answer quickly
spaghettidba.com
@spaghettidba
Post #1566601
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse