Chapter 5
Chapter 5
Chapter 5
2. Optimization
3. evaluation
Query optimization module work with the join manager module
to improve the order in which joins are performed. At this stage the
cost model and several other estimation formulas are used to
rewrite the query.
• This action plans are converted into a query codes that are finally
executed by a run time database processor.
• The run time database processor estimate the cost of each action
plan and chose the optimal one for the execution.
Query Analysis
Generating and saving temporary files on disk is time consuming and expensive.
Alternative:
Pipeline the data through multiple operations - pass the result of a previous
operator to the next without waiting to complete the previous operation.
Parallel query processing
Parallel query processing can improve the performance of the following types of
queries: select statements that scan large numbers of pages but return
relatively few rows, such as: Table scans or clustered index scans with grouped
or ungrouped aggregates.
Query Trees and Heuristics for
Query Optimization
A Query Tree is a tree data structure that corresponds expression. A Query
Tree is also called a relational algebra tree.
Leaf node of the tree, representing the base input relations of the query.
SQL
2. Query execution methodology
The steps that one goes through in executing high-level user queries.
Primary Index
If the column is unique (like a primary key, for example) then the database
index can be implemented as a hash table. Such an index on the EmpID
column would allow the database developer to hash directly to the correct
employee record in constant time.
In general, static and linear hashes have a cost of C = 1.
Oracle query optimizer
The oracle query Optimizer determines the most efficient execution
plan for each SQL statement based on the structure of the query, the
available statistical information about the underlying objects, and all the
relevant optimizer and execution features.