0% found this document useful (0 votes)
11 views32 pages

Fragmentation

The document discusses distributed database fragmentation, detailing the process of dividing a table into smaller fragments that can be stored at different locations while ensuring the original table can be reconstructed. It outlines three types of fragmentation: horizontal, vertical, and hybrid, along with their advantages and disadvantages. Additionally, it provides examples of horizontal fragmentation and explains the concepts of derived horizontal fragmentation and attribute affinity in vertical fragmentation.

Uploaded by

Maira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views32 pages

Fragmentation

The document discusses distributed database fragmentation, detailing the process of dividing a table into smaller fragments that can be stored at different locations while ensuring the original table can be reconstructed. It outlines three types of fragmentation: horizontal, vertical, and hybrid, along with their advantages and disadvantages. Additionally, it provides examples of horizontal fragmentation and explains the concepts of derived horizontal fragmentation and attribute affinity in vertical fragmentation.

Uploaded by

Maira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Lecture # 3 Distributed Database Fragmentation & Allocations

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)

➢ Re-construct of all Fragments:

Select* from employee1


Union all
Select* from employee2
Union all
Select* from employee3
Note: Now all fragments again show the entire relation.
➢ Types of Horizontal Fragments:
1-Primary Horizontal fragmentation
2-Derived horizontal fragmentation
2: Derived Horizontal Fragmentation:
2: Vertical Fragmentation:
• Each site may not need all the attributes of a relation.
• Thus we use verticals fragmentation which divides a relation
vertically by columns.
• It is subset of relation which is created by a subset of columns.
• A VF of a relation produces fragments R1, R2,….. Rn, each of
contain subset of attributes of R and Primary Key of R.
• Objective is to produce smaller relations, so that most of the
application runs on smaller relations; so they become fast.
• Reconstruction of vertical is joining Operation.

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.

You might also like