[Video] Watch Brent Tune Queries
Ever wonder somebody else does it? Watch over my shoulder as I spend 9 minutes in PowerPoint explaining the big picture, and then about 40 minutes working on this stored procedure in the StackOverflow2013 database:
If you enjoy that, the Watch Brent Tune Queries page has another video and other query examples. Enjoy!
Related

Hi! I’m Brent Ozar.
I make Microsoft SQL Server go faster. I love teaching, travel, cars, and laughing. I’m based out of Las Vegas. He/him. I teach SQL Server training classes, or if you haven’t got time for the pain, I’m available for consulting too.
Get Free SQL Stuff
"*" indicates required fields

13 Comments. Leave new
INSERT INTO opening_statement (interrogative_adverb, position)
VALUES (‘how ‘, 3)
Thanks Brent, I always pickup something new watching these videos. I’m off to check is_inlineable in SQL 2019
Craig – you’re welcome, glad you enjoyed it!
Came by to say I liked the shout out to Waterloo, Canada!
I didn’t plan that, either, hahaha!
Thanks for the video Brent! I need to download the latest version of SSMS to see the times of the different steps
Obrigado mais uma vez por compartilhar seu conhecimento.
Excellent stuff as usual, thanks Brent.
Hi Brent
I downloaded the database: http://downloads.brentozar.com.s3.amazonaws.com/StackOverflow2013_201809117.7z
But i can’t see the Scalar-valued Function ‘fnGetPostType’ in it, am i missing something?
PS: Here a scrren from the database: https://imgur.com/1EmTdRn
Steen – it’s in the demo script at the top of this page, the link that says “this stored procedure”.
Hi Brent.
Thanks for a speedy reply, but i simply don’t see it in the file ‘Watch_Brent_Tune_Queries_2020.txt’ i get from the link ‘http://u.brentozar.com/Watch_Brent_Tune_Queries_2020.txt’
Could quite possibly be my aging eyes are deceiving me.
Anyway 🙂
If anyone else, like me, can’t see it, here’s the script to create it:
USE StackOverflow2013;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fnGetPostType] ( @PostTypeId INT )
RETURNS NVARCHAR(50)
WITH RETURNS NULL ON NULL INPUT,
SCHEMABINDING
AS
BEGIN
DECLARE @PostType NVARCHAR(50);
SELECT @PostType = [Type]
FROM dbo.PostTypes
WHERE Id = @PostTypeId;
IF @PostType IS NULL
SET @PostType = ‘Unknown’;
RETURN @PostType;
END
GO