28-Query Processing-30-09-2024
28-Query Processing-30-09-2024
Π Lname,Fname (σSalary>c(EMPLOYEE))
Equivalence Rules
1. Conjunctive selection operations can be
deconstructed into a sequence of individual
selections.
This method mainly uses the statistics like record size, number of
records, number of records per block, number of blocks, table
size, whether whole table fits in a block, organization of tables,
uniqueness of column values, size of columns etc.
Cost difference between evaluation plans for a query can be
enormous
Steps in cost-based query optimization
Generate logically equivalent expressions using equivalence
rules
Annotate resultant expressions to get alternative query plans
Choose the cheapest plan based on estimated cost
Estimation of plan cost based on:
Statistical information about relations. Examples:
number of tuples, number of distinct values for an attribute
Statistics estimation for intermediate results
to compute cost of complex expressions
Cost formulae for algorithms, computed using statistics