Plan Explorer Support for SQL Server 2016
If you've been playing with the betas of SQL Server 2016, you may have noticed that Plan Explorer does not completely support the beta builds out of the box. Even though Microsoft is still several months away from a formal and final release, we are working very hard to eliminate these incompatibilities; here are a couple of ways to get around them.
In order to prevent errors coming from an XML schema we had not yet encountered, we originally had an upper bound on the showplan version we supported. As of SQL Server 2014, this upper bound was 1.2. Earlier this year, both SQL Server 2016 and Azure SQL Database v12 bumped their showplan schema version from 1.2 to 1.3. This caused the following problem in Plan Explorer when trying to open or generate a plan from either of those versions:
An error occurred while reading the plan xml: The plan version is not supported (1.3)
The challenge here was that this error was returned for all plans, not just plans that contained new elements or attributes that we didn't know how to parse.
In a build we released back in September, we increased our upper bound to 1.3, which resolved the problem temporarily; Microsoft promptly turned around and bumped the showplan version to 1.4, putting us right back in the same spot.
This has been addressed in a recent fix, where the upper bound check on showplan schema version has been removed completely. Please update to the latest build of Plan Explorer; just go to Help > Check for Updates.
If you can't update your existing copy of Plan Explorer for whatever reason, there is another workaround: hand-massage the XML. (This will allow you to open up an existing 1.3 or 1.4 plan, but won't allow you to generate a new plan.) If you open a .sqlplan, .queryanalysis, or .pesession file in your favorite text editor, you should find an XML element something like the following:
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.4" Build="13.0.700.242" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
Now, whether you update Plan Explorer or use the workaround, it is possible that a future showplan version will present parsing issues for us. An example would be if they add a new operator type - in such cases, we may return a similar error to above, or the new operator may simply be omitted from the graphical plan. But this should be rare; in most cases, any additional XML fragments based on new schema extensions should simply be ignored until we intentionally display something for them.
It's a common problem, really: we don't know what we don't know, because we can't predict the exact nature of any future showplan XML schema changes.
Aaron (@AaronBertrand) is a Data Platform MVP with industry experience dating back to Classic ASP and SQL Server 6.5. He is editor-in-chief of the performance-related blog, SQLPerformance.com. Aaron's blog focuses on T-SQL bad habits and best practices, as well as coverage of updates and new features in Plan Explorer, SentryOne, and SQL Server.