240 likes | 464 Views
SQL Server Performance Tuning. ABOUT ME. Aditya Badramraju Twitter: http://twitter.com/@aditya_feb22 Blog: http://adityabadramraju.wordpress.com. Agenda. SQL Server Performance Tuning Overview CPU Input/output Memory Conclusion. Slow Performance !!! . U DBA!!
E N D
ABOUT ME AdityaBadramraju Twitter: http://twitter.com/@aditya_feb22 Blog: http://adityabadramraju.wordpress.com
Agenda • SQL Server Performance Tuning Overview • CPU • Input/output • Memory • Conclusion
Slow Performance !!! U DBA!! I want application run in rocket speed
Get the victim!! The victim for performance majorly lies in any of these areas • CPU • IO • Memory • Temp DB Bottle Necks • Poor Indexing ,query writing and maintenance
CPU • Check the Task Manager • Check Perfmon Counters • If SQL Server is responsible for high CPU find the session which is consuming the CPU • Dig in to details of the sessions • Find the CPU costing queries • If the environment is OLTP beware of MAXDOP
IO • DMV sys.dm_os_wait_stats is the best thing which says you are at IO crunch • Perfmon counters such as Diskreads/Sec, Diskwrites/Sec, IO queue also gives clear picture in this front. • When you found IO as culprit • Spread the data into different drives • Check the queries which costs high Logical IO • Check for DISK Defragmentation and Index Fragmentation
Memory • We can get the very first glance of it through Task Manager • Perfmon Counters like Page Life Expectancy, Buffer Cache Hit Ratio, Memory Grants Pending, Free Pages • Page file configuration on the server • Adhoc Queries • Poor Query Writing • Incorrect Memory Settings • Lock of Memory Pages in 32 Bit System.
TEMPDB Bottle Necks • Its used more than What we normally think • It is responsible for all Sorts, Hashes, DBCC, Index Rebuilds and more. • The bottle necks of TEMPDB are due to • Incorrect tempdb configuration • Incorrect usage of temporary variables • Unnecessary Sorts on major tables etc.
Poor Indexing and maintenance • The above said problems are inter related and basic problems will be • Poor Query writing like using joins(Not appropriately of course ),Cursors, triggers etc. • Having huge index fragmentation and huge page density • No update for statistics • And lastly not having a Dedicated DBA (ATLAST I HAVE SAID THAT )!!!!
Acknowledgements • Paul Randal –SQL SKILLS • Adam Machanic-Microsoft • SQL Server Internals by Kalen • Pinal Dave –SQL Authority • SQL PASS and all SQL Organizations
LAST WORD I like to MAD and U??? ……