Andreas Wolter
  • Consulting & Services
    • SQL Server Security Assessment by Andreas Wolter
    • SQL Server Health Check
    • Performance Analysis
    • SQL Server Discovery
    • Air-Gapped SQL Server
  • My Customers
  • About
    • Conferences
    • Certifications
    • Training
  • Blog
  • Contact
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

Extended Event File Target size vs SQL Server Trace trace file – a comparison

Extended Event File Target size vs SQL Server Trace trace file – a comparison

No big science, more out of curiosity this time..

The Extended Events File Target for SQL Server saves data using xml, which as is well known, is a bit “chatty”. A student in my recent SQL Server Master-Class workshop on extended events came up with the question for how much (more) space he would have to account for using Extended Events with a file target. Although this depends greatly on the specific events and possibly actions, selected, I was a bit curious myself and decided for a small test.

Both, the old and deprecated SQL Server Trace and Extended Events can save the data in a file, so it’s easy to compare what difference in size the new format will make.

I set up a SQL Server Trace that is almost identical to an Extended Events Trace. (You will see why “almost”.)

I had to choose a very simple Trace, so the customizable columns of extended events would not make the comparison unequal and ended up with a trace that captures SP:Starting/SP:Completed with the following columns:

You will see why I collect Source/DatabaseID twice later on. Of course I used a lightweight Server-Trace, although for the purpose of this comparison it would not have mattered.

The SQL Trace Definition:

As you might see the trace includes a filter, which is for a specific database ID.

The Extended Event Trace session looks like that:

You may know, that Extended Events include certain columns by default, and for module_start/end, this includes offset and offset_end.

Those two columns are not available for SP_Staring/SP:Completed in SQL Trace. Since they are both integers, I decided to include another column, DatabaseID, into the SQLTrace. SQL Trace also includes the SPID by default, which cannot be deselected, therefore those two columns should equalize it. Both traces were started before the workload which ran for a while. At the end, the same number of events have been logged by both technologies in parallel.

SQL Trace event count:

XEvent Trace event count:

100644 + 100644 = 201288, so both captured the exact same events. 🙂

So, and now to the final question: what size are the files?

See yourself:

Size in Megabytes:

(The numbers in MB are the real size, whereas windows explorer shows the size on disk.)
That’s a difference of 5.32MB or in other words 29.13%.

And this is what one single module_start-event for a function call in XEvents looks like:

The content is self-explanatory, as xml is supposed to be, and the overhead in size is no surprise at all.

Keep in mind that this post is purely on comparing file sizes, and not performance or features. There are good reasons that SQL Trace & Profiler have been deprecated, and Extended Events in SQL Server 2012 overcomes SQL Trace & Profiler by far, in performance as well as in flexibility/usability. For a performance overhead comparison check out my recently published benchmark blog post: “Performance overhead of tracing with Extended Event targets vs SQL Trace under CPU Load“.

So whenever performance matters, remember to set session options appropriately and if the amount of events is high, do not use your slowest volume for the file target – same as for all other tracing activities anyways.

happy tracing,

Andreas

Tags: Extended Events - Performance Analysis - SQL Trace & Profiler

Categories: Monitoring & Tracing

Share
  • Share on Facebook
  • Share on X
  • Share on LinkedIn
3 replies
  1. Ashish says:
    20. October 2015 at 12:05

    Hello Andreas Wolter,
    Thank you very much for the reply.I tried using the file_offset and the event date and time and it worked.

    Reply
  2. Andreas Wolter says:
    17. October 2015 at 14:31

    Hello Ashish,

    file_offset should be correct to use.
    I haven’t tested it lately though and I know in the beginning there was a bug. But that should be fixed, so I would that that.
    What I do for my deadlock-collector, is having a hash over a couple of columns + of course the event date and time.

    Reply
  3. Ashish says:
    15. October 2015 at 15:11

    Hi Sir,
    currently i am working on the enhancement for MS SQL for event monitoring. The requirement is that We used to monitor events from the SQL server trace initially.
    Now we have to migrate to Extended event file(.xel). we use to query trace table to get the event data. There it used to keep the track of the row number in order to fetch the data next time after that row. Since Extended events are in file i cant use the same query to get the data from the file. I have query that get data from the file but there is no field that tell me that i have already read this data(like column number from table,there i can query WHERE column > x). can you please tell me what field i can use for this. there is one column called file_offset but i dont think i can use it.
    Thanks.

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

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

Security Assessment Community Edition

Learn about my free Community Edition script.

Recent
  • Sample result in SSMS: local NTLM connections over shared memory from SQL01, and NTLM connections over TCP from a reporting server, an ETL server and a workstation
    NTLM Deprecation and SQL Server: How to Find NTLM Connections...18. November 2026 - 17:01in: Security
  • SQL Server Consolidation: $3M+ in Projected Savings and...30. September 2026 - 15:47in: Architecture & High Availability, Security
  • Using a Database Server as a Honeypot for Threat Detect...18. September 2026 - 16:00in: Security
  • Azure Arc for SQL Server: “Least Privilege” Mode Still...8. September 2026 - 15:56in: Security
  • When SIEM Enrichment Becomes False Attribution3. September 2026 - 14:26in: Security
Comments
  • Thanks Scott. Goof feedback. NETSTAT is a useful addition,...21. November 2026 - 15:44 by Andreas Wolter
  • I would go a little deeper with how to troubleshoot SQL...21. November 2026 - 15:15 by Scott O
  • Protecting database data at rest is essential for maintaining...21. October 2026 - 2:23 by Viska
  • Thanks Now Microsoft could document them as well, and put...19. August 2026 - 16:26 by Andreas Wolter
  • List of Action_IDs for Filter https://sqlquantumleap.com/reference/server-audit-filter-values-for-action_id/ Great...18. August 2026 - 0:59 by Peter Dünsch

Articles

Analysis Services Auditing Availability Groups Azure Best Practices Certification Columnstore Consolidation Deadlocks & Blocking Encryption Extended Events Get-SqlSafe In-Memory OLTP Indexing Least Privilege PASS Summit Patching Performance Analysis Permissions Privilege Escalation Reporting Services Security Principles Spatial Data SQLBits SQL Injection SQLSaturday SQL Server 2012 SQL Server 2014 SQL Server 2016 SQL Server 2022 SQL Server 2025 SQL Trace & Profiler sysadmin & Server Roles Threat Detection Vulnerabilities Workshop & PreCon
© 2026 Andreas WolterContactImprintPrivacy PolicyLinkedInRSS
Link to: Conferences 2013: Frankfurt Database Days and a couple of “Oracle-Moments” Link to: Conferences 2013: Frankfurt Database Days and a couple of “Oracle-Moments” Conferences 2013: Frankfurt Database Days and a couple of “Oracle-Moments... Link to: Survey: Which Tracing and Analysis-Tools do you use for SQL Server? Link to: Survey: Which Tracing and Analysis-Tools do you use for SQL Server? Survey: Which Tracing and Analysis-Tools do you use for SQL Server?
Scroll to top Scroll to top Scroll to top
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}