ZHAW-Logo OAPA-Logo TAT-Logo
zurück  
Diplomarbeit 2004 (DA04): Arbeits-Archiv
 
DA Adr 04/2 - Optimizing (tuning) of DB-Queries
Studierende: Lukas Felder, feldeluk
  Thomas Mattmuller, mattmtho

Betreuer: Arnold Aders, adrs

The topic of our undergraduate dissertation at the Zurich University of Applied Sciences Winterthur was the optimization of database queries. The theoretical part is divided into two sections. The first is an overview of how an optimizer operates. In the second part we explain what different kinds of indexes exist. In the practical part of our work we measured the execution times of different queries. Oracle 9i and IBM DB2 v7 were the Database Management Systems used. At first we created three different tables of the same size. In a later stage we used three tables of different sizes. The values in the tables are randomly created integers and have no key-foreignkey-relationship. We used a query with two joins for our tests. With the creation of indexes and usage of different optimizer-modes, we tried to accelerate the query. During those tests we made several interesting discoveries. Oracle Oracle has two different optimizer-modes: Costbased and rulebased. If the tables are large and have indexes, the costbased optimizer has no advantages over the rulebased optimizer, which does not use any statistics. If the rulebased optimizer is chosen, the order of the query must be considered, even though that is against the rules of relational algebra. IBM DB2 IBM?s DB2 has seven different optimization classes, where every class has a different amount of optimization. That makes it difficult to know which class is best for a particular query. In general, optimization class 5 (default) is the fastest, if there are no statistics or indexes. The costs in the explain plans of both databases don?t help while optimizing, because there is no connection between the cost and the actual execution time. In most cases the plan with the higher costs was faster.

zurück