Sql-Server

Category: sql-server

Perfmon: Batch Requests/sec counts whole batches, not statements

Perfmon: Batch Requests/sec counts whole batches, not statements

on May 16, 2017

Category: perfmon , sql-server

The name of the “SQL Statistics \ Batch Requests/sec” counter is confusing: exactly what is a request? The request is the WHOLE batch. See a demo of this counter in this quick 5 minute video.

Continue reading

Batch Mode Hacks for Rowstore Queries in SQL Server

Batch Mode Hacks for Rowstore Queries in SQL Server

What’s batch mode?

Batch mode was introduced as a way to help SQL Server process data from columnstore indexes faster. The whole idea with columnstore is that you pull big compressed sets of rows out for aggregation or other operations in big chunks.

Batch mode is a way that operators can work on a “batch” of up to 900 values at a time, instead of working on individual rows. Batch mode can reduce the overhead of metadata and make more efficient use of your CPUs.

Continue reading

Checking for the Existence of Global Temp Table in TSQL

Checking for the Existence of Global Temp Table in TSQL

Every now and again, I need use a global temporary table for some testing or demo code.

Each time I do, I stumble a little bit when it comes to checking for the existence of the global temp table, in order to make my code re-runnable.

Continue reading

Use Report View in Perfmon to Compare Database Counters (free video)

Use Report View in Perfmon to Compare Database Counters (free video)

on May 1, 2017

Category: perfmon , sql-server

Sometimes you need to compare lots of counters at once - for example, counters that report at the database level. This can be frustrating in “Line” view, but the “Report” view in perfmon makes life much simpler.

Continue reading

Error 1204: When SQL Server Runs Out of Locks

Error 1204: When SQL Server Runs Out of Locks

I recently did a Dear SQL DBA episode answering a question about lock timeouts and memory in SQL Server. I really enjoyed the episode, andΒ thought it would be fun to follow up and show what it looks like if SQL Server doesn’t have enough memory to allocate locks.

Continue reading

Run perfmon.exe /sys to Remember Your Counters in Windows Perfmon (free video)

Run perfmon.exe /sys to Remember Your Counters in Windows Perfmon (free video)

on April 24, 2017

Category: perfmon , sql-server

The problem: by default, the Performance Monitor application in Windows doesn’t remember which counters you like to use.

This can mean a lot of clicking every single time you open perfmon.

Continue reading

Trace Flag 4199: No Per-Session Override if You Enable it Globally

Trace Flag 4199: No Per-Session Override if You Enable it Globally

You can enable and disable trace flags either globally or per-session in SQL Server.

This makes it seem like perhaps if you enable optimization trace flag 4199 globally for all sessions, you might be able to disable it per-session.

But that’s NOT how it works.

Continue reading