HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Interpreting SQL Server's Showplan XML

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
sqlinterpretingxmlshowplanserver

Problem

I just rolled out a feature on my site http://sqlfiddle.com that allows users to view the raw execution plans for their queries. In the case of PostgreSQL, MySQL, and (to some extent) Oracle, looking at the raw execution plan output appears comprehendible. However, if you look at the execution plan output for SQL Server (generated with SET SHOWPLAN_XML ON), there is a simply massive amount of XML to wade through, even for relatively simple queries. Here's an example (taken from the last query's execution plan for this 'fiddle': http://sqlfiddle.com/#!3/1fa93/1):


    
        
            
                
                    
                    
                        
                            
                                
                                
                                
                            
                            
                                
                                    
                                        
                                    
                                    
                                        
                                    
                                    
                                        
                                    
                                
                                
                            
                        
                    
                
            
        
    


My goal with this function was to provide the user with something meaningful for analysis of their query performance (say, to compare against other possible query implementation approaches). However, I am now concerned that I'm providing TOO MUCH data to the user. I need to find a way to make this useful.

One idea I had was to build an easy mechanism for downloading the output as a .sqlplan file, so they could open it up with SSMS and look at it graphically there. I'd rather not have to rely on users having such external tools available, thou

Solution

First let me just say - fantastic looking site :)

This sort of thing is exactly what I wrote that XSLT for - I'm glad that others are finding it useful!

I have to confes its something that I wrote a while ago and then got kind of side-tracked, there are some improvements that I've been planning to make for a while now that I hope to get around to actually implementing soon!

Some links:

  • html-query-plan Project homepage



  • Tools for visualising execution xml plans as HTML (Stack Overflow Question)



Let me know if you have any suggestions for improvements!

Context

StackExchange Database Administrators Q#14727, answer score: 9

Revisions (0)

No revisions yet.