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 12»»

What does Plan_Handle Specifies? Expand / Collapse
Author
Message
Posted Wednesday, October 3, 2012 12:57 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 255, Visits: 622
Hi,
I am a newbie.I was going around DMV and found out Plan_Handle. I find out that this column is used in most of the DMV . I tried to find out what does that mean on internet but not much information is given.The language specified on msdn website giving explanation about Plan_Handle is quite high by my measures.
I am not able to get what does that Hex-Code Means.
Post #1367417
Posted Wednesday, October 3, 2012 1:22 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 42,774, Visits: 35,871
It doesn't mean much, it's just used to join several of the plan-related DMVs together.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1367431
Posted Wednesday, October 3, 2012 1:26 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 255, Visits: 622
Hi GilaMonster,
Then what does that hex-codes specifies. Any good resource where i can get the information about the DMV. I mean good resource so do not suggest MSDN
Post #1367434
Posted Wednesday, October 3, 2012 1:30 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 42,774, Visits: 35,871
I am going to suggest MSDN, because it is a good resource. All the DMVs are well documented there. Start with sys.dm_exec_cached_plans and have a look at all related DMVs.

Again, the plan handle is just a binary identifier. It just identifies a plan.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1367436
Posted Wednesday, October 3, 2012 1:35 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 255, Visits: 622
In msdn i was looking for sys.dm_exec_query_stats in that there is a column name 'statement_start_offset' . Explanation of it is given as '.....the starting position of the query that the row describes within the text of its batch or persisted object.' .
Now in this case what does "batch or persisted object."


Post #1367437
Posted Wednesday, October 3, 2012 2:05 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 42,774, Visits: 35,871
Batch - current batch of SQL statements (set of statements sent to the server) http://msdn.microsoft.com/en-us/library/ms175502%28v=sql.105%29.aspx
Persisted object - stored procedure, function or trigger.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1367452
Posted Wednesday, October 3, 2012 2:46 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 255, Visits: 622
Thanks man
Post #1367468
Posted Wednesday, October 3, 2012 3:35 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 255, Visits: 622
Hi Gila,
Further into MSDN i found out the defination execution_count it is given as "Number of times that the plan has been executed since it was last compiled." So could you please tell me what does it mean by "Was last compiled".
I know that we execute the query but compiled
Post #1367492
Posted Wednesday, October 3, 2012 3:50 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 42,774, Visits: 35,871
Compiled = plan generated by the optimiser. So that's the number of times that the procedure has been executed since the current execution plan was compiled by the optimiser.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1367505
Posted Wednesday, October 3, 2012 4:12 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 255, Visits: 622
Please pardon me if i am wrong but isn't the query plan generated just when we press the execute button, if yes then that means every time plan is generated the query is executed.
Post #1367529
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse