SQL Server Extended events (Extended events)--lifetime of events
After you define and start the extended events session, the processing proceeds as usual until the code you are monitoring encounters an event. Describes the steps that are followed for extending the event system.
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;border-bottom:0px;border-left:0px; "alt = "image" src= "http://s3.51cto.com/wyfs02/M01/58/25/wKioL1SqWbSiLh7PAADNJebS3Ls579.jpg" border= "0" height= "314"/ >
The steps are as follows:
1. Perform a check to see if any extended events sessions are monitoring the event. If not, control is returned to the code that contains the event, and then the process continues.
2. Determine the payload of the event, collect all the required information into memory-in other words, build the payload of the event.
3. If any predicates are defined for the event, they are executed. At this point, the predicate result may be that the event should not be consumed. If this is the case, control is returned to the code that contains the event, and then the process continues.
4. Now that the system has learned that the event will be consumed, all actions linked to the event will be executed. Now that the event has a full load, it is ready for consumption.
5. Provide the event to the synchronization target (if any).
6. If there are any asynchronous targets, the event is buffered for subsequent processing.
7. Control is returned to the code that contains the event and then continues processing.
As mentioned earlier, you should take extra care when creating an event session to avoid the impact of synchronization actions or the buffering of asynchronous targets on the performance of the monitored code.
This article is from the SQL Server deep dives blog, so be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1599383
SQL Server Extended Events (Extended events)--lifetime of events