Category: Performance Tuning
-
SQL Server Implicit Conversion: How CONVERT_IMPLICIT Turns a Seek Into a Scan
The same lookup typed as varchar seeks 1 row; typed as nvarchar it scans 100,000. How to spot CONVERT_IMPLICIT in a plan and how to avoid it.
Written by
-
SQL Server MAXDOP and Cost Threshold: What To Set, and Why 5 Is Not a Recommendation
Two settings decide when SQL Server splits a query across processors, and both ship with values you are probably meant to change. Microsoft’s current MAXDOP table, what they actually say about cost threshold, and why CXPACKET is no longer the evidence it used to be.
Written by
-
DBA Scripts: Get Lock Escalation, Contention Analysis, and Blocking Chains with Plan
Three Different Views of the Same Underlying Problem Blocking Chains shows what’s blocked right now. These 3 scripts go wider and deeper: Get-LockEscalationStats finds which tables have converted row/page locks into full table locks (a common, self-inflicted cause of blocking), Get-ContentionAnalysis rolls up lock waits, latch waits, page latch waits and spinlock collisions into one…
Written by
-
DBA Scripts: Get Last DBCC CHECKDB
DBCC CHECKDB is the only thing that actually confirms a database’s data is structurally sound; backups only prove a database can be restored, not that what gets restored is undamaged. Skipping it, or letting it silently stop running, means corruption can sit undetected for weeks or months before anyone notices, often only when a query…
Written by
-
SQL Server Wait Types Library
Something on the server is slow and you need to know what it is waiting on. Pick what you are seeing below, or paste the wait name from your own output into the Wait Type Finder for its verdict. What Are You Seeing? Each symptom goes to the guide for the wait behind it, labelled…
Written by
-
DBA Scripts: Get Error Log Patterns
Group the Error Log Instead of Scrolling It The SQL Server error log is where the instance tells you what’s wrong, but on a busy server it’s also where hundreds of routine startup, backup, and checkpoint messages bury the handful of lines that actually matter. Scrolling xp_readerrorlog output looking for the one memory-pressure warning or…
Written by
-
DBA Scripts: Generate Collector Alerts
Alert on What Your Collectors Find Your collectors fill tables every few minutes and nobody reads them. Generate-CollectorAlertJob.sql writes one SQL Agent job that checks the latest collector data every 30 minutes, lists every CRITICAL and WARNING finding, and fails on any CRITICAL. Out of the box it tells nobody, so wire it up with…
Written by
-
DBA Scripts: Index Maintenance
Index problems rarely announce themselves. A missing index shows up as a slow query someone eventually complains about; a duplicate or unused one just sits there costing write overhead and storage with nothing to show for it; fragmentation quietly degrades range scans until someone happens to check. Seven scripts on this site cover the full…
Written by
-
DBA Scripts: Blocking and Locking
“The database is slow” and “the database is blocked” look identical from the outside, timeouts, a frozen application, users complaining, and the fix is completely different depending on which one it actually is. The scripts on this site cover a live incident end to end: finding the head blocker, tracing a multi-level chain, reading a…
Written by
-
DBA Scripts: Get Open Transactions
The Transaction Nobody Remembered to Close An open transaction that never commits or rolls back is one of the quietest ways SQL Server gets into trouble: it holds locks other sessions wait on, it stops the transaction log from truncating, and none of that shows up as an error anywhere, it just sits there until…
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)