Chapter 6 Physical Database Design Physical Design and

Chapter 6 Physical Database Design


Physical Design and implementation 1. Translate global logical data model for target DBMS ð 1. 1 ð 1. 2 Design base relations for target DBMS Design integrity rules for target DBMS 2. Design and implement physical representation ð 2. 1 ð 2. 2 ð 2. 3 ð 2. 4 ð 2. 5 Analyze transactions Choose file organizations Chose secondary indexes Consider introduction of controlled redundancy Estimate disk space 3. Design and implement security mechanisms ð 3. 1 ð 3. 2 Design and implement user views Design and implement access rules 4. Monitor and tune the operational system

1. Translate global logical data model for target DBMS § Objective ð To produce a working relational database schema from the global logical data model § Examine whether the system supports: ð definition of primary keys, foreign keys, alternate keys ; ð definition of required fields ( option NOT NULL ) ; ð definition of domains ; ð definition of enterprise constraints • 1993 ISO SQL standard (SQL 2) • Triggers, database procedures • Unique indexes § Verify how to create base tables

Design base relations for target DBMS

2. Design and Implement Physical Representation § Objective ð To determine the file organizations and access methods that will be used to store the base relations : that is, the way in which relations and tuples will be held on secondary storage. § Factors used to measure efficiency: ð Transaction throughput ð Response time (elapse time for completion of a single transaction) ð Disk storage § This leads to a Query Execution Plan (QEP) ð related to query optimizer and supported by some DBMS.

2. 1 Analyze Transactions § Objective ð To understand the functionality of the transactions that will run on the database and to analyze the important transactions § For each transaction type we should determine: ð the expected frequency; ð relations and attributes accessed by the transactions and the type of access (insert, delete, update); ð attributes used as predicates in SQL (these are candidates for access structures); ð attributes involved in a join of two or more relations ð time constraints on the transactions.

2. 2 Choose file organization § Objective ð Determine an efficient file organization for each base table. § Heap when: ð data is bulk-loaded into the relation ð relation is only a few pages long ð every tuple in a relation is to be retrieved § Hash when: ð tuples are only to be retrieved based on a hash field § B-tree when: ð retrieval based on exact key match or ranges of values § Inverted file when: ð multiple search criteria and few updates

2. 3 Choose secondary indexes § Objective ð Determine whether adding secondary indexes will improve the performance of the system. § § The overhead involved should be balanced against the performance improvement. Guidelines: ð index the primary key if it is not the key of the file organization ð no indexes on small relations ð add secondary indexes on heavily used attributes ð add secondary indexes to a foreign key ð avoid keys on attributes that are frequently updated ð avoid indexes on long attributes

2. 4 Consider introduction of controlled redundancy § Objective ð Determine whether introducing redundancy in a controlled manner by relaxing the normalization rules will improve the system performance. ð Denormalization makes implementation more complex; ð Denormalization often sacrifices flexibility; ð Denormalization speeds up retrieval but slows down updates; § § § Derived data. Duplicating attributes or joining relations together. Introduction of redundancy should be fully documented

2. 5 Estimate disk space § § We estimate the amount of disk space that the database requires. Calculation is important to ensure sufficient disk space for the database when it goes live, and during the lifetime of the system.

3. Document design of security measures and user views § We document the design of the individual user views and security mechanisms of the database.

4. § Monitor and Tune the Operational System Example new requirements ð Ability to hold pictures of the properties for rent, together with comments that describe the main features of the property. ð Ability to publish a report describing properties available for rent on the World-Wide Web (WWW).

Microsoft Access Startup window and Microsoft Access dialog box

Microsoft Access Database window for Dream. Home database

New Table dialog box

Design View of Property_for_Rent table Field Properties for Property_No field

Design View of Property_for_Rent table -Field Properties for Rooms field

Possible values for Type Field of Property_for_Rent table

Using Lookup list for Type field of Property_for_Rent table

Property_for_Rent tables joined on Staff_No

Relationships dialog box for the Staff and Property_for_Rent tables

Design Enterprise Constraints for Target DBMS - Example enterprise constraint

Error message indicating that an enterprise constraint has been violated
- Slides: 24