SQL Mysteries: Causality tracking vs Event Sequence for XEvent Sessions

Moved from: bobsql.com


You need to make sure to order the events by event_sequence when doing analytics on the XEvent data. It has been proposed to me that you can use the causality tracking sequence as a sort target, which may work as long as you understand how the activity ids are associated with the parent and the sequence is produced.




Values are generated when the event sequence is submitted to the target
Values are always incremented
The event_sequence is unique to the session
The activity id is unique to the task with xfer reference