chapter 3 [ B ] Flashcards
(36 cards)
horizontal fragmentation is defined by a selection operation on the _______ of a database schema.
owner relations
A horizontal fragment Ri of relation R consists of all the tuples of R that satisfy a minterm predicate mi.
true
given a set of minterm predicates M, how many horizontal fragments of relation R are there?
same number as the minterm predicates.
set of horizontal fragments is aka _______ ?
minterm fragments.
An important aspect of simple predicates is their _____ and ______ ?
completeness and their minimality
Explain Completeness of predicates?
a set of predicates is considered complete if it can address all access patterns / queries under which tuples from the fragmented relations may need to be accessed.
What is The reason completeness is a desired?
- Fragments are logically uniform
- Fragments are statistically homogeneous in the way applications access them.
______ results in a balanced workload across all the fragments.
Completness
Explain minimality.
means that we only include the essential predicates that impact how we break down a dataset into fragments.
- if a predicate causes a fragment f to be further fragmented into, say, fi and fj, then there should be at least one application that accesses fi and fj differently.
If all the predicates of a set Pr are relevant, Pr is minimal
True
_______ is An iterative algorithm that would generate a complete and minimal set of predicates Pr’ given a set of simple predicates Pr.
COM-MIN
Write down COM-MIN algorithm.
- Input: Set of simple predicates Pr
- Output: Complete & minimal set of predicates Pr’
- Initialize Pr’ as an empty set.
- For each simple predicate p in Pr:
a. Add p to Pr’. - For each pair of distinct minterm predicates mi, mj in Pr’a. Check if mi and mj are identical in their
definitions except for one simple predicate pib. If pi is relevant, Keep both mi and mj in Pr’
c. If pi is not relevant, Remove the less relevant
predicate - Repeat steps 3 until no further changes can be made to Pr’.
- Output Pr’ as the complete and minimal set of predicates.
reduction of minterms can be achieved by _____ ?
eliminating minterms that might be contradictory to a set of implications I.
Give an example of contradicting minterm elimination.
- We have an attribute ‘att’ that can take on values from a set {value_1, value_2}.
Implication
- i1: If ‘att’ is ‘value_1’, then it can’t be ‘value_2’.
- i2: If ‘att’ is not ‘value_1’, then it must be ‘value_2’.
minterms
- m1: (att = value_1) AND (att = value_2)
- m2: ¬(att = value_1) AND (att = value_2)
- m3: (att = value_1) AND ¬(att = value_2)
- m4: ¬(att = value_1) AND ¬(att = value_2)
—> minterm predicates m1 and m4 are contradictory to the implications I
Explain the PHORIZONTAL Algorithm?
Input
- Relation R: Table to be horizontally fragmented.
- Pr: The set of simple predicates
Steps
- Initialize empty set Fragments
- For each simple predicate p in Pra. Create a fragment Fi
- consists of the rows that satisfy the simple
predicate p.
- p is “age > 30,” Fi will contain all rows where
the age is greater than 30. - Add Fi to the Fragments set
- Repeat steps 2-3 for all predicates in Pr
- Output Fragments
Given these Scenarios:
- Employee records are managed in two places.
- One handles records of those with salaries less than or equal to $30,000.
- The other handles records of those who earn more than $30,000.
Workout the :
- Simple Predicates
- Application of COM_MIN Algorithm &
- Minterm Predicates
- Simple Predicates
- p1: Salary is less than or equal to $30,000.
- p2: Salary is more than $30,000. - Application of COM_MIN Algorithm
- Initial Set: Pr = {p1, p2}.
- Iteration 1 (i=1): Applying COM_MIN with i=1 results
in Pr’ = {p1}.
This is complete and minimal since p2 would not
partition f1 ( fragment due to p1 ) - Minterm Predicates:
- m1: Salary < $30,000.
- m2: Salary > $30,000.
Explain Derived Horizontal Fragmentation.
- Derived Horizontal Fragmentation is a way of dividing data based on a selection operation specified on the owner of a link.
- There’s a link (L), has an owner relation and a member relation
Give Example of vertical fragmentation using Engineers’ Salaries.
- Consider a link L1 where owner(L1) = PAY and member(L1) = EMP.
- Group engineers into two categories based on salary: those making <= $30,000 and those making > $30,000.
- RESULT : 2 tables with column ENO, ENAME, TITLE
a vertical fragmentation of a relation R, produces fragments that contain a subset of R’s attributes as well as the primary key of R.
True
What is meant by an “optimal” fragmentation
Reducing the overall computational load since it :
- Helps in handling user queries with smaller relations, leading to fewer page accesses.
- Identifying and placing the most “active” sub- relations in a faster memory subsystem can enhance performance.
What are the heuristic approaches [ rule of thumb ] for Vertical fragmentation?
- Grouping
- Splitting:
Explain the Grouping heuristic approach for the vertical fragmentation
Initially assigns each attribute to one fragment then Joins fragments until certain criteria are met.
_______ approach fits more naturally within the top-down design methodology
Grouping
Explain the Splitting heuristic approach for the vertical fragmentation.
Starts with a relation and decides partitioning based on application access behavior