SQL Server execution plan showing a Sort operator spilling to TempDB

TempDB Spill: The Silent Server Killer

Perfect index. Solid execution plan. You’ve reviewed the query line by line. And yet, sometimes everything crashes. If all basic metrics look normal… no CPU spikes, no memory pressure, no network bottleneck. You may be a spill-to-TempDB victim. Ok, but what is a TempDB spill? Some SQL Server operations, like Sort (especially with geospatial queries - my experience) and Hash Match, require memory. Before running a query, SQL Server estimates how much memory it needs. ...

August 18, 2026 · 3 min · 560 words · Eduardo Potumati
A code snippet illustrating the syntax for BULK INSERT in SQL Server

How to Insert Millions of Records into SQL Server

If you’re trying to insert millions of rows using INSERT in a loop, you’re doing it wrong. A few days ago, I was asked about it. It’s funny how a tool you use usually can slip our mind. Anyway, BULK INSERT is one of the most efficient ways to load large datasets into SQL Server. It can increase the insertion speed by up to 10x to 50x, which means that it can significantly reduce the time required for the operation. ...

April 10, 2025 · 3 min · 468 words · Eduardo Potumati