There are things that queries just weren’t meant to do all at once. Multi-purpose queries are often just a confused jumble with crappy query plans.
Read the post: Signs You Need Dynamic SQL To Fix Query Performance Problems In SQL Server
AI Training for Database Teams and SQL Server Performance Tuning
There are things that queries just weren’t meant to do all at once. Multi-purpose queries are often just a confused jumble with crappy query plans.
Read the post: Signs You Need Dynamic SQL To Fix Query Performance Problems In SQL Server
I’ve blogged about OUTPUT a couple times, and those posts are Still Accurate™
Read the post: Mind Your OUTPUT Targets In SQL Server, Some Of Them Hurt Query Performance
When I’m tuning queries, people will often ask me what metrics I look at to judge efficiency. Usually, it’s just getting things to be done faster.
Read the post: DROPCLEANBUFFERS: A Better Test Of Storage Than Query Performance For SQL Server
A residual predicate hurts when a seek lands on a huge range and the next index key column is not available to seek on.
Read the post: Residual Predicates In SQL Server Query Plans
Filtered indexes are really interesting things. Just slap a where clause on your index definition, and you can do all sorts of helpful stuff:
Read the post: SQL Server Filtered Indexes Need Serious Help
While I was answering a question, I had to revisit what happens when using different flavors of recompile hints with stored procedure when they call inner…
Read the post: Recompile And Nested Procedures In SQL Server
This is one of the most frustrating things I’ve seen from the optimizer in quite a while.
Read the post: SQL Server Foreign Keys Don’t Always Improve Query Plans
Pssst! If you landed here from Brent's weekly links, use this link to get my training for 90% off. The access is for life, but this coupon code isn't! Get it while it lasts. Discount applies at checkout, and you…
Read the post: Indexed Views As Filtered Indexes In SQL Server
Implementing soft deletes for an app that’s been around for a while can be tough. In the same way as implementing Partitioning can be tough to add in later…
Read the post: Considerations For Implementing Soft Deletes In SQL Server
Many suggestions for making changes or improvements to a process in a database are met like orders that mean, if not certain, then likely death.
Read the post: Simplifying Archival Processes In SQL Server Using OUTPUT
Dynamic SQL fixes parameter sniffing by building different query strings for values with different data volumes, so each string gets its own plan.
Read the post: Defeating Parameter Sniffing With Dynamic SQL In SQL Server
According to Not-Australians, there used to be a trace flag that would get queries to ignore any supplied hints.
Read the post: Using Plan Guides To Get Around Query Hints In SQL Server
One problem with Lookups, aside from the usual complaints, is that the optimizer has no options for when the lookup happens.
Read the post: A Suggestion To Make Key Lookups Less Of A Performance Problem In SQL Server
After blogging recently (maybe?) about filters, there was a Stack Exchange question about a performance issue when a variable was declared with a max type.
Read the post: Recompile Hints Can’t Fix Every SQL Server Query Performance Problem
Back in October, I had written a couple posts about how parameterizing TOP can cause performance issues:
UPDATE: After writing this and finding the results fishy, I reported the behavior described below in “Somewhat Surprising” and “Reciprocal?” and it was…
Read the post: When Does Scalar UDF Inlining Work In SQL Server?
I will be able to not care about this sort of thing. But for now, here we are, having to write multiple blogs in a day to cover a potpourri of grievances.
Read the post: Annoyances When Indexing For Windowing Functions In SQL Server
When queries go parallel, you want them to be fast. Sometimes they are, and it’s great.
Read the post: An Overlooked Benefit Of Batch Mode For Parallel Query Plans In SQL Server
If you ask people who tune queries why batch mode is often much more efficient with windowing functions, they’ll tell you about the window aggregate…
Read the post: An Overlooked Benefit Of Batch Mode With Windowing Functions In SQL Server
I think Batch Mode is quite spiffy for the right kind of query, but up until SQL Server 2019, we had to play some tricks to get it:
When you have queries that need to process a lot of data, and probably do some aggregations over that lot-of-data, batch mode is usually the thing you…
Read the post: Making The Most Of Temp Tables Part 4: Batch Mode
You have too many indexes on too many tables already, and the thought of adding more fills you with a dread that has a first, middle, last, and even a…
A lot of the time when I see queries that are written with all sorts of gymnastics in the join or where clause and I ask some questions about it, people…
Read the post: Making The Most Of SQL Server Temporary Tables Part 2: Materializing Expressions
If you have a workload that uses #temp tables to stage intermediate results, and you probably do because you’re smart, it might be worth taking advantage…
Read the post: Making The Most Of Temp Tables In SQL Server Part 1: Fully Parallel Inserts
When people tell you that working with correct data types is important, it’s for a variety of very good reasons.
Read the post: An Edge Case When Working With Date Parameters In SQL Server
Copyright © 2019-2026 Darling Data