Database Performance and Tuning
Database Performance and Tuning
Database Performance and Tuning
Performance Tuning
1
Text/Reference Books:
• Dennis Shasha and Phillipe Bonnet: Database Tuning : Principles
Experiments and Troubleshooting Techniques. Morgan Kaufmann
Publishers. 2002 (released in June 2002). TEXT.
• Dennis Shasha: Database tuning : a principled approach. Prentice Hall,
1992. REFERENCE (a good reference if cannot get the text book)
• Database Management Systems, 3rd edition. Raghu Ramakrishnan &
Johannes Gehrke, McGraw-Hill, 2002.
• Hector Garcia-Molina, Jeffrey D. Ullman, and Jennifer Widom:
Database Systems -- The Complete Book. Prentice Hall, 2001.
• G. J. Vaidyanatha, K. Deshpande and J. Kostelac: Oracle Performance
Tuning 101. Osborne/Mc-Graw-Hill. 2001. REFERENCE.
• Jim Gray (ed): The Benchmark handbook : for database and
transaction processing systems. M. Kaufmann Publishers, 1991.
REFERENCE.
2
Database Tuning
Database Tuning is the activity of making a
database application run more quickly.
“More quickly” usually means higher
throughput, though it may mean lower
response time for time-critical applications.
3
Application
Programmer
(e.g., business analyst,
Data architect)
Application
Sophisticated
Application Query Processor
Programmer
(e.g., SAP admin)
Indexes Storage Subsystem
Hardware
[Processor(s), Disk(s), Memory] 4
Goals of the Course
• Appreciation of DBMS architecture
• Study the effect of various components on
the performance of the systems
• Tuning principles
• Troubleshooting techniques for chasing
down performance problems
• Hands-on experience in Tuning
5
Contents
1. Basic Principles
2. Tuning the guts
3. Indexes
4. Relational Systems
5. Application Interface
6. E-commerce Applications
7. Data warehouse Applications
8. Distributed Applications
9. Troubleshooting
6
Tuning Principles
• Think globally, fix locally
– Localizing the problems
• Partitioning breaks bottlenecks (temporal and spatial)
– ONE part of the system limits the the overall performance
– Two approaches:
• Fix locally
• Partitioning the LOAD
– eg. Free list, lock contention due to long transactions
7
Tuning Principles
• Start-up costs are high; running costs are
low
– Start-up costs include
• Disk access
• Data transfer
• Query processing
• System calls
– Reduce the number of start-ups
8
An example:
11
Tuning Mindset
1. Set reasonable performance tuning goals
2. Measure and document current performance
3. Identify current system performance bottleneck
4. Identify current OS bottleneck
5. Tune the required components eg: application, DB,
I/O, contention, OS etc
6. Track and exercise change-control procedures
7. Measure and document current performance
8. Repeat step 3 through 7 until the goal is met
12