SQL Server

Office Hours is Moving to Wednesdays

SQL Server
6 Comments
For the last few years, we’ve hosted a Tuesday webcast to talk SQL Server. We’re giving it a vacation in August, and then starting September 2, Office Hours is coming back on Wednesdays. This is easier for us because of the way our SQL Critical Care® service works. We’re typically working with clients interactively on Monday and…
Read More

I’m Presenting at kCura Relativity Fest 2015 in Chicago

kCura Relativity, SQL Server
2 Comments
This sounds really cheesy, but I’m honestly excited to be presenting again this year at kCura Relativity Fest 2015. Here’s what I’ll be talking about: How to Check Your SQL Server’s Health The Abstract: You’re a system or database administrator responsible for the uptime and performance of Relativity’s SQL Servers, but you’ve never received professional…
Read More

Finding Tables with Nonclustered Primary Keys and no Clustered Index

Indexing, SQL Server
31 Comments
i’ve seen this happen Especially if you’ve just inherited a database, or started using a vendor application. This can also be the result of inexperienced developers having free reign over index design. Unless you’re running regular health checks on your indexes with something like our sp_BlitzIndex® tool, you might not catch immediately that you have…
Read More

Database Connection Hazards with Entity Framework

SQL Server
23 Comments
I recently came across a curious case where a SQL Server was suffering a number of long-running queries coming from an application written in Entity Framework. When I measured the average query execution times, I got some unexpected results: CPU time: 12 milliseconds Reads: 273 Elapsed time: 6800 milliseconds Wait, what? Looking at the wait stats…
Read More

Logical Query Processing

You can’t do that on management studio Recently, while working with a client, I did something in a query that they were mystified by. I didn’t think much of it, but I thought it might be useful to you, dear readers, as well. Along with an explanation. Here’s a sample query that takes advantage of…
Read More
Creating a branch in the GitHub client for Windows

Pull Request 101 for DBAs Using GitHub

SQL Server
8 Comments
I’ve worked with source control quite a bit over the years — everything from ye olde Visual Source Safe to Subversion to TFS. I even supported the Source Depot system at Microsoft as an engineer for a year back in the day! These days I don’t use source control a ton. We keep repositories of…
Read More

The sp_rename follies

SQL Server
28 Comments
Before we get started… I know. I know. BOL. It’s documented. They even show you how to rename a table. Thanks, sp_rename! But sometimes… You just forget. And as with most simple mistakes, fixing them is… Weird. Here’s what happened to me recently, when I was working on a table swapping demo. Transact-SQL CREATE TABLE…
Read More

Three Easy Tweaks to Tune Up Your SQL Server

SQL Server
18 Comments
I’ve been doing SQL Critical Care® work with clients for over a year now. It’s absolutely true that every client’s situation is different and needs special attention. However, I’ve found that there’s a short list of issues that nearly all clients have in common. Drawing from that list, here are the top three high-impact, low-effort areas you can work…
Read More

Indexing for GROUP BY

Indexing, SQL Server
9 Comments
It’s not glamorous And on your list of things that aren’t going fast enough, it’s probably pretty low. But you can get some pretty dramatic gains from indexes that cover columns you’re performing aggregations on. We’ll take a quick walk down demo lane in a moment, using the Stack Overflow database. Query outta nowhere! Transact-SQL…
Read More

New Updates for sp_Blitz®, sp_BlitzCache™

SQL Server
24 Comments
We’ve just updated our First Responder Kit to include new versions of these tools: sp_Blitz® v41 – June 18, 2015: Added check 162 for CMEMTHREAD waits on servers with >= 8 logical processors per NUMA node. Added check 159 for NUMA nodes reporting dangerously low memory in sys.dm_os_nodes. Added check 161 for a high number of cached…
Read More

Indexing for Windowing Functions

Indexing, SQL Server, T-SQL
6 Comments
Hooray Windowing Functions They do stuff that used to be hard to do, or took weird self-joins or correlated sub-queries with triangular joins to accomplish. That’s when there’s a standalone inequality predicate, usually for getting a running total. With Windowing Functions, a lot of the code complexity and inefficiency is taken out of the picture,…
Read More