Download presentation
Presentation is loading. Please wait.
1
Physical Database Design and Performance
Ali Saeed Khan 13/12/2017
2
Physical Database Design and Performance
Denormalization
3
Denormalization The process of transforming normalized relations into non normalized physical record specifications. One to one Many to many Reference Data (One to many)
4
2 entities with 1-1 Relationship
If access frequency between these two entities is high Note: Fields from the optional entity must have NULL values allowed
5
2 entities with 1-1 Relationship
6
Many-to-Many Relationship
2 Joins, Reduce one most frequent join by combining the 2 entities
7
Many-to-Many Relationship
8
Reference Data (1-M) Reference data exists in an entity on the one side of a one-to-many relationship, and this entity participates in no other database relationship. WHEN, few instances of the entity on many side for each entity instance on the one side.
9
Reference Data
10
Physical Database Design and Performance
partitioning
11
Partitioning This is a form of denormalization involves creation of more tables by partitioning a relation into multiple physical tables Horizontal Vertical
12
Horizontal Partitioning
Implements a logical relation as multiple physical tables by placing different rows into different tables, based on common column values. E.g. Library Books, placed type wise. Or, customer table on region Common methods of horizontal partitioning Single column value date
13
Horizontal Partitioning
Advantages, Efficiency Local Optimization Security Recovery and Uptime Load Balancing Disadvantages Inconsistent access speed Complexity Extra Space and Update time
14
Horizontal Partitioning
Same as (super-type/subtype) WHEN, when the partitioned tables are used in different ways i.e. queries, transactions and reports. Should not be if partitioned are used in same way
15
Horizontal Partitioning
Oracle Range Partitioning Hash (rows are distributed evenly) List (partition column has a list of values)
16
Horizontal Partitioning
17
Vertical Partitioning
Distributes the columns of a logical relation into separate tables, repeating the PK in each of the tables Usually Operation related columns are kept together e.g. accounting, sales, engineering. Also depends upon access analysis……… Neither H nor V partitioning prohibits the ability to treat the original relation as a whole.
18
Vertical Partitioning
19
Data Replication Same data is stored at multiple places in the same database….. Must be used with great care and analysis Only used when the data is very frequently used
20
Designing physical database files
Physical Database Design and Performance Designing physical database files
21
Physical File A named portion of secondary memory allocated for the purpose of storing physical records. In order to optimize the performance of the database processing, the person who administers a database, often need to know the extensive details about how the DB management system manages physical storage space. This knowledge is DBMS specific but the broad concepts can be applied to all.
22
Tablespace A named logical storage unit in which data from one or more database tables, views, or other database objects may be stored. Oracle e.g. (SYSTEM and SYSAUX) for system data (data dictionary and meta data) (TEMP) for temporary workspace (UNDOTBS1) for undo operations For user business data (more than one)
23
Tablespace Helps admin maintain security, as each database in DBMS has a separate tablespace for which unique users can be created Each tablespace is logically divided into, Segments Then extents Data blocks (smallest unit of storage) Each tablespace can have multiple data files, but each file belongs to a unique tablespace and DB
24
Physical Database Design and Performance
File organizations
25
File Organizations A technique for physically arranging the records of a file on secondary storage devices. We don’t need to design file organization however we have to make selection of an organization and its parameters for a table or a physical file.
26
Factors Fast Data Retrieval
High throughput for processing data input and maintenance transactions Efficient use of storage space Protection from failures or data loss Minimizing need for reorganization Accommodating growth Security from unauthorized use
27
File Organization
28
Sequential File Organization
Because of their inflexibility sequential files are not used in DB but may be used for files that backup data from database
29
Sequential File Organization
30
Indexed File Organization
Records are saved either sequentially or non-sequentially, an indexed is maintained which allows application to access these records individually INDEX: A table or other data structure used to determine in a file the location of records that satisfy some condition
31
Join Index Indexes we studied till now are good for a limited set of records (few specific table rows) Join index is used in data warehousing and other decision support application (DSA). In DSA data accessing tends to want all rows that are related on a specific criteria “An Index on columns from two or more tables that come from the same domain of values”
32
Join Index
33
Join Index
34
Join Index A join index, similar to any other index, saves query processing time by finding data meeting a pre-specified qualification at the expense of the extra storage space and maintenance of the index.
35
Indexed File Organization
36
Hashed File Organization
A storage system in which address for each record is determined using a hashing algorithm (“A routine that converts a primary key value into a relative record number or relative file address”)
37
Hashed File Organization
38
Hashed File Organization
Hash clash (more than one key hashes to same address) Hash Index Table (key is hashed into an index where pointer to actual data record is stored)
39
Comparison
40
Using and selecting indexes
Physical Database Design and Performance Using and selecting indexes
41
Creating unique key index
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.