DBA's Guide to sp_WhoIsActive: Troubleshooting Blocking & Locks

Blocking and locking issues are among the most common—and frustrating—challenges a DBA faces in SQL Server. A single blocked session can quickly escalate into widespread performance degradation, leaving users complaining while the root cause remains hidden. In such situations, having the right tool is critical. In this article, we will explore how sp_WhoIsActive helps you quickly identify blocking chains, understand locking behavior, and take effective action to resolve the issue with confidence. [More]

DBA's Guide to sp_WhoIsActive: Finding Out Long Running Queries

Long-running queries are one of the most common causes of SQL Server performance issues. When a query runs for an unusually long time, it can consume excessive CPU, memory, or IO resources and may also block other sessions.

In such situations, quickly identifying the problematic query becomes critical for DBAs. In this series of article on sp_WhoIsActive, we will explore how sp_WhoIsActive can help you to detect long-running queries and understand what they are doing inside SQL Server. Let's start. [More]

SQL Server Slow? Rebooting is Probably the Worst Fix

When SQL Server performance sucks, "Just reboot it." is common phrase from one of my colleagues. And surprisingly, it often seems to fix the problem. However, the improvement is usually temporary. Restarting SQL Server clears the buffer cache, execution plan cache, and other diagnostic data, which can hide the real root cause. In this article, we will explore why rebooting appears to improve performance and why you should avoid this bad habit. [More]

Why My SQL Server Job Queue Table Was Deadlocking — and How I Fixed It

Recently, there was performance issue in one of our systems and the client asked us to find the root cause. In brief, there are two different processes in that system, some processes are generating some jobs and adding into a job table with unprocessed status, and other processes are competing to pick and update the unprocessed rows. Long time, the system was working fine without raising any concern. I was curious about what went wrong and how to fix it. So, I spent couple of hours to investigate it. In this article, I am going to explain what actually happened and how I resolved it. Let's start. [More]

DBA's Guide to sp_WhoIsActive: Introduction

Monitoring real-time activity inside SQL Server is one of the most essential tasks for a DBA. Whether users are complaining about slow performance, reports are taking longer than usual, or your CPU suddenly spikes to 90%, the first question you ask yourself is — "What is running right now?". SQL Server offers several built-in tools such as Activity Monitor, sp_who2, and Dynamic Management Views (DMVs). During such critical moment, often these tools fall short to provide quick, accurate, and detailed insights.

To fill this gap, sp_WhoIsActive is emerged, which is opensource, lightweight, feature-rich, and incredibly efficient at showing what SQL Server is doing at any given moment. Thus, it becomes one of the most powerful diagnostic tools in a DBA’s toolkit.

In this series, I will cover installation, important output columns, diagnosing blocking, deadlocks, wait statistics, memory grants & TempDB usage, logging activity and advanced parameters. Let's start. [More]

DBA's Guide to Memory Grant

Memory grant is like a container for a query where it flourishes, sorts, joins and stores temporary result sets. Too small grant makes a query slow whereas too large suffers other queries. Understanding how SQL Server calculates memory grants, how to monitor them, and fix common issues are essential knowledge for every DBA. This guide breaks down the key concepts, shows how to identify problematic queries, and offers practical steps to troubleshoot and optimize memory grants in real workloads. Let's start. [More]

DBA's Guide to Analyze SOS_SCHEDULER_YIELD Wait Type

SOS_SCHEDULER_YIELD is a common wait type which often puzzles DBAs. It does not necessarily mean something is "problematic", rather it tells that SQL Server workers are voluntarily yielding the CPU to let other threads run. However, when this wait becomes dominant, it is usually a signal that the CPU is under pressure or certain queries are consuming more CPU cycles than they should.

In this guide, we will walk through what SOS_SCHEDULER_YIELD means, why it occurs, how to identify the queries contributing to it, and practical steps to mitigate CPU contention in your SQL Server environment. Let's start. [More]

DBA's Guide to Analyze WRITELOG wait type

WRITELOG is one of the common wait types found in the SQL Server. It is directly related to the speed and efficiency of writing transaction log stored in the file system. This ensures durability and data integrity. When WRITELOG waits are high, it usually indicates that SQL Server is spending too much time waiting for in-memory transaction log cache to be flushed to the transaction log file. This can slow down transactions and ripple across the entire workload. In this guide, we will explore what causes WRITELOG waits, how to identify the root bottlenecks, and practical ways to reduce their impact through configuration, hardware optimization, and workload tuning. [More]

DBA's Guide to Analyze Execution Plan

Execution Plan is like a blueprint. SQL Server uses it to execute a DML query. As a DBA, understanding execution plans is like reading the X-ray of query performance. It exposes where SQL Server spent its time and resources, which indexes used or ignored, and area of performance bottlenecks.

In this article, you will go through how to analyze SQL Server execution plans, interpret key operators, and identify optimization opportunities. [More]