Horizontal fragmentation
Assuming that there are only two property types, Flat and House, the horizontal fragmentation of PropertyForRent by property type can be obtained as follows.
Completeness. Each tuple in the relation appears in either fragment P1 or P2.
Reconstruction. The PropertyForRent relation can be reconstructed from the fragments using the Union operation:
P1 U P2 = PropertyForRent
Disjointness. The fragments are disjoint; there can be no property type that is both ‘House’ and ‘Flat’
Vertical fragmentation
The DreamHome payroll application requires the staffNo and the position, gender, DoB, and salary attributes of each member of staff;
HR department requires the staffNo, fName, lName, and branchNo attributes.
The vertical fragmentation of Staff for this example can be obtained as follows:
Both fragments contain the primary key, staffNo, to enable the original relation to be reconstructed
The advantage of vertical fragmentation is that the fragments can be stored at the sites that need them
In addition, performance is improved as the fragment is smaller than the original base relation
Mixed fragmentation
For some applications, horizontal or vertical fragmentation of a database schema by itself is insufficient to adequately distribute the data.
Instead, mixed or hybrid fragmentation is required.
Consists of a horizontal fragment that is subsequently vertically fragmented, or a vertical fragment that is then horizontally fragmented.