Showing the query plan returned from the explain statement in a graphic manner

pmscorca 1,052 Reputation points
2024-03-12T15:29:23.2833333+00:00

Hi,

in order to check some T-SQL queries against a Synapse dedicated sql pool I'd like to use the EXPLAIN statement, but it produces a XML query plan and I want to view this plan in a graphic manner.

Any suggests to me, please? Thanks

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,378 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 33,476 Reputation points Volunteer Moderator
    2024-03-12T15:49:45.1+00:00

    Azure Synapse itself does not provide a direct graphical view for the EXPLAIN output, you can accomplish this in another way.

    First, you need to run your EXPLAIN statement in Azure Synapse Analytics to get the XML query plan. Make sure to copy or save this XML data.

    Although your work is in Azure Synapse Analytics, SSMS (a free tool provided by Microsoft for managing SQL Server) can visualize XML plans.

    • Open SSMS and connect to any database (it doesn't need to be the source of the plan).
    • Save the XML plan you got from Synapse to a .sqlplan file. You can do this by opening a new text file, pasting the XML content, and saving the file with a .sqlplan extension.
    • Open the .sqlplan file in SSMS. SSMS recognizes this file format and automatically renders the query plan graphically.

    If SSMS is not an option or you prefer a different tool, there are third-party options available that can visualize SQL query plans from XML. SentryOne Plan Explorer and Redgate's SQL Monitor are examples of such tools.

    There are also online SQL plan viewers that can render your XML plan graphically. These tools might come in handy if you cannot or prefer not to install software on your computer. You would need to upload your .sqlplan file or paste the XML content into the online tool. Be cautious about using online tools if your query plan contains sensitive information. An example of such a tool is the Paste The Plan feature on Brent Ozar website.

    https://www.brentozar.com/pastetheplan/


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.