Optimization Strategy
-
Upload
ashi-sharma -
Category
Documents
-
view
217 -
download
0
Transcript of Optimization Strategy
![Page 1: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/1.jpg)
CT004-3-3 ADVBS Introduction & Overview
Optimization Strategy
CT004-3.5-3 Advanced Database Systems
![Page 2: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/2.jpg)
CT004-3-3 ADVBS Introduction & Overview
Objectives
Meaning of denormalization. When to denormalize to improve
performance.
![Page 3: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/3.jpg)
CT004-3-3 ADVBS Introduction & Overview
Introduction
Result of normalization is a design that is structurally consistent with minimal redundancy.
However, sometimes a normalized database does not provide maximum processing efficiency.
May be necessary to accept loss of some benefits of a fully normalized design in favor of performance.
![Page 4: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/4.jpg)
CT004-3-3 ADVBS Introduction & Overview
Introduction
Also consider that denormalization: makes implementation more complex often sacrifices flexibility may speed up retrievals but it slows down
updates
![Page 5: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/5.jpg)
CT004-3-3 ADVBS Introduction & Overview
What is Denormalization
Denormalization refers to Refinement to relational schema Degree of normalization for a modified relation is
less than the degree of at least one of the original relations.
Term used more loosely to refer to Situations where two relations are combined into
one new relation New relation is still normalized but contains more
nulls than original relations.
![Page 6: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/6.jpg)
CT004-3-3 ADVBS Introduction & Overview
When to apply denormalization
Consider denormalization in following situations, specifically to speed up frequent or critical transactions:
Combining 1:1 relationships
Duplicating non-key attributes in 1:* relationships
to reduce joins
Duplicating foreign key attributes in 1:*
relationships to reduce joins
Introducing repeating groups
Partitioning relations
![Page 7: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/7.jpg)
CT004-3-3 ADVBS Introduction & Overview
Sample Relation Diagram
![Page 8: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/8.jpg)
CT004-3-3 ADVBS Introduction & Overview
Sample Relations
![Page 9: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/9.jpg)
CT004-3-3 ADVBS Introduction & Overview
Combining 1:1 relationships
![Page 10: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/10.jpg)
CT004-3-3 ADVBS Introduction & Overview
Combining 1:1 relationships
![Page 11: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/11.jpg)
CT004-3-3 ADVBS Introduction & Overview
Duplicating non-key attributes in 1:* relationships to reduce joins
SELECT p.*, o.lNameFROM PropertyForRent p, PrivateOwner oWHERE p.ownerNo = o.ownerNo AND branchNo = ‘B003’;
![Page 12: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/12.jpg)
CT004-3-3 ADVBS Introduction & Overview
Duplicating non-key attributes in 1:* relationships to reduce joins
SELECT p.*FROM PropertyForRent pWHERE branchNo = ‘B003’;
![Page 13: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/13.jpg)
CT004-3-3 ADVBS Introduction & Overview
Duplicating non-key attributes in 1:* relationships: Lookup Table
![Page 14: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/14.jpg)
CT004-3-3 ADVBS Introduction & Overview
Duplicating non-key attributes in 1:* relationships: Lookup Table
![Page 15: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/15.jpg)
CT004-3-3 ADVBS Introduction & Overview
Duplicating FK attributes in 1:* relationship to reduce joins
![Page 16: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/16.jpg)
CT004-3-3 ADVBS Introduction & Overview
Duplicating FK attributes in 1:* relationship to reduce joins
![Page 17: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/17.jpg)
CT004-3-3 ADVBS Introduction & Overview
Introducing repeating groups
![Page 18: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/18.jpg)
CT004-3-3 ADVBS Introduction & Overview
Partitioning relations
Rather than combining relations together, alternative approach is to decompose them into a number of smaller and more manageable partitions.
Two main types of partitioning: horizontal and vertical.
![Page 19: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/19.jpg)
CT004-3-3 ADVBS Introduction & Overview
Partitioning relations
![Page 20: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/20.jpg)
CT004-3-3 ADVBS Introduction & Overview
Advantages and disadvantages of denormalization
![Page 21: Optimization Strategy](https://reader035.fdocuments.us/reader035/viewer/2022062523/577cce001a28ab9e788d0f52/html5/thumbnails/21.jpg)
CT004-3-3 ADVBS Introduction & Overview
Q & A