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. 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.
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!