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