Backup & Recovery from First Principles, Part 9: BUFFERCOUNT, MAXTRANSFERSIZE, and Friends – Benchmarked
The BACKUP statement has a set of tuning knobs most people never touch: BUFFERCOUNT, MAXTRANSFERSIZE, BLOCKSIZE, and striping across multiple files.[1] Advice about them tends to be folklore, so this post is numbers instead: nine…
Scalar UDFs vs Inline TVFs: Measuring the Damage
Scalar user-defined functions are the most natural thing in the world to write. You have a bit of logic, you wrap it in a function, you call it in your SELECT list, and your query…
Finding Eager Index Spools in the Plan Cache
Somewhere in your plan cache right now, there is probably a query quietly building an index every single time it runs. Not once. Every execution. It builds the index, uses it, and throws it away,…
Performance Counters Over Time: Making sys.dm_os_performance_counters Tell the Truth
Run this query on any SQL Server and look at the number it gives you for Batch Requests/sec:
|
1 2 3 4 5 6 7 |
SELECT [counter_name] , [cntr_value] FROM [sys].[dm_os_performance_counters] WHERE [counter_name] = N'Batch Requests/sec'; |
On a server that has been up for a few weeks you will get something like…
Lock Escalation, and Why You Shouldn’t Disable It!
Lock escalation affects every SQL Server database. Understanding when and why SQL Server escalates row-level locks to table locks and what you can do about it is essential knowledge for any DBA managing concurrent workloads.
Should I use (max) size for all my nvarchar/varchar columns?
Should you use VARCHAR(MAX) for all your string columns? No. Here’s why MAX costs you indexing, memory grants, and storage efficiency with demos you can run yourself.