Vous êtes sur la page 1sur 2

©2005, EPFL-IC, Laboratoire de Systèmes d'Information Répartis (LSIR)

Distributed Information Systems - Exercise 4 – Schema Fragmentation

WS 2004/2005

Distributed Information Systems - Exercise 4

Schema Fragmentation

Date: 23.11.2004
Return: 30.11.2004

1. Horizontal Fragmentation
Given the following relational database:

Employees ProjectAssignments
EmpNo EmpName Salary EmpNo ProjNo MonthsSpent
E1 Federer 20000 E1 P1 3
E2 Klum 10000 E2 P2 4
E3 Spears 12000 E2 P4 2
E4 Montoya 6000 E3 P3 8
E5 Beckham 15000 E4 P1 6
E6 Lopez 18000 E5 P2 9
E6 P4 4.5

Projects
ProjNo ProjName Location Budget
P1 Training Geneva 98000
P2 Advertising Geneva 72000
P3 Management Munich 150000
P4 Customer Support Zurich 120000

Typical queries from applications are:


At the controlling department located in Geneva:
A1
SELECT P.ProjNo, P.Budget, PA.EmpNo, PA.MonthsSpent
FROM Projects P, ProjectAssignments PA
WHERE P.ProjNo = PA.ProjNo AND P.Budget < 110000
A2
SELECT PA.EmpNo, PA.ProjNo, PA.MonthsSpent
FROM Employees E, ProjectAssignments PA
WHERE E.EmpNo = PA.EmpNo AND E.Salary > 11500

1
©2005, EPFL-IC, Laboratoire de Systèmes d'Information Répartis (LSIR)
Distributed Information Systems - Exercise 4 – Schema Fragmentation
At the human resource department located in Munich:
A3
SELECT * FROM Employees E
A4
SELECT E.*, PA.MonthsSpent
FROM Employees E, ProjectAssignments PA
WHERE E.EmpNo = PA.EmpNo

At the sales coordination department located in Zurich:


A5
SELECT * FROM Projects
WHERE Location != “Geneva”

a) For the relations Employees and Projects, determine minimal sets of simple predicates using the MinFrag
algorithm.
b) What are the corresponding fragments of the two relations Employees and Projects?
c) How would you fragment ProjectAssignments horizontally? Give a short discussion of your decision.

2. Vertical Fragmentation
Let Q = {Q1, Q2, Q3, Q4} be a set of queries, A = {A1, A2, A3, A4} a set of attributes, and S = {S1, S2, S3} a set
of sites. The matrix in the Figure 1 describes the attribute usage values and the one in Figure 2 gives the application
access frequencies. Assume that A1 is the primary key.

Use the bond energy algorithm and the vertical partitioning algorithm to obtain a vertical fragmentation of the
set of attributes in A.

A1 A2 A3 A4
Q1 0 1 1 0
Q2 1 1 1 0
Q3 1 0 0 1
Q4 0 0 1 0

Figure1: This matrix shows which attributes each query uses.

S1 S2 S3
Q1 10 20 0
Q2 5 0 10
Q3 0 35 5
Q4 0 10 0

Figure 2: This matrix shows how often each site executes queries.

Vous aimerez peut-être aussi