XE_LIVE_TARGET_TVF Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: ASYNC_NETWORK_IO Wait TypeRelated pillar: Performance & Troubleshooting

Is It a Problem?

Not as a contention point. It is not reported as causing trouble in its own right, and Get Wait Statistics filters it out by default. Its size mostly follows how long live viewers stay open. It is worth knowing about for one reason: unexpected live viewers on a production server mean someone is watching events, which belongs in an incident review.


What It Means

Microsoft lists it as internal use only, from SQL Server 2012. It is a thread doing the work while a query pulls data from an Extended Events live data viewer, possibly in SSMS. It is recorded in preemptive mode, so the thread stays on the CPU until the operation completes. In practice, someone has Watch Live Data open against a session on this instance.


When It Does Matter

The wait does not, but what is being watched can. Collecting a high-frequency event has a cost whether or not anyone watches it live. To see which sessions are running and which targets they have:

SELECT
    s.name AS session_name,
    t.target_name,
    t.execution_count
FROM sys.dm_xe_sessions AS s
JOIN sys.dm_xe_session_targets AS t ON t.event_session_address = s.address
ORDER BY s.name, t.target_name;

Close viewers that are no longer needed, and for ongoing monitoring prefer a file target read on a schedule over a stream left attached. The baseline to monitor is the event sessions running on the instance matching the ones you expect; Get Active XE Sessions lists them with what they collect.


The XE Family

These are the Extended Events background waits, and nearly all of them are commonly filtered as benign. If one is near the top of your waits, start from the waits that usually matter instead.

  • XE_DISPATCHER_WAITDispatcher idle. Background threads waiting for event buffers to deliver.Usually noise
  • XE_TIMER_EVENTDispatch timer. Counting down to the next dispatch, MAX_DISPATCH_LATENCY being 30 seconds by default.Usually noise
  • XE_BUFFERMGR_ALLPROCESSED_EVENTBuffer flush. Session buffers being flushed to their targets on a background thread.Usually noise
  • XE_FILE_TARGET_TVFFile target read. A query reading an event file with sys.fn_xe_file_target_read_file.Usually noise
  • XE_LIVE_TARGET_TVFLive data stream. Streaming a live target, most often Watch Live Data in SSMS.Usually noise. This page.
  • XE_TIMER_MUTEXTimer list. Brief access to the structure holding the XE timers.Usually noise

Where To Go Next

XE_LIVE_TARGET_TVF is background noise on a healthy instance. If you are chasing a real problem, start with the waits that cost you time.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *