Database Tuning Principles, Experiments and Troubleshooting ...


Published on

  • Be the first to comment

  • Be the first to like this

Database Tuning Principles, Experiments and Troubleshooting ...

  1. 1. CS 5226: Database Administration and Performance Tuning
  2. 2. Course Structure <ul><li>Continuous Assessment: 50% </li></ul><ul><ul><li>Assignments: 25% </li></ul></ul><ul><ul><li>Lab Sessions: 25% </li></ul></ul><ul><li>Lecturers: </li></ul><ul><ul><li>Prof. Ooi Beng Chin (ooibc) </li></ul></ul><ul><ul><li>DBAs: Sze Eng Koon and Phillip Lim </li></ul></ul>
  3. 3. Text/Reference Books: <ul><li>Dennis Shasha and Phillipe Bonnet: Database Tuning : Principles Experiments and Troubleshooting Techniques. Morgan Kaufmann Publishers. 2002 (released in June 2002). TEXT . </li></ul><ul><li>Dennis Shasha: Database tuning : a principled approach. Prentice Hall, 1992. REFERENCE (a good reference if cannot get the text book) </li></ul><ul><li>Database Management Systems, 3 rd edition. Raghu Ramakrishnan & Johannes Gehrke, McGraw-Hill, 2002. </li></ul><ul><li>Hector Garcia-Molina, Jeffrey D. Ullman, and Jennifer Widom: Database Systems -- The Complete Book. Prentice Hall, 2001. </li></ul><ul><li>G. J. Vaidyanatha, K. Deshpande and J. Kostelac: Oracle Performance Tuning 101. Osborne/Mc-Graw-Hill. 2001. REFERENCE. </li></ul><ul><li>Jim Gray (ed): The Benchmark handbook : for database and transaction processing systems. M. Kaufmann Publishers, 1991. REFERENCE. </li></ul>
  4. 4. Copyright: Many slides belong to the tutorial: Database Tuning Principles, Experiments and Troubleshooting Techniques Dennis Shasha ( Philippe Bonnet ( [email_address] ) And lecture notes provided by Database Management Systems , 3 rd edition. Raghu Ramakrishnan & Johannes Gehrke McGraw-Hill, 2002. and some from the web …
  5. 5. Database Tuning <ul><li>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. </li></ul>
  6. 6. Application Programmer (e.g., business analyst, Data architect) Sophisticated Application Programmer (e.g., SAP admin) DBA, Tuner Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency Control Recovery Storage Subsystem Indexes Query Processor Application
  7. 7. Goals of the Course <ul><li>Appreciation of DBMS architecture </li></ul><ul><li>Study the effect of various components on the performance of the systems </li></ul><ul><li>Tuning principles </li></ul><ul><li>Troubleshooting techniques for chasing down performance problems </li></ul><ul><li>Hands-on experience in Tuning </li></ul>
  8. 8. Contents <ul><li>Basic Principles </li></ul><ul><li>Tuning the guts </li></ul><ul><li>Indexes </li></ul><ul><li>Relational Systems </li></ul><ul><li>Application Interface </li></ul><ul><li>E-commerce Applications </li></ul><ul><li>Data warehouse Applications </li></ul><ul><li>Distributed Applications </li></ul><ul><li>Troubleshooting </li></ul>
  9. 9. Tuning Principles <ul><li>Think globally, fix locally </li></ul><ul><ul><li>Localizing the problems </li></ul></ul><ul><li>Partitioning breaks bottlenecks (temporal and spatial) </li></ul><ul><ul><li>ONE part of the system limits the the overall performance </li></ul></ul><ul><ul><li>Two approaches: </li></ul></ul><ul><ul><ul><li>Fix locally </li></ul></ul></ul><ul><ul><ul><li>Partitioning the LOAD </li></ul></ul></ul><ul><ul><ul><ul><li>eg. Free list, lock contention due to long transactions </li></ul></ul></ul></ul><ul><li>Partitioning in space/logical resources/time </li></ul>
  10. 10. Tuning Principles <ul><li>Start-up costs are high; running costs are low </li></ul><ul><ul><li>Start-up costs include </li></ul></ul><ul><ul><ul><li>Disk access </li></ul></ul></ul><ul><ul><ul><li>Data transfer </li></ul></ul></ul><ul><ul><ul><li>Query processing </li></ul></ul></ul><ul><ul><ul><li>System calls </li></ul></ul></ul><ul><ul><li>Reduce the number of start-ups </li></ul></ul>
  11. 11. An example: Time = Seek Time + Rotational Delay + Transfer Time + Other Rule of Random I/O: Expensive Thumb Sequential I/O: Much less <ul><li>Ex: 1 KB Block </li></ul><ul><ul><ul><ul><ul><li>Random I/O:  20 ms. </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Sequential I/O:  1 ms. </li></ul></ul></ul></ul></ul>
  12. 12. Tuning Principles <ul><li>Render onto server what is due onto Server </li></ul><ul><ul><li>Task allocation between the server and the application programs </li></ul></ul><ul><ul><li>Factors: </li></ul></ul><ul><ul><ul><li>Relative computing resources of client, application servers and data server </li></ul></ul></ul><ul><ul><ul><ul><li>Should checking be done in the middle tier? </li></ul></ul></ul></ul><ul><ul><ul><li>Location of information </li></ul></ul></ul><ul><ul><ul><li>The nature of tasks: interaction with screen? </li></ul></ul></ul>
  13. 13. Tuning Principles <ul><li>Be prepared for trade-offs </li></ul><ul><li>Ex. Indices </li></ul>
  14. 14. Tuning Mindset <ul><li>Set reasonable performance tuning goals </li></ul><ul><li>Measure and document current performance </li></ul><ul><li>Identify current system performance bottleneck </li></ul><ul><li>Identify current OS bottleneck </li></ul><ul><li>Tune the required components eg: application, DB, I/O, contention, OS etc </li></ul><ul><li>Track and exercise change-control procedures </li></ul><ul><li>Measure and document current performance </li></ul><ul><li>Repeat step 3 through 7 until the goal is met </li></ul>