Docsity

Algebra optimization, Sintesi del corso di Basi di Dati

Toggle sidebar
bg1
DATA BASES 1
ALGEBRA OPTIMIZATION
Algebraic Equivalence and Syntax Trees: Two algebraic expressions are equivalent if
they produce the exact same query result across all possible database instances1.
Relational algebra queries can be visually structured as syntax trees, which explicitly
represent the order in which operators are applied1.
Elimination of Cartesian Products: Selections applied over Cartesian products with
comparison predicates are transformed directly into Joins ($\bowtie$) to avoid
generating unnecessary Cartesian intermediate tables2.
Pushing Selections: Selection operations are pushed down the tree through joins,
unions, and differences as early as possible3more_horiz. Pushing selections filters out
tuples before performing expensive join or set operations36.
Pushing Projections: Projections are pushed down through joins and unions to discard
unneeded attributes early, reducing tuple sizes57. However, projection does not
commute with set difference ($-$) or set intersection ($\cap$)58.
Idempotence and Operator Rules: Idempotence rules for selections (splitting
conjunctive predicates) and projections enable deeper pushing of filters into separate
relational branches4more_horiz. Furthermore, joins distribute over set unions8.
Logical Predicate Simplification and Empty Sets: Expressions can be simplified
using logical predicate rules and set identities68. Contradictory predicates evaluate
directly to the empty set ($\emptyset$), allowing entire subtrees to be pruned610.
Core Optimization Objective: The primary goal of heuristic algebraic optimization is
to achieve the minimum execution cost, which informally translates to minimizing the
size of intermediate results at each node of the expression tree6.

Anteprima parziale del testo

Scarica Algebra optimization e più Sintesi del corso in PDF di Basi di Dati solo su Docsity!

DATA BASES 1

ALGEBRA OPTIMIZATION

Algebraic Equivalence and Syntax Trees: Two algebraic expressions are equivalent if they produce the exact same query result across all possible database instances1. Relational algebra queries can be visually structured as syntax trees , which explicitly represent the order in which operators are applied1.  Elimination of Cartesian Products: Selections applied over Cartesian products with comparison predicates are transformed directly into Joins ( $\bowtie$ ) to avoid generating unnecessary Cartesian intermediate tables2.  Pushing Selections: Selection operations are pushed down the tree through joins, unions, and differences as early as possible3more_horiz. Pushing selections filters out tuples before performing expensive join or set operations36.  Pushing Projections: Projections are pushed down through joins and unions to discard unneeded attributes early, reducing tuple sizes57. However, projection does not commute with set difference ($-$) or set intersection ($\cap$)58.  Idempotence and Operator Rules: Idempotence rules for selections (splitting conjunctive predicates) and projections enable deeper pushing of filters into separate relational branches4more_horiz. Furthermore, joins distribute over set unions8.  Logical Predicate Simplification and Empty Sets: Expressions can be simplified using logical predicate rules and set identities68. Contradictory predicates evaluate directly to the empty set ($\emptyset$), allowing entire subtrees to be pruned610.  Core Optimization Objective: The primary goal of heuristic algebraic optimization is to achieve the minimum execution cost , which informally translates to minimizing the size of intermediate results at each node of the expression tree6.