Chapter 9
Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance
DB performance Five factors –Workload – combination of online transactions, batch jobs, ad hoc queries, datawarehousing analysis and system –Throughput – overall capability of the computer to process data –Resources – hardware and software tools at the disposal of the system
Performance continued –Optimization – to optimize such things as queries, SQL formulation, database parameters –Contention – condition where two or more components of the workload are attempting to use a single resources in a conflicting way (dual updates to same piece of data, etc.)
Poor performance Table scans Lack of appropriate indexes Improper indexing choices Not using the available indexes Outdated database statistics Tables joined in a suboptimal order
Poor Performance continued Application joins instead of more efficient SQL joins Improper join method (nested loops, etc.) Efficient SQL inside of inefficient application code (loops)
Poor performance continued Inefficient subquery formulation (exists, not exists, etc.) Unnecessary sorting
80/20 Rule Pareto Principle –80% o the results come from 20% of the effort –DBA should concentrate on the most likely causes of performance problems first, because he will receive a high return on his tuning investment
Other potential problems Memory allocation (buffer/cache) Logging options (log cache, log size, rollback statements) I/O efficiency (separation of tables and indexes on disk, database size, fragmented and extended files)
Problems continued Overall application & database workload on server Database schema definitions
Performance Management Three specific components –Monitoring – scanning the environment, reviewing the output of instrumentation facilities, and watching the system as it runs (identifies problems) –Analysis – looking at what was collected from monitoring – done by DBA or others
Performance continued –Optimization – corrective action; some may be done automatically by the system, others are generated
Management Reactive performance management –Planning for the unplanned performance problems –Manual –Time consuming
Management continued Proactive performance management –Combined forethought, planning and automation to minimize reactive monitoring and tuning –Reduces amount of time, effort and human error
Life Cycle Life cycle needs to be monitored from the beginning Problems caught earlier on are less costly and easier to fix
Historical Trending Capturing and analyzing resource usage trends and performance statistics over time Predict needs for hardware upgrades Track key performance statistics (put in tracker tables)
Service Level Management Disciplined, proactive methodology and procedures used to ensure that adequate levels of service are delivered to all IT users at acceptable costs –Problems with silos
Performance Tuning System tuning Database tuning Application tuning
Tuning tools Performance monitors –Realtime, near time (intervals) and trends Performance estimation tools Capacity planning tools –Includes what if scenarios
Tools continued SQL analysis and tuning tools Advisory tools Systems analysis and tuning tools
Database tuning tools Reorganization tools (rebuild) Compression tools Sorting tools
Performance Basics Do not over-tune Remain focused Do not panic Communicate clearly Accept reality