In SQL Server, performance issues are usually the result of waiting. It is not due to CPU or memory shortages. Every query, at some point, waits for resources like CPU, disk I/O, locks, or memory. The real challenge for a DBA is identifying which wait actually matters. While SQL Server provides DMVs like sys.dm_os_wait_stats, they show aggregated data. What we often need instead is a real-time view of waits at the session level. In this part, we will explore how to use sp_WhoIsActive to identify top waits those really matters. Let's start.
[More]
In my team, there are three types of people.
One group is always excited about new things—latest devices, new OS versions, new tools, or AI models. The moment a new SQL Server version is released, their first question is, "When are we upgrading?"
Another group prefers stability over everything. Their philosophy is simple: "If something works, do not touch it until it breaks."
And then third group is quiet observers, who usually support others.
So whenever the topic of SQL Server migration or version update comes up, it turns into a familiar dilemma—should we move forward or stay with older version?
Over time, I have realized that this is not just a team discussion. It is a common challenge for every DBA, and the answer requires more than just preference or instinct.
[More]
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]
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]
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]
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]
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]
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]
Below query will reset the Index Usage, Wait Types, and Plan cache
[More]
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]