Fragmentation
Fragmentation
Fragmentation:
• It is the task of dividing a table into a set of smaller tables. The
subsets of the table are called fragments.
• These fragments are stored at different location.
• These fragments process should be carried out in such a way
that the reconstruction of single database.
• Fragmentation should be done in a way so that the original table
can be reconstructed from the fragments. This is needed so that
the original table can be reconstructed from the fragments
whenever required. This requirement is called “re-
constructiveness.”
• Fragmentation can be of three types:
1. Horizontal Fragmentation
• Primary horizontal fragmentation
• Derived horizontal fragmentation
•
2. Vertical Fragmentation
3. Hybrid Fragmentation (combination of horizontal and
vertical).
Advantages:
1. Permits a number of transactions to executed concurrently
2. Results in parallel execution of a single query
3. Increases level of concurrency.
4. Increased System throughput.
5. Since data is stored close to the site of usage
6. Efficiency of the database system is increased.
7. Local query optimization techniques are sufficient for most
queries since data is locally available.
8. Since irrelevant data is not available at the sites, security and
privacy of the database system can be maintained.
Disadvantages
1. When data from different fragments are required, the access
speeds may be very high.
2. In case of recursive fragmentations, the job of reconstruction
will need expensive techniques.
3. Lack of back-up copies of data in different sites may render the
database ineffective in case of failure of a site.
1: Horizontal Fragmentation:
• Horizontal fragmentations are partition of a table along its tuples is
performed based on some Predicate/Condition.
• Consists of a subset of the tuple (row) of a relation.
• Defined using Selection Operation of relational Algebra.
• σ prediction ®
• F1= σ city =’Lahore’ (Employee)
• F2= σ city =’Karachi’ (Employee)
F1
F2
F3
• Select *
Into employee1
From employee
Where city= ‘Multan’
Note: Create a fragment by name of employee1
For View:
Select * from employee1
(Show only those tuples contain Multan)
• Select *
Into employee2
From employee
Where city= ‘Lahore’
Note: Create a fragment by name of employee2
For View:
Select * from employee2
(Show only those tuples contain Lahore)
• Select *
Into employee3
From employee
Where city= ‘Karachi’
Note: Create a fragment by name of employee3
For View:
Select * from employee3
(Show only those tuples contain Karachi)
F2
F3
F1
• Format:
Пatt1,att2,att3….attn (R)
➢ Attributes Affinity:
• Logic for vertically fragmentation means how to manage attributes in
different fragments & which application access which fragment highly.
• Used for decisions.
• Basic idea of VF is access efficiency.
• Information requirement is application based.
• Attribute affinities: means obtained from more primitive usage data.
How to Create:
3: Hybrid/ Mixed Fragmentation:
• In hybrid fragmentation, a combination of horizontal & vertical
fragmentation techniques are used. This is a more flexible
fragmentation technique since it generates fragments with minimal
extraneous information. However, re-construction of the original table
is often an expensive task.
• Hybrid fragmentation can be done in two alternative ways-
1. At first, generate a set of horizontal fragments; then generate
vertical fragments from one or more of the horizontal
fragments.
2. At first, generate a set of vertical fragments; then generate
horizontal fragments from one or more of the vertical
fragments.