An objective of horizontal decomposition of a class of objects (vertical decomposition of a relational table) is to reduce a size of objects in a class (rows in a relational table)
For example, we would like to reduce the size of objects in a class EMPLOYEE
Horizontal decomposition
Performance related observations
Horizontal decompositionreduces the amounts of persistent storage needed to implementdecomposed classes of objects (relational tables)
Reduction ofobject size(row size) speeds up processing ofsequential scansof classes of objects(relational tables) because less data blocks are need to store data
Horizontal decompositionmay increase processing time when the values of attributes from disjointclasses of objects(relational tables) are used in the same query; then additional joinis required
Horizontal decompositiondoes not affectnormalization
Afterhorizontal decompositioninsertion of a new object (row) needs two operations and not one like before
Horizontal decomposition
Sample applications
Queries that benefit from horizontal decomposition
Find full address (city,street,house#) of an employee identified by a given employee number
Find the first and the last name of all employees more than 60 years old
Queries that loose on horizontal decomposition
Find full address (city,street,house#) of all employees more than 60 years old
Find the first and the last name of all employees living in a given city
An objective of vertical decomposition of a class of objects (horizontal decomposition of a relational table) is to reduce the total number of objects in the classes (rows in the relational tables) obtained after decomposition
For example, we would like to reduce the total number of objects in a class EMPLOYEE that contains information about employees from finance and personnel departments
Vertical decomposition
Performance related observations
Vertical decompositionreduces the total number of objects accessed by an application
Reduction of total number of objects(total number of rows) speeds up processing ofsequential scansof classes of objects(relational tables)
Vertical decompositionincreases processing time when all objects from the decomposed classes of objects(relational tables) must be accessed; then additional unionis required
Vertical decompositiondoes not affectnormalization
Vertical decompositionrequires replication of code that enforces consistency constraints, e.g. stored procedures/functions or triggers
Vertical decomposition
Sample applications
Queries that benefit from vertical decomposition
Find a salary of a given employee from finance department
Find the names of employees from personnel department
Queries that loose on vertical decomposition
Find an average salary of employees from both finance and personnel departments
Find the total number of employees in the given age ranges