Concurrency• Derby optimizers poor design is its main drawback, which executes serially• Uses two while loops to iterate through each join order, and access path per each order o getNextPermutation() o getNextDecoratedPermutation() o costPermutation()• As easy approach: Use loop-parellel programming pattern.• Make each iteration independent and execute each iteration in new threads.
Bushy Trees• Left deep trees & Bushy trees• More flexibility in query plan generation• Has a large search space• Best plan may be bushy
Bushy Trees contd.More than half of the queries have bettersolutions in the bushy tree solution space M. Steinbrunn, et. al. 1997. Heuristic and randomized optimization for the join ordering problem
Randomized Algorithms• Deterministic - Start from base relations and build plans by adding one relation at each step• Randomized - Search for optimal solutions around a particular starting point• Trade optimization time for execution time• No guarantee of the best solution• Useful for joins with a high number of relations
Heuristics For TimeoutnImprovements• Consequence of a miserable timeout value• Time wasted for generation of numerous plans + estimating their costs• Applicability of optimal solution over sub- optimal• Heuristic based values for timeout• Improvement over time
Genetic Algorithms• Genetic?• Used by PostgreSQL• Evolution o Removal of least fit individuals o Recombination of individuals of high fitness• Initial population: query plans with possible join orders• Fitness function: to minimize cost• Lower cost join sequence has higher fitness