Black Friday prices end in 17d 06h 22m — See the sale

Author: Erik Darling

Restoring tempdb since GETDATE(). Now blogging at ErikDarlingData.com.
Performance Tuning

Missing Index Impact and Join Type

Just Another Way
No matter how you delve into missing index requests -- whether it's the plan level, DMV analysis, or (forgive me for saying it), DTA, the requests will generally be the same.

They'll prioritize equality predicates, the columns may or not may be in the right order, the columns may or may not be in the right part of the index, and the impact...

Read more about Missing Index Impact and Join Type 8 comments — Join the discussion
Performance Tuning

Table Valued Parameters: Unexpected Parameter Sniffing

Like Table Variables, Kinda
Jeremiah wrote about them a few years ago. I always get asked about them while poking fun at Table Variables, so I thought I'd provide some detail and a post to point people to.

There are some interesting differences between them, namely around how cardinality is estimated in different situations.

Read more about Table Valued Parameters: Unexpected Parameter Sniffing 10 comments — Join the discussion
Production DBA

How to Restore a SQL Server Database into Azure SQL DB Managed Instances Redux

Anything Brent Can Do
There's some things you can do with Managed Instances, and some ways you can look at data that you can't do elsewhere.

For instance, you have the ability to start an restore ASYNC -- that means if your session drops, the restore will continue headlessly in the background.

Read more about How to Restore a SQL Server Database into Azure SQL DB Managed Instances Redux 5 comments — Join the discussion
T-SQL & Development

Fifteen Things I Hate About ISNUMERIC

Yello!
[crayon-6af74a9c8aaf6568976357/]
Thanks for reading!

Brent says: the funny part to me is that if you just try to union all of them, SQL Server throws its hands up:
[crayon-6af74a9c8ab08511946553/]
Result:
[crayon-6af74a9c8ab0c156721935/]
COME ON SQL SERVER YOU JUST TOLD ME THEY WERE ALL NUMERIC, dammit, convert to numeric for me if you're so smart.

Read more about Fifteen Things I Hate About ISNUMERIC 22 comments — Join the discussion
Performance Tuning

The Many Levels Of Concurrency

"Concurrency is hard"

When designing for high concurrency, most people look to the hardware for answers. And while it's true that it plays an important role, there's a heck of a lot more to it.
Start Optimistic
Like, every other major database vendor is optimistic by default. Even the free ones. SQL Server is rather lonesome in that, out of the box, you get the Read Committed isolation level.

Read more about The Many Levels Of Concurrency 7 comments — Join the discussion
Performance Tuning

Memory Grants: SQL Server’s Other Public Toilet

Sharing Is Caring
When everything is going well, and queries are behaving responsibly, one need hardly think about memory grants.

The problem becomes itself when queries start to over and under estimate their practical needs.
Second Hand Emotion
Queries ask for memory to do stuff. Memory is a shared resource.

Read more about Memory Grants: SQL Server’s Other Public Toilet 13 comments — Join the discussion

A Gentle Introduction To the Stack Overflow Schema

Stack: Dumped

Wanna learn the schema of the free Stack Overflow public database? If you want the Full Nelson, it's all documented here. That's a great resource if you're looking to learn more, but generally when you're looking at a data dump and building up demo queries, you wanna get an idea of where the data skews, and how the tables relate.

Read more about A Gentle Introduction To the Stack Overflow Schema 11 comments — Join the discussion