physical database design chapter 6. physical design and implementation 1.translate global logical...

24
Physical Database Design Chapter 6

Upload: violet-brooks

Post on 30-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Physical Database Design

Chapter 6

Page 2: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations
Page 3: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Physical Design and implementation

1. Translate global logical data model for target DBMS1.1 Design base relations for target DBMS1.2 Design integrity rules for target DBMS

2. Design and implement physical representation2.1 Analyze transactions2.2 Choose file organizations2.3 Chose secondary indexes2.4 Consider introduction of controlled redundancy2.5 Estimate disk space

3. Design and implement security mechanisms3.1 Design and implement user views3.2 Design and implement access rules

4. Monitor and tune the operational system

Page 4: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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 (SQL2)• Triggers, database procedures• Unique indexes

Verify how to create base tables

Page 5: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Design base relations for target DBMS

Page 6: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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 throughputResponse 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.

Page 7: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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.

Page 8: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

2.2 Choose file organization

ObjectiveDetermine an efficient file organization for each base table.

Heap when:data is bulk-loaded into the relation relation is only a few pages longevery 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

Page 9: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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 organizationno indexes on small relationsadd secondary indexes on heavily used attributesadd secondary indexes to a foreign keyavoid keys on attributes that are frequently updatedavoid indexes on long attributes

Page 10: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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

Page 11: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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.

Page 12: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

3. Document design of security measures and user views

We document the design of the individual user views and security mechanisms of the database.

Page 13: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

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).

Page 14: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Microsoft Access Startup window and Microsoft Access dialog box

Page 15: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Microsoft Access Database window for DreamHome database

Page 16: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

New Table dialog box

Page 17: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Design View of Property_for_Rent table -Field Properties for Property_No field

Page 18: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Design View of Property_for_Rent table -Field Properties for Rooms field

Page 19: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Possible values for Type Field of Property_for_Rent table

Page 20: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Using Lookup list for Type field of Property_for_Rent table

Page 21: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Relationships window of Staff and Property_for_Rent tables joined on Staff_No

Page 22: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Relationships dialog box for the Staff and Property_for_Rent tables

Page 23: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Design Enterprise Constraints for Target DBMS - Example enterprise constraint

Page 24: Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations

Error message indicating that an enterprise constraint has been violated