Filtered Indexes and Variables: Less Doom and Gloom
It Is Known That when you use filtered indexes, they get ignored when your queries are parameterized. This is a Plan Caching Thing©, of course. The simplest example is a bit column with a filtered...
View ArticleBuild Me A Build: Assembly Olympics
Overall, this was pretty easy I’m thankful that generations of enthusiasts have agreed (mostly) on standards, and written oodles of documentation and guides to make stuff like this easy. Seriously. To...
View ArticleDo DDL Triggers in TempDB Survive Restarts?
Of Course Not Nothing survives in tempdb. But this kind of stinks for those of us who don’t want certain things created in there. In my case, when I’m working on Blitz scripts, I have a terrible habit...
View ArticleBuild Me A Build: Things I’d Do Different
What I started with isn’t what I ended with I started off really trying to stay close to budget. When I realized I needed to go over by a bit (storage, mostly), and that not all of my parts would even...
View ArticleIndexes For Kids
Kid Tested When you work with something a lot, you tend to extrapolate concepts from it out to everything you see. That one person collecting tickets is a serial zone. That food truck line is a HEAP....
View ArticleAnalyzing Temporary Stored Procedures with sp_BlitzCache
All the cool kids Know that when you’re trying to figure out why a stored procedure is slow sometimes, you should use a temporary stored procedure instead of pulling the code out and running it ad hoc....
View ArticleHigh Compiles and Multi-Statement Table Valued Functions
Way back in 2016 I wrote about what to do if sp_BlitzFirst warns about high compiles. During GroupBy, Adam Machanic gave a great talk on new features in SQL Server 2016. It reminded me of a blog post I...
View ArticleFirst Responder Kit Updates: So Many Updates, Brent Quit
I got 128 GB of RAM just to develop sp_BlitzCache with! Also, thanks to @RichBenner @BrentOzar and @douglane for code, and @LitKnd and @HenrikStaunPoulsen for great ideas! Grab the newly updated First...
View ArticleMemory Grants and Data Size
What does memory do? In SQL Server, just about everything. We cache our data and execution plans in it (along with some other system stuff), it gets used as scratch space for temporary objects, and of...
View ArticleInline Table Valued Functions: Parameter Snorting
You’ve probably heard about parameter sniffing But there’s an even more insidious menace out there: Parameter Snorting. It goes beyond ordinary parameter sniffing, where SQL at least tried to come up...
View ArticleSimulating Workload With ostress And Agent Jobs
This question comes up a lot Especially during Office Hours, and the answer is usually… not great. You can spend a lot of money on people and complicated software to design, run, and monitor workloads...
View ArticleWhen THREADPOOL Waits Lead To RESOURCE_SEMAPHORE Waits
Your server is underpowered That’s an understatement. Your server sucks. It has four cores in a single socket, data outpaces RAM by a country mile, the disks have whiskers, and the network card still...
View ArticleCrappy Missing Index Requests
When you’re tuning queries It’s sort of a relief when the first time you get your hands on it, you get the plan and there’s a missing index request. Even if it’s not a super high-value one, something...
View ArticleMax Worker Threads: Don’t Touch That
More isn’t faster I’ve had people give me all sorts of janky reasons for changing Max Worker Threads. I’ve even had people tell me that someone from Microsoft told them to do it. The thing is, all...
View ArticleNew White Paper: SQL Server Performance Tuning in Google Compute Engine
You’re a database administrator, Windows admin, or developer. You might even be a marmot. You’re building your first SQL Servers in Google Compute Engine, and you’re stuck at the create instance...
View ArticleWhy Cost Threshold For Parallelism Shouldn’t Be Set To 5
CURRENT_YEAR() Here it is, 2017. A full 20 years since SQL Server 7. Back then, there was a developer named Nick. Nick was on the development team, and apparently the query-costing-magic development...
View ArticleNo seriously, don’t use SQL_VARIANT for that
I’d been meaning to write this for a while I half-stumbled on the weirdness around SQL_VARIANT a while back while writing another post about implicit conversion. What I didn’t get into at the time is...
View ArticleIndexed Views And Data Modifications
Love/Hate When indexed views help, they make aggregation queries super fast. There are some kind of horrible limitations and requirements. When they hurt, your modifications slow to a crawl because SQL...
View Articlesp_BlitzCache Tip: Cutting Through Heavy Dynamic SQL Use
It keeps me up at night Out of the box, sp_BlitzCache will give you enough stuff to work on in your server’s plan cache to last a month of leap days. This is great for most people, but if you use a ton...
View ArticleConnect Item: Query Plan Hash in sys.dm_exec_query_stats vs Query Plan Hash...
Shifty Henry said to Bugs You know those moments when you’re looking at something for so long, and it’s still not working, and you’re pretty sure you’re losing that final grip on your sanity? Well,...
View Article