Presentation is loading. Please wait.

Presentation is loading. Please wait.

Physical Database Design

Similar presentations


Presentation on theme: "Physical Database Design"— Presentation transcript:

1 Physical Database Design
Translate global logical data model for target DBMS Design file organizations and indexes Design user views Design security mechanisms Consider the introduction of controlled redundancy Monitor and tune the operation system Chapter 18(17)

2 Translate global logical data model for target DBMS
Design base relations define data type,basic constrain of attributes Design representation of derived data 一些統計數字可以存放的table Design general constraints

3 Design file organizations and indexes
objective:achieve acceptable performance transaction throughput response time disk storage System resource:Memory,CPU,Disk,Network Analyze transactions:Table 18.1(17.1),pp.531(504) Choose file organizations Choose indexes Estimate disk space requirements

4 Choose file organizations
Target DBMSs usually give little or no choice on file organizations. file types Unordered Files(Heap) Hash Indexed Sequential Access Method(ISAM) B-tree Clusters Appendix F (C)

5 File types(1) Heap:record by record, unordered
insert quickly, small space deleted by mark record deleted, need reorganized periodically need linear search good for data bulk-loaded into table only a few records usually read entire table table has index

6 File types(2) Hash:use hash function to calculate address of record
good for exact matching not good for pattern matching, ranges of values When hash field is frequently updated, DBMS must delete entire record and move it to new location

7 File types(3) Indexed Sequential Access Method(ISAM)
supports exact match, pattern match, range of values, part key specification But index are static, performance will reduce after file update B-tree:A tree structure,Appendix F(C).5.5 Dynamic index, but ISAM is more efficient if tables are not frequently updated. Each node in the tree is actually a disk page

8 File types(4) Clustered tables:tables physically stored together because they share common columns and often used together. related columns are called cluster key indexed cluster queries retrieve rows over a rang of cluster key values clustered tables may grow unpredictably hash cluster queries retrieve rows based on equality conditions clustered tables are static or size determined

9 Choose indexes(1) Index file type: B-tree 最常見
some DBMS can select index file type some DBMS support full-text search index Bitmap Index:suitable for domain with few possible value Join Indexes

10 Choose indexes(2) Index overhead
insert must insert records to every indexes update need to update related indexes disk space possible performance reduction during query optimization

11 Choose indexes(3) Guidelines: F(C).7,18(17).3(pp.509) remove indexes
if insert will increase 10% size of table, drop the indexes temporarily Homework: design a program to test the performance of each index file type and file type of selected DBMS. create views for your database prepare an environment for your APs.

12 Consider the introduction of controlled redundancy
objective:relaxing the normalization rules to improve performance join operation draw back of denormalization makes implementation more complex often scarifices flexibility speed up retrievals but slows down updates if often read, little update, denormalization is a possible option Step Implications and solutions Chapter 19(18)

13 Monitor and Tune the OS Memory(RAM Disk,shared memory), storage (block size,partition) benefits avoid buy additional hardware possible to downsize the hardware configuration produces faster response time and throughput How to monitor(UNIX & Windows) Memory, CPU, DISK I/O, Network


Download ppt "Physical Database Design"

Similar presentations


Ads by Google