All posts
Deep Dive · SQL Server 2022

New Extended Events in SQL Server 2022

SQL Server 2022's CTP added roughly 500 new Extended Events over 2019. I diffed the two lists and picked out the three new events I find most interesting.

Tom · 2 min read
New Extended Events in SQL Server 2022

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. Extended Events are how I investigate errors, so a new SQL Server version is Christmas morning. 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.

SSMS results grid listing new SQL 2022 Extended Events such as parameter_sensitive_plan_optimization, ledger_verification_completed, and openrowset_stats_creation

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 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 replace my old rpc_completed where result = 2 (abort) trick with 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!

Thank you for reading

Tom
Tom, TSQL Dev

SQL Server consultant from Czechia.

Give me a problem where the answer isn't obvious and the evidence doesn't add up. That's my idea of a good time.