T-SQL Tuesday #187: It’s Extended Events. It’s Always Extended Events

SQL Server
Joe Fleming wants to know how I solve weird problems. I'm not sure I'm actually qualified to answer this question since I, myself, am a weird problem, but I'll give it a shot. One aspect of my job is to provide support to our clients. No, I'm not on call (thank the gods), but I'll get roped in for, well, the weirder ones. No, no, not the weirder clients (although...), the weirder problems. Recently we had one, not exactly weird, but it did take a few odd turns along the way. The Problem A client asked us to tell them when a query ran long. Simple. We have a long running query alert, all built in to Redgate Monitor, so, done. No, see, we like getting alerted when queries run…
Read More

SSMS 21 Fixes Irritating Problem

SQL Server
I have a proper blog post coming out tomorrow for T-SQL Tuesday, but today, celebrate with me that SSMS 21 finally, at long last, fixes the irritating fact that the New Session window in SSMS for Extended Events always opened to the wrong size. Here's SSMS 20: At the bottom of the screen on the right, there's actually more to be seen. Now, every version of SSMS from 2012 to version 20 has hidden the Causality Tracking. If you resize the window (I was in the habit of maximizing it as soon as I opened it), you can see Causality Tracking. Here's SSMS 21: There it is! Causality Tracking! WHOOOP!! There's been a whole bunch of other, little, fixes all over SSMS 21, but this one, I'm excited about. Now,…
Read More

Query Hints and Estimated Plans

SQL Server
I'm working on an update to my Query Performance Tuning book for SQL Server 2025 and I found myself wondering, will a query hint be immediately apparent in an execution plan without runtime metrics (AKA, Estimated Plan)? My assumption was a resounding yes, but you have to check. Query Hint in Estimated Plan I've got a simple query that I wanted to test this with: SELECT p.Name, p.Class FROM Production.Product AS p WHERE p.Color = 'Red' AND p.DaysToManufacture > 15 OPTION (USE HINT ('FORCE_LEGACY_CARDINALITY_ESTIMATION')); This one is going to very subtle in it's behavior. The execution plan, estimated and actual, with or without the query hint, is going to be shaped like this: The devil as they say, is in the details. Let's look at the properties of the first…
Read More

Do Yourself a Favor, Check Out Woodler

Uncategorized
I recently was privileged to speak at SQLDay in Wroclaw Poland... man, I love visiting Poland... Anyway... Great event. Worth your time to attend, and if you're a speaker, oh, you don't want to miss this one. The data community there is just amazing. I always walk through the vendor floor to see what's what. I get recommended to look at the SQL Server monitoring tool from Woodler. I do. WOW! Look, I sell a monitoring tool (please, go here, look at Redgate Monitor), which means, technically, we're competitors. However, fact is, we're doing things they're never going to do, and, hoo boy, they're doing some stuff that we're never going to do. Plus, competition is a good thing. Now, they're primarily a consulting organization, but they use the tool…
Read More

Stack Overflow & AI

Professional Development
I won't try to pretend otherwise, I've had some mixed feelings about Stack Overflow for a long time. I think the concept of the place, ask a question, get an answer, is great. No question. How that was handled, tone of moderation, other stuff, maybe it wasn't all handled as well as it could have been. However, it was a model that proved itself. That is, until AI came along. First, go read this. It's a tough story. I see the same thing happening in a lot of places. Heck, I go to several different AI engines for answers more than I go to anyplace else (and then, yes, I validate those answers through other types of research, testing, experimentation, but critics might be surprised at how accurate AI answers…
Read More

SSMS 21

SQL Server
Just a quick one this morning. I'm on the road and haven't worked up a full blog post, apologies. I've been using the preview for SQL Server Management Studio 21 for a little over a week now. You should check it out. It's been mostly stable (I got a crash. I didn't report it because I couldn't replicate it). I think the most interesting thing has been how much it's largely the same. It's in a new home within Visual Studio. However, the majority of the behaviors I've hit so far have been normal. Heck, Redgate SQL Prompt is working for me and my team told me we don't support SSMS 21 yet. I've spent most of my time in Extended Events and the Live Data Window. So much of…
Read More

AI in the DBeaver Query Editor

PostgreSQL
You know I had to do it as soon as I found it was possible. Yes, I installed and enabled AI in the DBeaver Query Editor so I can use AI with my PostgreSQL database work. Let's face it. It was inevitable. However, the setup isn't intuitive. Setting Up in DBeaver I'm going to assume you're on the Community Edition of DBeaver. First, got to the "Help" menu and then "New Software". A window will open up. Right at the top is a drop down labeled "Work with." Select that and then select "DBeaver - AI support - https://dbeaver.io/update/ai/latest/." Next, select "DBeaver AI Support" down in the window and it should look like this: At the bottom of the screen you can pick finish, or hit next and review stuff.…
Read More

So You Think You Should Get a Radio

Misc
This is not database related, so if you're not interested in hearing about something besides SQL Server, PostgreSQL, DevOps, community or data management in general, time to move on. Figured I'd just let you know up front. In the last year there have been several very large scale emergency events, examples include Hurrican Helene in the US and yesterday's massive power outage in Spain, Portugal and France. There have been others as well. Before I go further, my heart goes out to all the people affected in Europe. I hope no one was too hurt by the outage and you all recover quickly. What's been somewhat unique in all these cases is that cel phone services have gone out, on a massive scale. Which means everyone is cut off, and…
Read More

Can AI Read Execution Plans?

SQL Server
Yeah, yeah, second AI post in a row. I promise not to make a habit of it. But I saw someone else mention that you can feed them XML and the AI will read the execution plan. I had to test it out and then overshare my results with all of you. We Need A Query Here's a query: SELECT c.CustomerID, a.City, s.Name, st.Name FROM Sales.Customer AS c JOIN Sales.Store AS s ON c.StoreID = s.BusinessEntityID JOIN Sales.SalesTerritory AS st ON c.TerritoryID = st.TerritoryID JOIN Person.BusinessEntityAddress AS bea ON c.CustomerID = bea.BusinessEntityID JOIN Person.Address AS a ON bea.AddressID = a.AddressID JOIN Person.StateProvince AS sp ON a.StateProvinceID = sp.StateProvinceID WHERE st.Name = 'Northeast' AND sp.Name = 'New York'; This query results in this execution plan: There are some tuning opportunities here.…
Read More

Using AI for Data Conversion

Tools
I'm sure I've never mentioned that I'm an amateur radio operator. Like Vegans and Cross Fitters, we tend to be shy and withdrawn about our predilections. BWA-HA-HA! Ok, like Vegans and Cross Fitters, you can't get a ham to shut up about playing radio. Anyhoo, I've been experimenting with a brand new, and somewhat buggy, radio, the Baofeng DM-32UV. I'm writing this blog post about how I am using an AI for data conversion to make it a little easier to use this radio. The Problem The DM-32 is a Digital Mobile Radio (DMR) as well as an analog radio. You can follow the link to understand all that DMR represents when talking radios. I want to focus on the fact that you have to program the behaviors into a…
Read More