You are on page 1of 21

Introduction to

Data Warehouse

Denormalization
Denormalisation

• Is denormalization Important?
• The answer is yes, but only when it is estimated that
the system may not be able to meet its performance
requirements.
Denormalisation

• A fully normalised system does not necessarily


provide maximum processing efficiency.
• Why???

• In this situation introducing redundancy in a


controlled manner by relaxing the normalisation rules
will improve the performance of the system.
Denormalisation

• In general we are loosely using the term to refer


to situations where we combine relations and the
new relation is still normalized but may contain
nulls.
Denormalisation

 Normalisation is still very important for


database design.
 In addition the following factors have to be
considered:
 Denormalisation makes implementation more complex.

 Denormalisation often sacrifices flexibility

 Denormalisation speed up retrievals.


How Denormalization
improves performance?
De-normalization specifically improves
performance by either

 Reducing the number of tables which


consequently speeds up performance.

 Reducing the number of joins required during


query execution

 Reducing the number of rows to be retrieved from


the Primary Data Table. 6
4 Guidelines for

1. Carefully do a cost-benefit analysis

2.Do a data storage requirement


analysis.
3.Weight against the maintenance issue of
the redundant data
4. When in doubt, don’t denormalize.
7
Method of
Denormalization
1) Adding Redundant Columns.
2) Adding Derived Columns
3) Combining Tables
4) Repeating Groups
5) Creating extract tables
6) Partitioning Relations
Adding Redundant Columns

• You can add redundant columns to eliminate


frequent joins. For example, if frequent joins
are performed on the titleauthor and authors
tables in order to retrieve the author's last
name, you can add the au_lname column to
titleauthor.
Adding Redundant Columns

• Adding redundant columns eliminates joins for


many queries. The problems with this solution
are that it:
• All changes must be made to two
tables, and possibly to many rows in
one of the tables.
• Requires more disk space, since
au_lname is duplicated.
Adding Derived Columns

• Adding derived columns can also help


eliminate joins and reduce the time needed
to produce aggregate values.
• The example shows both benefits. Frequent
joins are needed between the titleauthor and
titles tables to provide the total advance for a
particular book title.
Adding Derived Columns
Adding Derived Columns

• You can create and maintain a derived data


column in the titles table, eliminating both the
join and the aggregate at run time.

• This increases storage needs, and requires


updation of the derived column whenever
changes are made to the titles table.
Combining Tables

• If most users need to see the full set of joined data


from two tables, collapsing the two tables into one
can improve performance by eliminating the join.
Combining Tables
Another Example
on collapsing and benefits
ColA ColB
denormalized

 ColA ColB ColC


normalized

ColA ColC

Benefits
 Reduced update time.
 Does not changes business
view.
 Reduced foreign keys.
Repeating Groups
• These repeating groups can be stored as a nested
table within the original table.
Repeating Groups
Example
Repeating Groups
Creating extract tables
• Reports can access derived data and perform
multi-relation joins on same set relations.

• Possible to create a single, highly


denormalized extract table based on relations
required by reports, and allow users to access
extract table directly instead of base relations.

You might also like