1 / 15

Database Tuning Principles, Experiments and Troubleshooting Techniques

Database Tuning Principles, Experiments and Troubleshooting Techniques. Baseado nos slides do tutorial com o mesmo nome da autoria de: Dennis Shasha (shasha@cs.nyu.edu) Philippe Bonnet (bonnet@diku.dk) E nos slides disponíveis no Web site do livro: http://www.databasetuning.org/.

kiaria
Download Presentation

Database Tuning Principles, Experiments and Troubleshooting Techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database TuningPrinciples, Experiments and Troubleshooting Techniques Baseado nos slides do tutorial com o mesmo nome da autoria de: Dennis Shasha (shasha@cs.nyu.edu) Philippe Bonnet (bonnet@diku.dk) E nos slides disponíveis no Web site do livro: http://www.databasetuning.org/

  2. Introduction

  3. What is Database Tuning? Activity of making a database application runfaster:– Faster means higher throughput (or responsetime)– Avoiding transactions that create bottlenecks oravoiding queries that run for hoursunnecessarily is a must. – A 5% improvement is significant. H. Galhardas

  4. Why Database Tuning? • Troubleshooting: • Make managers and users happy given anapplication and a DBMS • Capacity Sizing: • Buy the right DBMS given applicationrequirements • Application Programming: • Coding your application for performance H. Galhardas

  5. The following query runs too slowly select * from R where R.a > 5; What do you do? Why is Database Tuning hard? sql commands PARSEROPTIMIZER EXECUTIONSUBSYSTEM DISKSYBSYSTEM LOCKINGSUBSYSTEM CACHEMANAGER LOGGINGSUBSYSTEM MEMORY CPU DISK/CONTROLLER NETWORK H. Galhardas

  6. ApplicationProgrammer(e.g., business analyst, Data architect) Application SophisticatedApplicationProgrammer(e.g., SAP admin) QueryProcessor Indexes Storage Subsystem Concurrency Control Recovery DBA,Tuner Operating System Hardware[Processor(s), Disk(s), Memory] H. Galhardas

  7. Course Objectives • Relevant notions concerning the internals ofcommercial DBMS • Tuning Principles • Backed by experiments : How do tuning principlesimpact performances on my system? • Troubleshooting Methodology: • Troubleshooting (what is happening?) • Hypothesis formulation • What is the cause of the problem? • Apply tuning principles to propose a fix • Hypothesis verification (experiments) H. Galhardas

  8. Outline • Basic Principles • Tuning the guts • Concurrency control and recovery • OS configuration • HW modifications • Indexes • Relational Systems • Design of table schema, normalization, etc • Query tuning • Application Interface • Ecommerce Applications • Data warehouse Applications • Distributed Applications • Troubleshooting H. Galhardas

  9. Tuning Principles • Think globally, fix locally • Partitioning breaks bottlenecks • temporal and spatial • Start-up costs are high; running costs are low • Render unto server what is due unto server • Be prepared for trade-offs H. Galhardas

  10. Think globally, fix locally • Proper identification of problem; minimal intervention • Understand the whole, including the application goals before taking a set of queries and find the indexes that speed them up. • Example: • High I/O, paging and processor utilization may be due to frequent query scans instead of using an index or log sharing a disk with some frequently accessed data. H. Galhardas

  11. Partitioning breaks bottlenecks • Technique for reducing the load on a certain component of the system either by dividing the load over more resources or by spreading the load over time • Partitioning may not always solve bottleneck: • First, try to speed up the component • If it doesn’t work, partition • Example: • Lock and resource contention among long and short transactions H. Galhardas

  12. Start-up costs are high; running costs are low • Obtain the effect you want with the fewest possible start-ups • Examples: • It is expensive to begin a read operation on a disk, but once it starts disk can deliver data at high speed. • So, frequently scanned tables should be laid out consecutively on disk. • Cost of parsing, semantic analysis, and selecting access paths for simple queries is significant • So, often executed queries should be compiled H. Galhardas

  13. Render unto server what is due unto server • Important design question is the allocation of work between the DB system (server) and the application program (client) • Depends on: • Relative computing resources of client and server • Where the relevant information is located • Whether the DB task interacts with the screen H. Galhardas

  14. Be prepared for trade-offs • Increasing speed of application requires combination of memory, disk and computational resources • Examples: • Adding an index => speeds up critical query, but increases disk storage, and space in RAM • Increasing RAM => Decreasing I/O, speed up query, but spending more money H. Galhardas

  15. Outline • Basic Principles • Tuning the guts • Concurrency control and recovery • OS configuration • HW modifications • Indexes • Relational Systems • Design of table schema, normalization, etc • Query tuning • Application Interface • Ecommerce Applications • Data warehouse Applications • Distributed Applications • Troubleshooting H. Galhardas

More Related