Signs You Need Dynamic SQL To Fix Query Performance Problems In SQL Server

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

DROPCLEANBUFFERS: A Better Test Of Storage Than Query Performance For SQL Server

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

Indexed Views As Filtered Indexes In SQL Server

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

Considerations For Implementing Soft Deletes 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

Defeating Parameter Sniffing With Dynamic SQL In SQL Server

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

A Suggestion To Make Key Lookups Less Of A Performance Problem 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

Recompile Hints Can’t Fix Every SQL Server Query Performance Problem

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

An Overlooked Benefit Of Batch Mode With Windowing Functions 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

Batch Mode On Row Store vs Batch Mode Tricks For Performance Tuning SQL Server Queries

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:

Read the post: Batch Mode On Row Store vs Batch Mode Tricks For Performance Tuning SQL Server Queries

Making The Most Of Temp Tables Part 4: Batch Mode

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

Making The Most Of Temp Tables Part 3: More Opportune Indexes To Make Queries Go Faster

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…

Read the post: Making The Most Of Temp Tables Part 3: More Opportune Indexes To Make Queries Go Faster

Making The Most Of SQL Server Temporary Tables Part 2: Materializing Expressions

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

Making The Most Of Temp Tables In SQL Server Part 1: Fully Parallel Inserts

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