4. Query Optimization Flashcards
Equivalence Rules 1
Conjunctive selection operations can be deconstructed into a
___ of individual ___
Sequence
Selections
Equivalence Rules 2
Selection operations are ___
Commutative
Equivalence Rules 3
Only the last in a sequence of ___ is needed, the others can be ___.
Projection operations
Omitted
Equivalence Rules 4
Selections can be combined with ___ and ___.
Cartesian products
Theta joins
Equivalence Rules 5
Theta-join operations (and natural joins) are ___.
Commutative
Equivalence Rules 6
Natural join operations are ___. Theta joins too in a special manner
(E1 ⨝[theta 12] E2) ⨝[theta 13 ^ theta 23] E3
≡ E1 ⨝[theta 12 ^ theta 13] (E2 ⨝[theta 23] E3)
Associative
Equivalence Rules 7
The selection operation distributes over the theta join operation under the following two conditions
a) sigma_theta 1 (E1 ⨝_theta E2)
≡ (sigma_theta 1 (E1)) ⨝_theta E2
b) sigma_[theta 1 ^ theta 2] (E1 ⨝_theta E2)
≡ (sigma_theta 1 (E1)) ⨝_theta E2 (sigma_theta 2 (E2))
…
Equivalence Rules 8
produtorio_[L1 U L2] (E1 ⨝_theta E2)
≡ produtorio_L1 (E1) ⨝ produtorio_L2 (E2)
…
Equivalence Rules 9/10/11
The set of operations Union and Intersection are ___ and ___. Also they distribute over ___, ___ and ___
Commutative
Associative
U, Inverse U and -
Equivalence Rules 12
The Projection Operation distributes over ___
Union
Equi-depth histograms break up range such that each range has (approximately) ___
The same number of tuples
Size Estimation for Selection
a) If the selection of atribute A equal to value v in relation then size estimate is equal to ___
b) If A <=v then c=___ if v= max(A,r)
c) c is assumed to be ___ in the absence of statistical information
1
0
nr
nr/2
Size Estimation for Join a) if every tuple t in R procuces tuples in R ⨝ S \_\_\_ b) If the reverse is true \_\_\_ Choose the lowest of this estimates
nr * ns / V(A,s) [distinct values of A in s]
nr * ns / V(A,r)
Size Estimation for Projection produtorio A (r) = \_\_\_
V(A,r)
Cost-Based Optimization
Instead of generating all ___ find the best join order for every __ by finding the best order for ___ recursively
Join orders
Subset
Each subset of every subset