B09 FileOrg

Embed Size (px)

Citation preview

  • 8/8/2019 B09 FileOrg

    1/16

    DBMS Physical Design

    Physical design is

    concerned with theplacement of data andselection of accessmethods for efficiencyand ongoing maintenance

  • 8/8/2019 B09 FileOrg

    2/16

    F ile Organization

    Physical arrangement of the records of a file onsecondary storage devices

    SequentialLinked ListIndexedHashed

  • 8/8/2019 B09 FileOrg

    3/16

    S equential F ile

    a d d r

    0 0 A y e r s A C C T0 1 B u c k l e y M G T0 2 D a l e y A C C T0 3 D e j o i e M G T

    0 4 K e n d e r d i n e M K T0 5 L i n n F I N0 6 L u s c h M K T0 7 P r i c e M G T0 8 R a z o o k M K T0 9 S c h w a r z k o p f M G T

    Se quen tial file sor ted in alphabe tical order. Se quen tial files are usually sor ted in ID se quence order to facilita te ba tch processin g.

  • 8/8/2019 B09 FileOrg

    4/16

    S equential F ile Processing

    Transaction

    Old Master New Master

    Process

    Sequential files must be recopied from the point of

    any insertion or deletion to the end of the file . Theyare commonly used in batch processing where anew master file will be generated each time the fileis updated .

  • 8/8/2019 B09 FileOrg

    5/16

    L inked L ist

    a d d r p o i n t e r 0 0 P r i G T 0 1

    0 1 S c h w a r z k o p f M G T 0 20 2 K e n d e r d i n e M K T 0 30 3 L u s c h M K T 0 8

    0 4 B u c k l e y M G T 0 9

    0 5 A y e r s A C C T 0 6

    0 6 D a l e y A C C T 0 7

    0 7 L i n n F I N 0 4

    0 8 R a z o o k M K T # #0 9 D e j o i e M G T 0 0

    Linked lis t to sor t da ta a lpha be tica lly within depar tmen t. An e xterna l reference mus t po int to the s tar t record (05) .

  • 8/8/2019 B09 FileOrg

    6/16

    L inked L ist F ile Processing

    The next record in a linked list is found at the addressstored in the record . Records are added at anylocation in the DASD and pointers ad justed to includethem . Deletions are not erased, but pointerschanged to omit the deleted record .

  • 8/8/2019 B09 FileOrg

    7/16

    I ndexed F ile(sequential index)

    a d d r 0 0 P r i c e M T A y e r s A C C T0 1 S c h w a r z k o p f M T D a l e y A C C T0 2 K e n d e r d i n e M K T L i n n F I N0 3 L u s c h M K T R a z o o k M K T0 4 B u c k l e y M T D e j o i e M T

    A C C T 0 0 A C C T 0 1F I N 0 2M T 0 0

    M T 0 1M T 0 4M K T 0 3

    Index to access data bydepartment a bb reviation .

  • 8/8/2019 B09 FileOrg

    8/16

    I ndexed F ile Processing

    Index

    Data File

    When a record is inserted or deleted in a file the datacan be added at any location in the data file . Each indexmust also be updated to reflect the change . For asimple sequential index this may mean rewriting the

    index for each insertion .

    Index

  • 8/8/2019 B09 FileOrg

    9/16

    S egmented I ndex

    a d d r

    0 0 P r ic G T y r s T

    0 1 S c w r z k f G T l y T

    0 2 K e n d e r d in e M K T in n F I

    0 3 L u s c M K T z k M K T

    0 4 B u c k le y M G T e j ie M G T

    0 5 V a n H o r n M G T

    a d d p o n e p o n e p o n e1 0 0 1 0 1 K e n d e r d in e 1 0 2 R a z o o k 1 0 31 0 1 2 0 0 B u c k le y 2 0 1 D e jo ie 2 0 41 0 2 2 0 3 L u s c 2 0 21 0 3 2 0 5 S c w a r z k o p f 2 0 62 0 0 0 0 A y e r s 0 4 B u c k le y 2 0 12 0 1 0 1 D a le y 0 4 D e jo ie 2 0 42 0 2 0 0 P r ic e 0 3 R a z o o k 2 0 52 0 3 0 2 L in n 0 3 L u s c 2 0 22 0 4 0 2 K e n d e r d in e 2 0 32 0 5 0 1 S c w a r z k o p f 2 0 62 0 6 5 V a n H o r n

    Index

    Da a

    Lea f

    Roo tode s

  • 8/8/2019 B09 FileOrg

    10/16

    I ndexed F ile Processing(segmented index)

    Data File

    Index

    Data can be inserted or deleted at any location in thedata file . The index(es ) must be updated for eachchange, but only the affected segments need to berewritten .

  • 8/8/2019 B09 FileOrg

    11/16

    Track

  • 8/8/2019 B09 FileOrg

    12/16

    Physical Design

    Volume and Usage analysisDistribution StrategyFile OrganizationsIndexes and Access MethodsIntegrity Constraints

  • 8/8/2019 B09 FileOrg

    13/16

    Physical Design Issues

    SizeSpeed of accessSpeed of updateGrowth issues: performance anddegradationSecurityMaintenance

  • 8/8/2019 B09 FileOrg

    14/16

    DBMS Organization

    R elationships: physicaladdress pointers

    Links generated when data isenteredEfficient but not flexible

    Ad hoc designQuery dependent on specific

    DBMS (may support SQL)

    R elationships: logical datareferences

    Links generated when data isretrievedFlexible but not efficient Theoretical baseSQL

    Structured Relational

  • 8/8/2019 B09 FileOrg

    15/16

    DBMS TechnologyCPU

    C omponentsOperation

    DAS DTechnologyOrganization

    Data Transfer Access methods

  • 8/8/2019 B09 FileOrg

    16/16

    Physical DesignData Distribution

    CentralizedPartitionedHorizontal

    VerticalR eplicatedHybrid