Tag: Query Tuning
-
Parameter Sniffing in SQL Server: A Measured Example, Not Just the Theory
⚡Compare estimated rows with actual rows before you change anything. A big, consistent gap on one operator, in a plan compiled for a different parameter value, is sniffing (the check). Fix that statement, not the server: OPTION (RECOMPILE) on the one statement, or force the good plan with Query Store. A stored procedure that is…
Written by
-
Table Variables vs Temp Tables in SQL Server: What the Optimizer Actually Sees
The usual line on table variables vs temp tables is “table variables don’t have statistics, so the optimizer assumes 1 row.” That was true once. It isn’t the whole story on a current SQL Server, and the actual gap between what the optimizer assumes and what’s really there is worth measuring rather than repeating from…
Written by
Major pillars
Quick scripts
Patch week
Health check & AI
Script areas
Latest posts
- 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)
Browse by topic
- 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)