Sql-Server

Category: sql-server

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

Selectively EnableTrace Flag 4199 and QUERY_OPTIMIZER_HOTFIXES in SQL Server 2016

Selectively EnableTrace Flag 4199 and QUERY_OPTIMIZER_HOTFIXES in SQL Server 2016

Trace Flag 4199 has been in SQL Server for a while. I’ve long thought of this as the “Bucket of Optimizer Hotfixes” trace flag: enabling it turns on a variety of hotfixes that have been implemented over the years.

Continue reading

Which Locks Count Toward Lock Escalation?

Which Locks Count Toward Lock Escalation?

A little while back I wrote about Why Indexes Reduce Locks for Update and Delete Queries.

I got a great question on the post from Zac:

What’s not super clear is why it takes out a lock on the whole table, is this because it does a lock escalation as a result of the Full Scan? Will this always happen, or is there a threshold of record update counts where this will occur?

This was tough to answer in just a comment, so I promised a full post on the topic.

Continue reading

The Case of the Blocking Online Index Create- the Shared Lock that Would Not Quit

The Case of the Blocking Online Index Create- the Shared Lock that Would Not Quit

on March 28, 2017

I recently got an interesting question from a reader about running a CREATE INDEX statement with DROP_EXISTING

Continue reading