how XML plan is convering graphical query plan internally

  • Hi

    Please let me know

    How Xml query plan is internally converting to graphical query plan by sqlserver engine.

    SELECT [cp].[refcounts]

    , [cp].[usecounts]

    , [cp].[objtype]

    , [st].[dbid]

    , [st].[objectid]

    , [st].[text]

    , [qp].[query_plan]

    FROM sys.dm_exec_cached_plans cp

    CROSS APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st

    CROSS APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp ;

    when i execute this querry it will give the out put in XMl plan,when i click any xml paln it gives graphica plan.

    how it is coming????

  • I would direct you here, someone is asking the same question

    http://www.sqlservercentral.com/Forums/Topic1398222-391-1.aspx

    Its all down to the XML name space in the well formed XML

  • It isn't the engine that does that. It's Management Studio.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Yep, Gus has it nailed. Management Studio is making that conversion. Plus, in the engine, SQL Server itself is using a binary to deal with execution plans, not XML, so there's a conversion to XML taking place there and then you get the XML which is converted to graphical. You can look at the XML again by right clicking on any graphical plan and selecting the XML menu choice to see the raw data.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply