Posts by Brent Ozar

[Video] Office Hours: The Long One

Videos
2 Comments
You posted a lot of great questions at https://pollgab.com/room/brento and I spent almost an hour covering these: Here’s what we covered: 00:00 Start 02:05 Kulstad: I’m using Ola Hallengren’s maintenance scripts for my db maintenance on Saturday evenings, and I’ve noticed my memory consumption go from approx 35% usage during the business week to 85%…
Read More

[Video] Office Hours in Snowy Telluride, Colorado

Videos
0
On a beautiful sunny afternoon in the mountains, I went through your top-voted questions from https://pollgab.com/room/brento. Audio is a little rough on this one because I used a new wireless microphone and forgot to put the wind shield on it. If you’d like to watch the spatial video version on an Apple Vision Pro or…
Read More

Does Your GROUP BY Order Matter?

Execution Plans
5 Comments
Sometimes when you do GROUP BY, the order of the columns does matter. For example, these two SELECT queries produce different results: Transact-SQL CREATE INDEX Location_DisplayName ON dbo.Users(Location, DisplayName); SELECT TOP 100 Location, DisplayName, COUNT(*) AS Duplicates FROM dbo.Users GROUP BY Location, DisplayName ORDER BY Location, DisplayName; SELECT TOP 100 DisplayName, Location, COUNT(*) AS Duplicates…
Read More

[Video] Office Hours: Speed Round

Videos
1 Comment
Not all of the questions y’all post at https://pollgab.com/room/brento require long-winded answers. Let’s conquer 22 questions in 15 minutes! Here’s what we discussed: 00:00 Start 01:05 JoseDBA: We just started monitoring our AlwaysOn with Datadog. Any recommendations of what to monitor that is valuable and not filling ourselves with meaningless alerts? Thanks! 01:43 Boutaga: Hey…
Read More

[Video] Office Hours From the Future

Videos
4 Comments
To answer today’s questions from https://pollgab.com/room/brento, I strapped on my Apple Vision Pro and recorded my persona as if we were on a FaceTime or Zoom call together. It’s delightfully creepy, as if I’m AI Brent from the Future. Here’s what we covered: 00:00 Start 00:44 Rushabh Shah: I have a question regarding the DBCCSHRINKFILE…
Read More

Updated First Responder Kit and Consultant Toolkit for February 2024

First Responder Kit Updates
0
New this month: better sp_BlitzIndex performance on databases with tens of thousands of objects, sp_DatabaseRestore can run test scripts, and David Wiseman and Sean Killeen implemented basic automated testing for the First Responder Kit. Wanna watch me use it? Take the class. To get the new version: Download the updated FirstResponderKit.zip Azure Data Studio users…
Read More

Query Exercise: Finding Sister Locations to Help Each Other

Query Exercises
12 Comments
For this week’s query exercise, let’s start with a brief query to get a quick preview of what we’re dealing with: Transact-SQL SELECT TOP 100 Location, COUNT(*) AS Population, AVG(Reputation) AS AvgReputation FROM dbo.Users GROUP BY Location ORDER BY COUNT(*) DESC; 123456 SELECT TOP 100 Location, COUNT(*) AS Population, AVG(Reputation) AS AvgReputationFROM dbo.UsersGROUP BY LocationORDER…
Read More

Sessions You Should Attend at SQLBits Online 2024

SQLBits
1 Comment
SQLBits 2024 is next month, and the session agenda is out, including the Microsoft-led sessions. If you’re going to get the boss to buy you an online or in-person ticket, it’ll help if you have a specific list of sessions you wanna attend. Managers love it when you can point at each session and say,…
Read More

[Video] Office Hours: Hot Tub Edition

Videos
1 Comment
Today’s Office Hours comes from a very different office! I climbed into the hot tub to review your top-voted questions from https://pollgab.com/room/brento. Don’t worry, the webcast is completely safe for work. Here’s what we covered: 00:00 Start 00:32 MooneyFlyer: Hey Brent, what are your thoughts on functions like PIVOT and window functions (last_value, first_value, etc).…
Read More

Query Exercise: Find Recent Superstars

Query Exercises
44 Comments
For this week’s Query Exercise, we’re working with the Stack Overflow database, and our business users have asked us to find the new superstars. They’re looking for the top 1000 users who were created in the last 90 days, who have a reputation higher than 50 points, from highest reputation to lowest. In your Stack…
Read More

Finding Long Values Faster: Answers & Discussion

Query Exercise Answers
8 Comments
In last week’s Query Exercise, our developers had a query that wasn’t going as fast as they’d like: Transact-SQL CREATE INDEX DisplayName ON dbo.Users(DisplayName); GO SELECT * FROM dbo.Users WHERE LEN(DisplayName) > 35; 12345 CREATE INDEX DisplayName ON dbo.Users(DisplayName);GOSELECT *  FROM dbo.Users  WHERE LEN(DisplayName) > 35; The query had an index, but SQL Server was refusing to…
Read More