13.07.2015 Views

13.1 through 13.5, 13.10 and 13.11

13.1 through 13.5, 13.10 and 13.11

13.1 through 13.5, 13.10 and 13.11

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 13 Disk Storage, Basic File Structures, <strong>and</strong> Hashing13.9 Other Primary File Organizations13.9.1 Files of Mixed RecordsThe file organizations we have studied so far assume that all records of a particularfile are of the same record type. The records could be of EMPLOYEEs, PROJECTs,STUDENTs, or DEPARTMENTs, but each file contains records of only one type. Inmost database applications, we encounter situations in which numerous types ofentities are interrelated in various ways, as we saw in Chapter 3. Relationshipsamong records in various files can be represented by connecting fields.tl For example,a STUDENT record can have a connecting field Malor dept whose value gives thename of the DEPARTMENT in which the student is majoring. This Major dept fieldrefers to a DEPARTMENT entity, which should be represented by a record of its ownin the DEPARTMENT file. If we want to retrieve tield values from two related records,we must retrieve one of the records first. Then we can use its connecting field valueto retrieve the related record in the other file. Hence, relationships are implerrrentedby logical field references among the records in distinct tiles.File organizations in object DBMSs, as well as legacy systems such as hierarchicalar.rd network DBMSs, often implement relationships arlong records as physicalrelationships realized by physical contiguity (or clustering) of related recorcls or byphysical pointers. These file organizations typically assign an area of the disk tohold records of more than one type so that records of difl'erentypes can be physicallyclusteredon disk. Ifa particular relationship is expected to be used frequently,implementing the relationship physically can increase the system's efficiency atretrieving related records. For examprle, if the query to retrieve a DEPARTMENTrecord <strong>and</strong> all records for STUDENTs majoring in that departrnent is fi'equent, itwould be desirable to place each DEPARTMENT record <strong>and</strong> its cluster of STUDENTrecords contiguously on disk in a mixed file. The concept of physical clustering ofobject types is used in object DBMSs to store related objects together in a mixed fiie.To distinguish the records in a mixed file, each record has-in addition to its fieldvalues-a record type field, which specifies the type of record. This is typically thefirst field in each record <strong>and</strong> is used by the system software to determine the type ofrecord it is about to process. Using the catalog information, the DBMS can determinethe fields of that record type <strong>and</strong> their sizes, in order to interpret the data valuesin the record.13.9.2 B-Trees <strong>and</strong> Other Data Structuresas Primary OrganizationOther data structures can be used for primary file organizations. For example, ifboth the record size <strong>and</strong> the number of records in a file are small, sorne DBMSs offerthe option of a B-tree data structnre as the primary file organization. We willdescribe B-trees in Section 14.3.1, when we discuss the use of the B-tree data struc-11. Tl-e Lorcept o'foregr l,eys ir the relat.ona. model (Chapter 5) aro refe'erces a'no'rg oblects .oblect-oriented models (Chapter 20) are examples of connectlng fields,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!