New Extended Events in SQL Server 2022

Page content

SQL Server 2022 CTP is here πŸ”—︎

It has been announced today (2022-05-24) during the MS Build event. The blog post includes a download link. Unfortunately, the Docker container is not quite ready yet.

Anyway, because I’m a #TeamXE, I had to check out if there are any new goodies there. So, I took an XE event list from Microsoft SQL Server 2019 (RTM-CU16) and the new one from Microsoft SQL Server 2022 (CTP2.0) and compared them.

The list πŸ”—︎

There are precisely 500 new events between those two versions.

Sample of new Extended Events

As you would expect, a big chunk of them relates to the new or improved stuff SQL 2022 is bringing.
Like the Parameter Sensitive Plan (PSP) optimization, Cardinality Estimator Feedback and others.

To check the complete list yourself, you can import it into a temp table from this gist - New Extended Events in SQL Server 2022.

Interesting events πŸ”—︎

After I’ve read the list, a few events caught my attention.

query_abort πŸ”—︎

Indicates that a cancel operation, client-interrupt request, or broken client connection was received, triggering abort.

I can upgrade the rpc_completed where result = 2 (abort) and use this event instead.
It also shows the KILL statements from other sessions.

tsql_feature_usage_tracking πŸ”—︎

Track usage of t-sql features in queries for the database

The event returns a column features_used - Provides a bitmap of features used in query.
I couldn’t get this event to fire, and even if I did, I probably couldn’t parse the bitmap without documentation.

query_antipattern πŸ”—︎

Occurs when a a query antipattern is present and can potentially affect performance.

(The quote is verbatim, so I left the typo in there).

So far it only identifies these antipatterns

  • TypeConvertPreventingSeek
  • NonOptimalOrLogic
  • LargeIn
  • LargeNumberOfOrInPredicate
  • Max

But I think it has potential.

Anyway, which event do you think will be useful? Let me know!