Types of DBMS Fragmentation (TDF)



AVAILABLE:    5

There are two main types of fragmentation: horizontal and vertical, but there are also two additional types: mixed and derived fragmentation.

1. Horizontal Fragmentation

This type of fragmentation involves dividing a relation into subsets of tuples. A horizontal fragmentation is generated by specifying a predicate based on certain constraints applied to the tuples in a relation. It is defined using the SELECT operation from relational algebra.

The SELECT operation gathers tuples that share a common property. For instance, tuples related to the same application or located at the same site. Given a relation ( R ), a horizontal fragmentation is defined as:

σP(R)

Where ( P ) is a predicate based on one or more attributes of the relation.

Example: Assume there are only two types of properties: houses and flats. Horizontal fragmentation of properties for rent based on property type can be represented as:

  • P2:σtype=’Flat’(PropertyForRent)P2: \sigma_{\text{type='Flat'}}(\text{PropertyForRent})

  • Fragment P1

    PnoStreetAreaCityPcodeTypeRoomsRentCnoSnoBno
    PA1416 HollDeeAberAB75SHouse6650CO46SA9B7
    PG2118 DellHyndGlasG12House4500CO87SG37B3


    Fragment P2

    PnoStreetAreaCityPcodeTypeRoomsRentCnoSnoBno
    PL946 ArgDeeAberAB74SFlat4450CO67SL41B5
    PG48 LawHyndGlasG50Flat4400CO70SG14B3
    PG162 ManPartGlasG67Flat3300CO90SG14B3


    This fragmentation is beneficial when transactions involve different applications, such as for houses or flats.

    Correctness Rules:

    1. Completeness: Every tuple in the relation must appear in either ( P1 ) or ( P2 ).
    2. Reconstruction: The original relation can be reconstructed using the UNION operation:
      ( P1 \cup P2 = \text{PropertyForRent} ).
    3. Disjointness: No tuple should belong to more than one fragment.

    Horizontal fragmentation strategies may sometimes be straightforward. In other cases, detailed analysis of the application, including predicate evaluation, is required.

    2. Vertical Fragmentation

    Vertical fragmentation involves splitting a relation into subsets of attributes. This fragmentation groups attributes that are frequently used together by applications. It is defined using the PROJECT operation in relational algebra. For a relation ( R ), a vertical fragmentation is represented as:

    [ \pi_{a1,a2,...,an}(R) ]

    Where ( a1, a2, ..., an ) are attributes of ( R ).

    Example: In a company called Dream Home, the Payroll application requires attributes ( Sno, \text{Position}, \text{Sex}, \text{DOB}, \text{Salary}, \text{NIN} ), while the HR department requires ( Sno, \text{Fname}, \text{Lname}, \text{Address}, \text{Tel_no}, \text{Bno} ). The vertical fragmentation is as follows:

    • ( S1 = \pi_{\text{Sno,Position,Sex,DOB,Salary,NIN}}(\text{Staff}) )
    • ( S2 = \pi_{\text{Sno,Fname,Lname,Address,Tel_no,Bno}}(\text{Staff}) )

    Fragment S1

    SnoPositionSexDOBSalaryNIN
    SL21ManagerM1-Oct-60300000WK44201B
    SG37Snr AssF10-Nov-65150000WL43251C
    SG14DeputyM24-Mar-70100000WL22065B
    SA9AssistantF20-Jan-7090000WM53218D


    Fragment S2

    SnoFnameLnameAddressTel_noBno
    SL21JohnWhite19 Taylor London0171-884-5112B5
    SG37AnnBeech81 George Glasgow0141-848-3345B3
    SG14DavidFord63 Ashby Glasgow0141-339-2177B3
    SA9MarieHowe2 Elm AberdeenB7

    3. Mixed Fragmentation

    Mixed fragmentation applies both horizontal and vertical fragmentation sequentially. It combines the SELECT and PROJECT operations. For example:

  • πa1,a2,...,an(σP(R))\pi_{a1,a2,...,an}(\sigma_P(R))

  • 4. Derived Horizontal Fragmentation

    Derived fragmentation creates fragments of a "child" relation based on the fragmentation of its "parent" relation. It ensures related fragments are stored at the same site.

    5. No Fragmentation

    This strategy involves storing the entire relation without fragmentation. It is useful when updates are infrequent and the relation is small.

    6. Fragmentation Rules

    1. Completeness: All data from the original relation must appear in at least one fragment.
    2. Reconstruction: The original relation must be reconstructable using fragments.
    3. Disjointness: Data items should not appear in multiple fragments (except for primary keys in vertical fragmentation).

    Post a Comment

    Previous Next

    نموذج الاتصال