180 likes | 308 Views
Explore the complexities of SQL query plans as Independent SQL Server Consultant Simon Sabin shares insights on common pitfalls like parameter sniffing, outdated statistics, and skewed data. Learn about best practices in database design, performance tuning, and how to maintain optimal query performance through strategies like plan guides and updating statistics. Benefit from Simon's extensive experience with SQL Server, and discover the importance of monitoring your systems for effective troubleshooting. Join the Q&A session for personalized guidance!
E N D
Simon Sabin • Independent SQL Server Consultant and Trainer • Database design and development, Business Intelligence, Performance tuning and troubleshooting • SQL Server since 6.5 • Email: Simon@onarc.com • Blog: http://Sqlblogcasts.com/blogs/simons • Twitter: simon_sabin
Out of date statistics Best Before: 1/4/1999
Solutions • Selective code paths • Careful as SP is compiled as one batch • WITH RECOMPILE • Compilation hit, plan cache bloat • OPTIMIZE FOR • Results in a consistent plan • PLAN guides • Results in a consistent plan
Update Statistics • Update Statistics • Can be a performance hit • Trace flag 2388, 2389 and 2390
Summary • You will only know if you monitor • Baseline your system • Identify changes in read, writes and cpu • Not duration • Consider the options for your situation • You can win this battle
Q&A • Now - Just ask • Afterwards – I’ll be around • Much Later • Simon@SQLKnowHow.com • @simon_sabin • http://sqlblogcasts.com/blogs/simonsabin Please fill in feedback forms