Posts by Brent Ozar

[Video] Office Hours: Back at Home (Briefly)

Videos
0
I took a break from unpacking my SQL Saturday San Diego bags and re-packing for a Boston wedding long enough to take your top-voted questions from https://pollgab.com/room/brento. Office Hours: Back at Home (Briefly)Watch this video on YouTube Here’s what we covered: 01:55 Deadlockinator: Hi Brent, Why does sp_BlitzWho return NULL in the query_text for some…
Read More

How Many Indexes Is Too Many?

Indexing
4 Comments
Let’s start with the Stack Overflow database (any size will work), drop all the indexes on the Users table, and run a delete: Transact-SQL SET STATISTICS IO ON; GO BEGIN TRAN DELETE dbo.Users WHERE DisplayName = N'Brent Ozar'; 1234 SET STATISTICS IO ON;GOBEGIN TRANDELETE dbo.Users WHERE DisplayName = N'Brent Ozar'; I’m using SET STATISTICS IO…
Read More

Should That Be One Update Statement or Multiple?

T-SQL
12 Comments
Let’s say we have a couple of update statements we need to run every 15 minutes in the Stack Overflow database, and we’ve built indexes to support them: Transact-SQL EXEC DropIndexes @TableName = N'Users'; CREATE INDEX LastAccessDate ON dbo.Users(LastAccessDate); CREATE INDEX AccountId ON dbo.Users(AccountId); GO BEGIN TRAN /* Give reputation points if folks did something…
Read More

[Video] Consulting Lines

Consulting Lines, Videos
2 Comments
In my consulting work, I often find myself saying the same things to clients – but they’re not the kinds of things I said when I was a database administrator. I call these “Consulting Lines”, and I talked through ’em: Consulting LinesWatch this video on YouTube   Here’s my full series of Consulting Lines blog…
Read More

[Video] Office Hours on a Calm Sea Day Off Canada

Videos
1 Comment
On an unbelievably calm sea day off the shores of Canada, aboard the Norwegian Jewel, I enjoyed a nice cup of completely alcohol-free coffee (as far as you know) and took your top-voted questions from https://pollgab.com/room/brento. Office Hours: Ask Me Anything at SeaWatch this video on YouTube Here’s what we covered: 00:00 Start 01:20 NotCloseEnoughToRetirementToStopLearning:…
Read More

[Video] Office Hours in Haines, Alaska: No Bears Here

Videos
0
While in beautiful Haines, Alaska along the Chilkoot River, I stopped to take your top-voted questions from https://pollgab.com/room/brento. Office Hours: Ask Me Anything in Haines, AlaskaWatch this video on YouTube Here’s what we covered: 00:00 Start 00:26 James L: When you were an employee, how did you decide whether to move on to another job?…
Read More

[Video] Office Hours: Icy Strait Point, Alaska

Videos
0
I’m on a boat! We took an Alaska cruise with some friends aboard the Norwegian Jewel. En route to Icy Strait Point, Alaska, I took your top-voted questions from https://pollgab.com/room/brento. Office Hours: Ask Me Anything in Icy Strait Point, AlaskaWatch this video on YouTube Here’s what we covered: 00:00 Start 01:40 RollbackIsSingleThread: Hi Brent! If…
Read More

[Video] Office Hours: Open Q&A on Microsoft Databases

Videos
2 Comments
I took your top-voted questions from https://pollgab.com/room/brento while recovering from a late night of partying. Office Hours: Open Q&A on Microsoft DatabasesWatch this video on YouTube Here’s what we covered: 00:00 Start 01:00 VegasDBA: Loved the Always-On Availability Group Episode! You mentioned how awful the dashboard is for monitoring. Can you recommend any scripts, custom…
Read More

Yes, Cardinality Estimation Keeps Changing After SQL Server 2014.

Execution Plans
4 Comments
About 10 years ago, Microsoft made changes to the Cardinality Estimator (CE) which caused some problems for SQL Server upgrades. When folks upgraded to SQL Server 2014, they also casually switched their databases’ compatibility level to the latest version, because for years that hadn’t really affected query plans. They just figured they wanted the “latest…
Read More

TRY/CATCH Doesn’t Always Work.

T-SQL
11 Comments
If you’re using TRY/CATCH to do exception handling in T-SQL, you need to be aware that there are a lot of things it doesn’t catch. Here’s a quick example. Let’s set up two tables – bookmarks, and a process log to track whether our stored proc is working or not: Transact-SQL DROP TABLE IF EXISTS dbo.Bookmarks;…
Read More

[Video] Office Hours: Open Q&A About Databases

Videos
0
I went through your top-voted questions from https://pollgab.com/room/brento plus hit live ones from the TikTok viewers. Office Hours: Ask Me Anything About DatabasesWatch this video on YouTube Here’s what we covered: 00:00 Start 00:52 chandwich: If SSMS had a dark mode option that was equally as good as the existing light mode, would you use…
Read More
I'm killing your query.

Contest: What’s Your Biggest Database Regret?

Company News
60 Comments
PAST ME, WHAT WERE YOU THINKING We all make mistakes. I certainly have. I’ll give you a recent one, actually: when we designed the database for SQL ConstantCare®, when we’re storing diagnostic data like wait stats, we thought these 3 columns would be good for identification: user_id server_name instance_name Because a single user would never…
Read More

[Video] Office Hours: Database Q&A

Videos
0
I went live on TikTok and took your top-voted questions from https://pollgab.com/room/brento: Office Hours: Database Q&AWatch this video on YouTube Here’s what we covered: 00:00 Start 00:23 Andrea Hardesty: Do you have any recommendations for reproducing parameter sniffing issues? I have a copy of a production DB. I want @param=222 to use the plan compiled…
Read More