Shamkant B. Navathe Georgia Institute of Technology

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

A Mixed Fragmentation Methodology For

Initial Distributed Database Design


Shamkant B. Navathe
Georgia Institute of Technology
Kamalakar Karlapalem Minyoung Ra
Hong Kong University of Science and Technology Korea Military Academy

Abstract
We de ne mixed fragmentation as a process of simultaneously applying the horizontal and ver-
tical fragmentation on a relation. It can be achieved in one of two ways: by performing horizontal
fragmentation followed by vertical fragmentation or by performing vertical fragmentation followed
by horizontal fragmentation. The need for mixed fragmentation arises in distributed databases
because database users usually access subsets of data which are vertical and horizontal fragments
of global relations and there is a need to process queries or transactions that would access these
fragments optimally. We present algorithms for generating candidate vertical and horizontal frag-
mentation schemes and propose a methodology for distributed database design using these frag-
mentation schemes. When applied together these schemes form a grid. This grid consisting of cells
is then merged to form mixed fragments so as to minimize the number of disk accesses required to
process the distributed transactions. We have implemented the vertical and horizontal fragmenta-
tion algorithms and are developing a Distributed Database Design Tool to support the proposed
methodology.

I. INTRODUCTION
The distributed database design process consists of three phases, namely: initial design,
redesign and materialization of the redesign. The initial design consists of the fragmentation
and allocation algorithms that minimize the total transaction processing cost for a given set of
transactions. The redesign problem consists of generating new fragmentation and allocation
schemes from current fragmentation and allocation schemes (i.e., from the current design)
by taking into consideration the logical and physical changes in the distributed database
environment. The materialization of redesign is accomplished by a sequence of operations
to materialize the new fragmentation and allocation scheme from the current design.
In this paper we present a methodology for generating a mixed fragmentation scheme
for the initial distributed database design phase. This scheme is based on a graph theoretic
Correspondence and requests for reprints should be sent to Sham Navathe, College Of Computing, Georgia Institute
of Technology, Atlanta GA 30332-0280, USA. This research has been funded by RGC CERG grant number HKUST
609/94E and NSF Grant No. IRI 8716798. This work was carried out when the authors were at Database Systems
R&D Center, University of Florida, Gainesville FL32611.
algorithm which clusters a set of attributes and predicates into a set of vertical and horizontal
fragments, respectively. By applying these two algorithms together we form a grid on a
relation giving rise to a set of grid cells, wherein each grid cell belongs to exactly one
horizontal and exactly one vertical fragment. The grid suggests all possible ways in which
the global relation in a distributed database may be partitioned. In this paper, each element
of the grid is called a grid cell. We then merge these grid cells to form a set of mixed
fragments giving rise to a mixed fragmentation scheme that minimizes the number of disk
accesses needed to process the transactions. We shall use the words fragmentation and
partitioning interchangeably in this paper.
A. Motivation and Related Work
Partitioning of a global schema before allocating it in a distributed database can be per-
formed in two di erent ways: vertical fragmentation and horizontal fragmentation. The
current research considers either horizontal fragmentation schemes [1], [2], [3] or vertical
fragmentation schemes [4], [5], [6], [7], [8], [9], [10]. The best algorithms that exist for the
vertical and horizontal fragmentation are iterative and are based on integer programming
techniques. Most of the current research deals with coming up with a better set of algorithms
for vertical and horizontal fragmentation schemes and allocation schemes.
Since database users usually access data subsets that are both vertical and horizontal
fragments of global relations, there is a de nite need for research on mixed fragmentation.
There has been no study, to the best of our knowledge, about the sequencing of the vertical,
horizontal and allocation operations of the initial design phase. A di erent sequencing of
these operations generates di erent fragmentation and allocation schemes. The designers
then have to use their judgment in selecting the scheme which is most suitable for the trans-
action processing requirements. Our emphasis in this paper is on a uniform methodology
to generate the fragmentation scheme which is independent of sequencing the horizontal or
vertical fragmentation algorithms. We have developed a non-iterative algorithm that gener-
ates all the vertical fragments based on the attribute anities. We use a similar algorithm
to come up with the candidate horizontal fragmentation schemes based on the \predicate
anities" (de ned later in Section III-B). These two schemes can be generated in any order
and then applied together to generate the grid consisting of cells. These algorithms do not
require cost parameters. Allocation of the fragments to sites would typically involve a cost
model.
The amount of irrelevant data accessed by the transaction is reduced by mixed fragmenta-
tion because we take this into consideration while forming the mixed fragments. Moreover,
the methodology we propose is general enough to be applicable in the redesign phase of
distributed database design [11]. Mixed fragmentation can be accomplished in any one of
three ways: rst performing vertical partitioning and then horizontally partitioning the ver-
tical partitions (called VH partitioning), or rst performing the horizontal partitioning and
then vertically partitioning the horizontal partitions (called HV partitioning) or directly by
taking into consideration the semantics of the transactions [12]. Mixed fragmentation can
also be approached directly in terms of \cells" of data as generated by the grid formed by
the horizontal and vertical fragmentation schemes.
The outline for the rest of the paper is as follows: Section II describes the proposed
methodology, Section III describes the process of generating the grid cells, Section IV presents
a representation scheme for the grid cells, Section V presents the algorithms for merging the
grid cells to form mixed fragments and nally in Section VI we present conclusions and
future work.

II. Proposed Methodology


Several methodologies have been proposed for the initial design phase of the distributed
database design process. Some aspects of this initial design, such as vertical and horizontal
fragmentation, have been researched before. Before we go into the methodological aspects
of distributed database design we present the di erent kinds of vertical and horizontal par-
titionings that are possible. Figure 1 shows a relation and di erent ways of partitioning a
relation. Given a relation, the subsets of its tuples form its horizontal fragments de ned by
its horizontal partitioning; the subsets of its attributes (columns) form its vertical fragments
de ned by its vertical partitioning. Vertical partitioning of each of the horizontal fragments
gives rise to row-biased fragments [13] and is known as HV partitioning. Horizontal parti-
tioning of each of the vertical fragments gives rise to column-biased fragments and is known
as VH partitioning. Simultaneously applying vertical partitioning and horizontal partition-
ing on a relation gives rise to a grid consisting of a set of grid cells. Each grid cell belongs
to exactly one horizontal fragment and one vertical fragment. The grid cells give rise to an
unbiased partitioning of a relation.
In Figure 2 we show a comprehensive list of alternatives available for the initial design. We
Relation Horizontal Partitioning

HV Partitioning
Vertical Partitioning

VH Partitioning Grid Cells


Fig. 1. Di erent types of Partitionings of a Relation
use the word \grid" to indicate the partitioning of a single relation achieved by simultaneously
applying both horizontal and vertical partitioning. Other terms in that gure are explained
as follows:
fragmentation + allocation refers to constructing fragments as well as deciding where to
allocate them as a single decision problem. This approach is exempli ed by [2].
grid optimization refers to a \merging operation" with respect to grid cells which com-
bines the elementary (minimal) grid cells into larger ones for minimizing the transaction
processing cost.
Fragmentation and Allocation

A B C D E

Mixed Mixed Mixed


Fragmentation Fragmentation Fragmentation
Fragmentation Fragmentation
+ Allocation

Grid Cells
Allocation Grid Optimization Optimization
By Merging Allocation to + Allocation
Sites

Allocation Local Site


Optimization

Fig. 2. Alternative ways of dealing with the fragmentation and allocation problems
Arms A and B leave vertical and horizontal partitioning as two separate problems. The
order in which they should be attacked is unspeci ed, hence the resulting methodology is
incomplete. Alternative A is a very hard problem since both fragmentation and allocation
are simultaneously addressed [2], [3]. Our present approach corresponds to arm C in this
gure. Alternatives C and D refer to mixed fragmentation based on grid creation. We choose
alternative C in our approach because we regard allocation as an entirely separate problem
to be solved on the basis of much more detailed cost information. The fragmentation of
a relation into grid cells and grid optimization are considered to be problems governed by
the nature of data and its use by applications, whereas allocation deals with the problem
of physical placement accounting for detailed transaction cost modeling. Alternative E is
avoided again because it is more complicated to deal with grid optimization and allocation
together.
Figure 3 shows the Distributed Database Design Tool (D T ) reference architecture which
3

is used in the present paper. The input information to D T is the global schema which
3
GLOBAL SCHEMA

DISTRIBUTION TRANSACTION
CONSTRAINS INFORMATION

GRID CREATOR

GRID OPTIMIZER

Site Independent

ALLOCATOR

LOGICAL SCHEMA

PHYSICAL DESIGNER
Site Dependent

PHYSICAL SCHEMA

Fig. 3. Distributed database design tool reference architecture


consists of a set of relations, together with information about the important transactions
on the proposed database. As we have stated in our previous work [2], [4], it is not nec-
essary to collect information on 100% of the expected transactions (that would of course
be impossible). Since the 80-20 rule applies to most practical situations, it is adequate to
supply the 20% of the heavily used transactions which account for about 80% of the activity
against the database. The other input to the D T are the distribution constraints which
3

include preferences or special considerations designers/users may have that would in uence
partitioning and allocation. In this paper we deal with only the Grid Creator and Grid
Optimizer modules. The allocation problem has been considered in [14] and is not included
because of space constraints.
Grid Creator: is composed of two modules; they are the vertical and the horizontal parti-
tioning modules for grid creation. The output of the Grid Creator is a grid corresponding
to a global relation.
Grid Optimizer: performs merging as much as possible according to the merging algo-
rithms. The merging of the grid cells is an anti-fragmentation procedure. Having created
the cells in a top-down fashion as the \minimal" fragments of a relation, we now con-
sider whether we should combine them in a bottom-up fashion. Merging is considered
desirable if it reduces overall transaction processing cost. We shall use the representation
scheme in Section IV to provide us with an algorithm to generate the mixed fragments;
the criterion for merging the grid cells is to minimize the total number of disk accesses
to execute the transactions developed in [5].
Note that in this paper we essentially deal with mixed fragmentation of one relation at a
time. This methodology is not restricted to relational databases. A relation may be sub-
stituted by a record type in other systems with at record structures. The treatment of
allocation should bring in the e ect of processing of several relations together by a transac-
tion. Based on Figure 3, the proposed methodology for mixed fragmentation using a grid
can be described as follows.
A. Mixed Fragmentation Methodology
This procedure involves all activities prior to allocation in our approach. The steps of
the mixed partitioning methodology are illustrated in Figure 4. Note that the vertical and
horizontal partitioning steps can be done concurrently.
1. Speci cation of inputs: In this step, the following inputs are speci ed.
(a) schema information: relations, attributes, cardinalities, attribute sizes, predicates
used by the database operations, etc.
(b) transaction information: name, frequency, attribute usage, predicate usage, etc. The
attribute usage matrix is a matrix containing transactions as rows and attributes as
columns. Element (i; j ) = 1 if transaction i uses attribute j ; else it is 0. The transac-
tions are also classi ed into two types: \Retrieval" and \Update".
(c) distribution constraints: any predetermined partitions or xed allocation of data.
Specification of Input

Horizontal Partitioning Vertical Partitioning

Representation of Grid Cells

Mixed Fragments Generation

Fig. 4. Steps in Mixed Fragmentation Methodology


(d) system information: number of sites, transmission costs, etc. This information is used
particularly to solve the allocation problem.
Table I shows the transaction speci cation for the example being considered in this
paper. The predicate descriptions are presented in Section III-B.
Transactions Attributes Predicates Frequency Sites of Origin
T 1 a,a,a 1 p,p
5 7 25 s ;s
1 7 1 4
T 2 a,a ,a ,a
2 3 p,p 8 950 s ;s
2 7 2 4
T 3 a,a,a 4 p,p
3 10 25 3 s 7 4
T 4 a ,a ,a 2 p,p
7 8 35 4 s 8 1
T 5 a ,a , a , a , a , a , a
1 2 3 p,p
5 7 25 8 9 s ;s ;s
5 8 1 2 3
T 6 a ,a 1 p,p 5 25 s ;s
6 8 3 4
T 7 a ,a 3 p,p 9 25 5 s 8 4
T 8 a,a,a,a,a
3 4 p,p
6 9 15 10 s ;s ;s
6 8 3 1 2
TABLE I
Transaction Specification

2. Vertical partitioning for grid: In this step all candidate vertical fragments are deter-
mined. We use a graphical algorithm [6] for generating all fragments in one iteration.
An overview of this algorithm is given in Section 3.1.
3. Horizontal partitioning for grid: In this step, all candidate horizontal fragments are
determined. A method for this step is outlined in Section III-B. Note that steps 2 and
3 can be done concurrently.
4. Populating the system catalog with the representation of grid cells: A scheme for rep-
resenting grid cells and mixed fragments is developed and stored in the system catalog.
This representation scheme will be used by the algorithm to generate the mixed frag-
ments.
5. Mixed fragment generation: The number of disk accesses required to execute a trans-
action will be used to compute the optimal set of mixed fragments so as to minimize
the total number of disk accesses required to process the transactions. This measure
has been used in earlier studies [5], [7], [8] to come up with an optimal set of vertical
fragments.
III. Grid creation
A. Vertical partitioning for grid creation
Vertical partitioning is the process that divides a relation into sub-relations called vertical
fragments, containing subsets of the original attributes [2], [4], [9], [15]. Most of the previous
algorithms have started from constructing an attribute anity matrix from the attribute
usage matrix: the Attribute anity matrix is an n  n matrix for the n-attribute problem
whose (i; j ) element equals the \between-attributes" anity, which is the total number of
accesses of transactions referencing both attributes i and j . An iterative binary partitioning
method has been used in [4], [5], [16] based on rst clustering the attributes and then applying
empirical objective functions or mathematical cost functions to perform the fragmentation.
We have developed a new algorithm based on a graphical technique [6]. This algorithm
starts from the attribute anity matrix by considering it as a complete graph called the
\anity graph" in which an edge value represents the anity between the two attributes,
and then forms a linearly connected spanning tree. By a \linearly connected tree" we imply
a tree that is constructed by including one edge at a time such that only edges at the \ rst"
and the \last" node of the tree would be considered for inclusion. We then form \anity
cycles" in this spanning tree by including the edges of high anity value around the nodes
and \growing" these cycles as large as possible. After the cycles are formed, partitions are
easily generated by cutting the cycles apart along \cut-edges". Details of this algorithm
as well as an explanation of why it produces reasonable vertical fragments can be found in
[6]. For ease of reference, we shall refer to the above algorithm as the MAKE-PARTITION
algorithm.
The major feature of this algorithm is that all fragments are generated by one iteration in a
time of O(n ) that is more ecient than the previous approaches. We have implemented this
2

algorithm and have adapted it for the horizontal partitioning as described later in Section
III-B.
Attributes
Transactions 1 2 3 4 5 6 7 8 9 10 Type Access Freq
T1 1 0 0 0 1 0 1 0 0 0 R acc = 251
T2 0 1 1 0 0 0 0 1 1 0 R acc = 502
T3 0 0 0 1 0 1 0 0 0 1 R acc = 253
T4 0 1 0 0 0 0 1 1 0 0 R acc = 354
T5 1 1 1 0 1 0 1 1 1 0 W acc = 255
T6 1 0 0 0 1 0 0 0 0 0 W acc = 256
T7 0 0 1 0 0 0 0 0 1 0 W acc = 257
T8 0 0 1 1 0 1 0 0 1 1 W acc = 158

TABLE II
Attribute Usage Matrix

Table II shows the attribute usage matrix for a relation containing 10 attributes with
respect to 8 transactions, namely, T through T that are initiated by the applications. Table
1 8

III shows an example of an attribute anity matrix. Figure 5 shows the result of applying
our algorithm to the attribute anity matrix. In Figure 5 the nodes refer to attributes of
the relation (i.e., node i refers to attribute ai).
Attributes
Attributes 1 2 3 4 5 6 7 8 9 10
1 75 25 25 0 75 0 50 25 25 0
2 25 110 75 0 25 0 60 110 75 0
3 25 75 115 15 25 15 25 75 115 15
4 0 0 15 40 0 40 0 0 0 40
5 75 25 25 0 75 0 50 25 25 0
6 0 0 15 40 0 40 0 0 0 40
7 50 60 25 0 50 0 85 60 60 0
8 25 110 75 0 25 0 60 110 75 0
9 25 75 115 15 25 15 25 75 115 15
10 0 0 15 40 0 40 0 0 15 40
TABLE III
Attribute Affinity Matrix
The resulting vertical fragments are:
(1). (a , a , a )
1 5 7

(2). (a , a , a , a )
2 3 8 9

(3). (a , a , a )
4 6 10

Details of the graph theoretic algorithm can be found in [6]. We summarize the major
advantages of this method over the previous approaches:
40 10
Start Node
15 4
3 40
115 40
9 6

75
75

8
2 110

60

50 1
7

50 75

5
Fig. 5. Vertical fragments generated by graph-theoretic algorithm

1. There is no need for iterative binary partitioning. The major weakness of iterative
binary partitioning used in [4] is that at each step two new problems are generated
increasing the complexity; furthermore, termination of the algorithm is dependent on
the discriminating power of the objective function.
2. The method obviates the need for using any empirical objective functions as in [4]. As
shown by [5] the \intuitive" objective functions used in [4] do not necessarily work well
when an actual detailed cost formulation for a speci c system is utilized.
3. The method requires no complementary algorithms such as the SHIFT algorithm of [4]
that shifts the rows and columns of the anity matrix.
4. The complexity of this approach is O(n ) as opposed to O(n log(n)) in [4].
2 2

In the following subsection we show how the same algorithm may be applied to horizontal
partitioning.
B. Horizontal partitioning for grid creation
Horizontal partitioning is the process that divides a global relation into subsets of tu-
ples, called horizontal fragments [1], [2], [15]. Ceri, Negri and Pelagatti [1] analyzed the
horizontal partitioning problem, dealing with the speci cation of partitioning predicates.
Ceri, Navathe, and Wiederhold [2] proposed an optimization model for designing distributed
database schemas by taking into account all meaningful candidate horizontal partitionings.
This approach developed an integer programming solution to select an optimal candidate
horizontal partitioning for each relation.
In the present research, however, we do not consider the problem of selecting an optimal
horizontal partitioning for each relation in the database. Because our goal is to de ne the grid
and to consider the various options of combining the grid cells. We are focusing our atten-
tion on identifying all the candidate horizontal partitions. For this we propose a horizontal
partitioning methodology which will use an algorithm similar to the MAKE-PARTITION
algorithm in [6]. In order to use the MAKE-PARTITION procedure of our vertical partition-
ing algorithm we consider only those transactions whose processing frequency is large. These
transactions access tuples of the relations based on some simple predicates [1]. We limit the
scope of this paper by assuming that all simple predicates are previously determined.
As explained earlier with respect to the approach C in Figure 2, the focus of this paper
is on single relation mixed fragmentation. Hence join predicates of the form R1.A=R2.B
which deal with a pair of relations do not enter into the picture here. They are very much
a part of the allocation phase and are motivated by minimizing the e ort and cost of joins.
In contrast, horizontal partitioning approaches used in systems like Bubba [17] or Gamma
[18] attempt to achieve parallelism of join queries.
We outline our horizontal partitioning methodology by using a simple example below. The
inputs are a set of transactions and a corresponding set of predicates as follows (assume D-no
and SAL are attributes of a relation):
1. T1 : D-no < 10 (p1), SAL > 40K (p7)
2. T2 : D-no < 20 (p2), SAL > 40K (p7)
3. T3 : D-no > 20 (p3), SAL > 40K (p7)
4. T4 : 30 < D-no < 50 (p4), SAL < 40K (p8)
5. T5 : D-no < 15 (p5), SAL < 40K (p8)
6. T6 : D-no > 40 (p6), SAL < 40K (p8)
7. T7 : D-no < 15 (p5), SAL < 40K (p8)
8. T8 : D-no > 40 (p6), SAL < 40K (p8)
Note that the above set of predicates do not span all the tuples of the relation; tuples with
SAL=40k will not be accessed by any of the above transactions.
The algorithm that we propose starts with the predicate usage matrix which represents
the use of predicates in important transactions. The predicate usage matrix is illustrated
in Table IV. Columns correspond to \known" predicates used by transactions. Each row
refers to one transaction; the \1" entry in a column indicates that the transaction uses
the corresponding predicates. Whether the transaction uses the relation for retrievals or
updates can also be captured by another column with R and W for retrievals and updates
respectively.
Predicates
Transactions p 1 p
2 p3 p p p
4 5 6 p
7 p Type Access Freq
8
T 1 1 0 0 0 0 0 1 0 R acc = 25
1
T 2 0 1 0 0 0 0 1 0 R acc = 50
2
T 3 0 0 1 0 0 0 1 0 R acc = 25
3
T 4 0 0 0 1 0 0 0 1 R acc = 35
4
T 5 0 0 0 0 1 0 0 1 W acc = 25 5
T 6 0 0 0 0 0 1 0 1 W acc = 25 6
T 7 0 0 0 0 1 0 0 1 W acc = 25 7
T 8 0 0 0 0 0 1 0 1 W acc = 15 8

TABLE IV
Predicate Usage Matrix

Predicate anity is generated in a manner similar to attribute anity [4]. Table V shows
a predicate anity matrix generated from the predicate usage matrix in Table IV. The
numerical value of the (i; j ) element in this matrix gives the combined frequency of all
transactions accessing both predicates i and j and is obtained the same way as for vertical
partitioning. The value \)" of the (i; j ) element indicates that predicate i implies predicate
j , and the value \*" represents the \close" usage of predicates. Two predicates i and j are
\close" when the following conditions are satis ed:
1. i and j must be de ned on the same attribute,
2. i and j must be jointly used with some common predicate c, and
3. c must be de ned on an attribute other than the attribute used in i and j .
This is reasonable because predicates i, j , and c are di erent from one another and thus
two fragments generated by predicates i, c and predicates j , c are considered \closely related"
since they both involve predicate c. In the above example, p and p are \close" because of
1 2

their usage with common predicate p in transaction T and T .


7 1 2

Predicates
Predicates p 1p p 2 3 p4 p p 5 6 p7 p8
p 1 ), \*" \*" 0 0 0 25 0
p 2 (, \*" \*" 0 0 0 50 0
p 3 \*" \*" ( 0 0 25 0
p 4 0 0 ) \*" \*" 0 35
p 5 0 0 0 \*" \*" 0 50
p 6 0 0 0 \*" \*" 0 40
p 7 25 50 25 0 0 0 0
p 8 0 0 0 35 50 40 0
TABLE V
Predicate Affinity Matrix

C. Procedure Horizontal-Partitioning
1. Construct a predicate usage matrix: Predicate usage matrix represents the use of pred-
icates in important transactions. The predicate usage matrix for the example (8 predi-
cates and 6 transactions) is shown in Table IV. Each row refers to one transaction: the
\1" entry in a column indicates that the transaction uses the corresponding predicates.
2. Form a predicate anity matrix: Predicate anity matrix is generated in a manner
similar to generation of attribute anity matrix. Table V shows a predicate anity
matrix generated from the predicate usage matrix in Table IV. The numerical value of
the (i; j ) element in this matrix gives the combined frequency of all transactions accessing
both predicates i and j . The value \)" of the (i; j ) element indicates that predicate i
implies predicate j , the value \(" of the (i; j ) element indicates that predicate j implies
predicate i, and the value \*" means that two predicates i and j are \similar" in that
both are used jointly with some predicate c. That is, there exists some transaction T
which uses predicates i and c and some other transaction T 0 which uses predicates j and
c.
3. Perform clustering of predicates: It is done by using the modi ed version of the MAKE-
PARTITION graphical algorithm in [6]. This modi ed algorithm is obtained by adding
the following heuristic rules:
(a) A numerical value (except zero) has higher priority than the values \)", \(" and
\*" when selecting a next edge during the progression of the algorithm. This is because
more importance is placed on anity values which are obtained from transaction usage
rather than on logical connectivity among the predicates.
(b) In comparisons involved to check for the possibility of a cycle or extension of a cycle,
cycle edges with anity values \)", \(", and \*" are ignored. For example, in Figure
6, in comparing edge (p ; p ) with edges of the cycle (p ; p ; p ) the edge (p ; p ) which
4 8 8 5 6 5 6

has anity \*" is ignored. This is because the anity values \)", \(" and \*"
represent implicit logical relationships among the predicates and not actual anity
between the predicates. These implicit relationships are used to reduce the number of
horizontal fragments.
(c) \)" and \(" are considered to have higher anity value than \*" since the latter
only represents logical connectivity between the two predicates through their usage
with a common predicate.
(d) If there are two \)" relationships in a column corresponding to predicate pk , one
implied by predicate pi and other implied by predicate pj , then the entry (i; k) has
higher priority than the entry (j; k), if the entry (i; j ) is equal to \(", and the entry
(j; k) has higher priority than the entry (i; k) if the entry (i; j ) is equal to \)". In
other words, if pi ! pj ! pk then j has higher priority than i else if pj ! pi ! pk
then i has higher priority than j .
In this step a set of subsets of predicates are obtained. In this example, by using the
above rules and the MAKE-PARTITION algorithm, three subsets of predicates as shown
in Figure 6: (p ; p ; p ), (p ; p ), (p ; p ; p ) are obtained.
1 7 2 3 4 5 6 8

4. Optimize predicates in each subset: In this step predicate inclusion and predicate im-
plication are considered to minimize the number of predicates. In our example, the rst
subset (D-no < 10, D-no < 20, SAL> 40K) is re ned into (D-no < 20, SAL> 40K) since
D-no < 10 ) D-no < 20, the second one (D-no > 20, 30< D-no < 50) is also re ned into
(D-no > 20) since 30< D-no < 50 ) D-no > 20, but the last one (D-no < 15, D-no >
40, SAL< 40K) has no change. Note that this optimization can be done before step 3.
But in this paper, this step is performed here in order to allow a pair of predicates such
as p and p in which one (namely, p ) implies another (namely, p ) to be grouped in
1 2 1 2

di erent clusters in step 3. The three clusters of predicates produced in this step called
\cluster sets", are listed in Figure 6.
25
D#<10 p1 p
7 SAL>40K

<== 50

p
D#<20 2

p D#>20
3

==>

p
4 30<D#<50
35

SAL<40K p
8
40

50 p
6 D#>40

p *
5
D#<15 Cluster Sets produced:
{D#<20, SAL>40K}
{D#>20}
{D#<15, D#>40, SAL<40K}

Fig. 6. Clustering of predicates using a graph-theoretic algorithm

5. Compose predicate terms: The cluster sets are rst evaluated to determine \the least
common attribute". In our example, since SAL does not appear in cluster set 2 (
corresponding to the second cluster of predicates), it is the least common attribute.
Note that D# appears in all three sets. A table called the \predicate term schematic
table" is now considered by placing in the rst column the chosen attribute with its
appropriate ranges to cover that attribute exhaustively. In our example, two entries are
created: SAL < 40K and SAL > 40K for the SAL attribute. Then, the next to least
common attribute is applied and then its appropriate ranges that appear in the cluster
sets are written against each entry for the rst column. Note that these ranges may
be overlapping. In our example, D# is the next attribute. Its ranges applicable to the
cluster sets are: D# < 15 or D# > 40 coupled with SAL < 40K (from cluster set 3),
and D# < 20 coupled with SAL > 40K (from cluster set 1). The D# > 20 predicate
appearing in cluster set 2 must be written twice into the table against each entry for
SAL. This resulting predicate term schematic table is shown at the top in Figure 7. Now
predicate terms are constructed from the above tables as follows. Each horizontal entry in
the table gives rise to one predicate term. If predicates refer to the same attributes then
they are OR-ed (disjunction), otherwise they are AND-ed (conjunction). The resulting
predicates are as follows:
(a) SAL< 40K AND D-no > 20,
(b) SAL< 40K AND (D-no < 15 OR D-no > 40),
(c) SAL> 40K AND D-no < 20,
(d) SAL> 40K AND D-no > 20.

Predicate Term Schematic Table

D#>20 (p , p )
3 4
SAL < 40k
D# < 15 OR (p )
5
(p ) D# >40 (p )
8 6

D#<20 (p , p )
1 2

SAL > 40k


(p , p )
(p ) D#>20 3 4
7

ELSE

ADJUST

Nonoverlapped Fragments

SAL < 40k AND D#>20 a (p , p , p , p )


3 4 6 8

SAL < 40k AND D# < 15 b (p , p )


5 8
SAL > 40k AND D#<20 c (p , p , p )
1 2 7
SAL > 40k AND D#>20 d ( p p p
3 , 4 , 7)

ELSE
e

Fig. 7. Non-overlapping horizontal fragments generation

6. Perform fragmentation: There is one horizontal fragment per predicate term. Thus the
number of horizontal fragments will at most equal the number of predicate terms plus
one because there is one remaining fragment, called the \ELSE" fragment, which is the
negation of the conjunction of all predicate terms.
7. Restructure overlapping horizontal fragments: The result of predicate partitioning may
give rise to overlapping horizontal fragments. In order to generate non-overlapping frag-
ments the ADJUST function is used. The ADJUST function takes as input the set
of overlapping horizontal fragments and generates a set of non-overlapping horizontal
fragments.
The resulting horizontal fragments are:
(a) (SAL < 40k) AND (D# > 20)
(b) (SAL < 40k) AND (D# < 15)
(c) (SAL > 40k) AND (D# < 20)
(d) (SAL > 40k) AND (D# > 20)
(e) ELSE
The attractive features of this approach are as follows:
1. Fragments are based on actual predicates. By applying implication between predicates,
the number of fragments is reduced.
2. Horizontal fragmentation is treated in a similar manner to vertical fragmentation. The
algorithm for vertical fragmentation is reused with changes to incorporate additional
features (e.g., ), *).
3. 0-1 integer programming formulation is not needed; hence the complexity of the solution
approach is reduced.
4. By using a clustering of predicates a relatively small number of horizontal fragments are
generated. The approach taken by [1] can generate 2n number of horizontal fragments
for n simple predicates.
It should be noted that the complexity of this algorithm is dominated by step 3, and
thus will be O(n ) for n predicates as in the case of the vertical partitioning algorithm in
2

Section III-A. A smaller value of n can result from a good understanding of the heavily used
predicates by users. A comparable value for the number of predicates can be derived by
clustering the tuples accessed by the transactions based on some attribute domain values,
and de ning each cluster as a predicate.
D. Grid Cells
In the last two subsections the algorithms for generating the vertical and horizontal frag-
mentation schemes have been described. Once the horizontal and vertical fragments are gen-
erated, the grid cells are generated by either applying the horizontal fragmentation scheme
on each of the vertical fragments or by applying the vertical fragmentation scheme on each
of the horizontal fragments. Therefore, each grid cell belongs to exactly one horizontal frag-
ment and one vertical fragment. If the vertical fragmentation scheme generates n vertical
fragments and the horizontal fragmentation scheme generates m horizontal fragments, then
n  m grid cells will be generated.
IV. Representation Scheme for Mixed Fragments
A grid is created by applying both the horizontal and vertical fragmentation schemes on
the relation. Let V = (1; 2; : : : ; n) be the set of vertical fragments and H = (a; b; : : :; m) be
the set of horizontal fragments of a relation respectively. The grid generates a set of grid cells
wherein each grid cell belongs to exactly one horizontal and one vertical fragment of the rela-
tion. The set of grid cells are represented as (1a; 1b; : : : ; 1m; 2a; 2b ; : : :; 2m ; : : : ; na; nb; : : :; nm).
For the examples presented in Sections III-A and III-B, the vertical and horizontal fragmenta-
tion algorithms produced three vertical fragments and ve horizontal fragments, respectively.
Figure 8 shows the grid cells formed by simultaneously applying both these horizontal and
vertical fragmentation schemes on the relation.

1a 2a 3a

1b 2b 3b

1c 2c 3c

1d 2d 3d

1e 2e 3e

Fig. 8. Representation of grid cells

The set of grid cells are classi ed as horizontal grid cells or vertical grid cells. The set
of vertical fragments of a horizontal fragment form horizontal grid cells. For a horizontal
fragment p they are represented as (1p; 2p; : : :; np). In Figure 8, the set (1b; 2b ; 3b) forms the
set of horizontal grid cells for the horizontal fragment b. The set of horizontal fragments of
a vertical fragment are known as vertical grid cells of that fragment. The vertical grid cells
of a vertical fragment i are represented as (ia; ib; : : :; im). For example, in Figure 8 the set
of grid cells (2a; 2b ; 2c; 2d ; 2e ) form the vertical grid cells for the vertical fragment 2. Two
binary operations concatenate (k) the horizontal merging operator, and union (S) the vertical
merging operator, on the set of horizontal grid cells and vertical grid cells respectively are
de ned. The concatenate operator is a special case of join operator where only corresponding
tuple id's of the relations are matched. Note that all the relations involved in the concatenate
operation have the same number of tuples and that these relations have the same set of tuple
identi ers.
Given two vertical grid cells ip and iq , the union of ip and iq is represented as (ip;q) = ip S iq
and given two horizontal grid cells ip and jp, the concatenation of ip and jp is represented
as (ip; jp) = ipkjp. The binary operations S and k are commutative and associative over the
set of vertical grid cells and horizontal grid cells respectively.
A. Characteristics of and valid operations on grid cells
The grid cells will be represented as where = 1; 2; : : : ; n and = a; b; : : :; m. is the
\column" index and is the \row" index for a grid cell. A well formed expression over the
set of grid cells is de ned as follows:
De nition 1: A well formed expression w is de ned as follows:
1. w = , is well formed where = 1; 2; : : : ; n and = a; b; : : :; m. r(w) = is the
representation of w.
2. w = k is well formed if 6= and = . r(w) = ( ; ) is its
1 1 2 2 1 2 1 2 1 1 2 1

representation.
w = S is well formed if = and 6= . r(w) = ( ; ) is its represen-
1 1 2 2 1 2 1 2 1( 1 2)

tation.
3. w0 = kw is well formed if there exists a grid cell represented by 0 in r(w).
r(w0) = r(w) S is its representation.
w0 = S w is well formed if there exits a grid cell represented by 0 in r(w). r(w0) =
r(w) S is its representation.
4. Any number of possible invocations of the above set of rules.
The representation of a well formed expression is a shorthand notation for the set of grid
cells over which the well formed expression is de ned. Since r(w) is a set of grid cells,
we can perform set theoretic operations on the representations of well formed expressions,
like, membership 2 r(w), intersection r (w) \ r (w), and union r (w) [ r (w). The
1 2 1 2

above de nition of well formed expression incorporates the discipline that is to be imposed
while merging the grid cells during the grid optimization phase of the mixed fragmentation
methodology. In Figure 8, the grid cells 1a and 1b can be merged (using the rule 2 above,
since = = 1, and = a, and = b, implies 1 a;b = 1a S 1b ), whereas the grid cells 1a
1 2 1 2 ( )

and 2c cannot be merged. Note that in forming the well formed expression, two grid cells are
concatenated only if they both are horizontal grid cells of the same horizontal fragment, and
a union of two grid cells is allowed only if they both are vertical grid cells of the same vertical
fragment. Hence the conditions on the grid cells ( ) in the rules 2 and 3 of the de nition
above. From the above de nition of the well formed expression, a set of valid operations
which need to be performed on the grid cells to generate a set of legal mixed fragments
are derived. In general, a well formed expression w is represented as ( A ; A ; : : : ; pAp )
1 1 2 2

where 1  j  p with each i representing a vertical fragment and each Ai representing a


set of vertical grid cells of vertical fragment i participating in the union operation.
De nition 2: A regular well formed expression is a well formed expression
w = kii pfS 2Ai ( i )g where A = A = : : : = Ap = A.
=

That is, w = kii pfS 2A( i )g and r(w) = ( A; A; : : : ; pA ).


=1 1 2
=
=1 1 2

The above condition states that the set of vertical grid cells Ai in the formation of the
fragment is the same for all vertical fragments i.
De nition 3: A Fragment is the result of a well formed expression over a set of grid cells.
A regular fragment is the result of a regular well formed expression over the set of grid cells.
For example, in Figure 8, the grid cells 1a, 1b , 2a and 2b form a regular fragment (1 a;b ,
( )

2 a;b ), whereas the fragment (1 a;b , 2b) formed by merging the grid cells 1a, 1b , 2b is not
( ) ( )

regular. It should be noted that each regular fragment corresponds to a table in the relational
database. If the fragment is not a regular fragment, it will be dicult to represent it as a
single relation without introducing null values.
Each grid cell belongs to exactly one horizontal and one vertical fragment and hence
each grid cell is bounded by columns in the vertical fragment and the predicate de ning
the horizontal fragment it belongs to. A fragment has been de ned as the result of a well
formed expression over the set of grid cells. The attributes of a regular fragment are columns
(given by the union of the columns of all vertical fragments in the well formed expression)
of the fragment and the binding predicate (given by the disjunction of all the predicates
de ning the horizontal fragments in the well formed expression) of the fragment. All tuples
in the fragment satisfy the binding predicate. The system catalog of the distributed database
system needs to store and manage the meta-data describing these attributes or characteristics
of a fragment. The system catalog also stores and maintains the representation scheme along
with the fragment names.
A transaction projects a set of attributes from a relation and selects tuples from the relation
based on some conditions on the attributes of the relation de ned by the predicates. Only
those transactions that access single relations are considered. This is because, if a transaction
accesses multiple relations, then there has to be either a join or union of relations. In case of
union, there is no condition spanning multiple relations, but in case of join, there is at least
one join condition that spans two relations. Since the join condition spans all the tuples of
both relations, it does not e ect the horizontal partitioning schemes of both the relations.
The span of a transaction t is de ned as S (t) = f(C ; C ; : : :; Cn); (P ; P ; : : : ; Pm)g, where
1 2 1 2

C ; C ; : : :; Cn are columns being projected, and P ; P ; : : : ; Pm are the predicates used in


1 2 1 2

conditions to select the tuples being accessed by the transactions. Note that partitioning the
relation vertically based on attribute (column) anities and horizontally based on predicate
anities means that the columns Ci's and predicates Pj 's belong to some set of vertical
fragments C (t) = f t where Ci 2 t; i = 1; 2; : : : ; ng and horizontal fragments P (t) = f t
where Pj 2 t; j = 1; 2; : : : ; mg respectively.
Theorem 1: A Transaction Accesses Regular Fragment
The set of grid cells f T T where T 2 C (T ) and T 2 P (T )g accessed by a transaction
T forms a regular fragment.
Proof: Let the set P (t) for a transaction T be f T ; T ; T ; : : : mT g = A, be the set of
1 2 3

horizontal fragments accessed by the transaction T .


Let f T ; T ; T ; : : :; Tn g be the set of vertical fragments accessed by transaction t.
1 2 3

Then for each of the vertical fragments Ti the transaction T accesses the tuples across
the horizontal fragments A, because the predicates de ning the conditions for ltering the
tuples of the relation for the transaction T span the horizontal fragments in A.
Hence the transaction accesses all the grid cells de ned by f T A; T A ; T A ; : : :; Tn Ag and
1 2 3

this is a representation of a regular fragment. Therefore, any transaction T accesses a set of


grid cells representing a regular fragment. 2
De nition 4: Given f1 and f2 as two fragments with their representations r1 and r2 respec-
tively. The intersection of two fragments, f1 intersection f2 as the fragment f1 T f2 whose
representation is given by r(f1 T f2) = f j 2r1 and 2r2g.
Theorem 2: Regular Fragment Intersection Closure Intersection of two regular fragments
is a regular fragment.
Proof: Let f1 and f2 be two regular fragments with representations r1 and r2 respectively.
Let r1 = ( 1A ; 2A ; : : : ; pAp ) where A1 = A2 = : : : = Ap.
1 2

and
r2 = ( 01A0 ; 02A0 ; : : :; 0q A0q ) such that A01 = A02 = : : : = A0q .
Case 1: If r1 T r2 is empty then it is a regular fragment.
1
2

Case 2: Let r1 T r2 be not empty; then there exists such that 2 r1 and 2 r2 .
This implies that there exists some i and some j such that 2 iAi and 2 0j A0j .
That is, Ai T A0j 6= ; which implies that Ai T A0j 6= ;; 8 i; j . Therefore, let B = Ai T A0j for
all i and j .
Let I = f B j B 2 r1 T r2g.
Let 1 be the smallest value of 2 I and let 2 be the largest value of 2 I .
Therefore 1  2. Then by the de nition of fragments f1 and f2 it follows that r(f1 T f2) =
f 1B ; : : : ; k B ; : : : ; 2B g. This representation is that of a regular fragment. Hence the inter-
section of two regular fragments is a regular fragment. 2

B. Mapping of grid cells to transactions


The grid cells after the grid creation phase of the initial design are represented as G =
f where = 1; 2; : : : ; n and = a; b; : : :; xg. The transactions accessing the grid cells are
represented as T = fTi where Ti accesses the relation Rg.
Let T be a function T : G ?! T , that maps the grid cells to the transactions Ti
which accesses them. Figure 9 shows the mapping of transactions to the grid cells for our
example.
With respect to our example: T (1a) = fT ; T g, T (1b ) = fT g, T (1c) = fT g, T (2a)
4 6 5 1

= fT ; T g, T (2b) = fT ; T g, T (2c) = fT g, T (3a ) = fT g, T (3d) = fT g, and for the


4 8 5 7 2 8 3

rest it is ;.
Grid Cell 1a 2a 3a
Trxn’s accessing T4 T6 T4 T8 T8
the grid cell

1b 2b 3b
T5 T5 T7

1c 2c 3c

T1 T2

1d 2d 3d
T3

1e 2e 3e

Fig. 9. Mapping of Transactions to the Grid Cells


De ne set T = f j T ( ) 6= ;g.
(1)

Therefore, from the above example, the set T = f1a ; 1b; 1c ; 2a; 2b; 2c ; 3a; 3dg. (1)

Intuitively, T is the set of all grid cells that are accessed by at least one transaction.
(1)

De ne T = f( i j ; k l ) j T ( i j ) T T ( k l ) 6= ;g.
(2)

This de nes a pair of grid cells ( i j ; k l ) which are accessed by at least one transaction Tk.
Therefore, from the above example, the set T = f(1a; 2a ); (2a; 3a); (1b; 2b)g. (2)

In general, de ne,
T k = f( i j ; i j ; : : : i k? j k? ; ik j k ) j Tpp k T ( ip j p ) 6= ;g
( )
1 1
2 2
( 1)
=
=1

where k = 1; 2; : : : ; card(V )  card(H ), ip 2 f1; 2; : : : ng and j p 2 fa; b; : : :xg and ip j p 's


( 1)

are all distinct. Each element of T k represents a k-tuple of grids accessed by at least one
( )

transaction.
Represent
T k = f(f k ); (f k ); : : :; (fmk )g; k = 1; 2; : : : ; card(V )  card(H )
( )
1 2

where each fik = ( i j ; i j ; : : : i k? j k? ; ik j k ).


1
1
2
2
( 1)

With respect to the example above, T = ff ; f ; f g where f = (1a; 2a) and f =


( 1)
(2) 2 2 2 2 2
1 2 3 1 2

(2a; 3a) and f = (1b ; 2b).


2
3

Moreover, note that T = T = : : : = T (3)


= ;. This is because no transaction
(4) (15)

accesses more than two fragments. In general, there could be transactions accessing the
complete relation.
V. Grid Optimization
In this section, a cost model to evaluate the merging decision is rst described. After that
the algorithms to merge the grid cells to optimal mixed fragments are presented.
A. Cost model for merging
Let the number of tuples (cardinality), and the length of the tuple (in case of variable
length columns, the average length of tuple) be known for each grid cell. The page size and
the prefetch blocking factor are assumed to be the same (constants) across the distributed
database environment and are known in advance. Then the number of disk accesses taken
by a transaction to access a grid cell by using segment scan is given by
(Cardinality )(LengthOfTuple)
(( pagesize)(PreFetchBlockingFactor))

The number of disk accesses required for a transaction by using a clustered index is
(Cardinality)(selectivity)(LengthOfTuple)
(pagesize)

The number of disk accesses required for a transaction by using a non-clustered index is

(Cardinality)(Selectivity).

All of the above formulae have been used in earlier research [5]. For a merged regular
fragment represented by f A; A; : : : ; nA g its cardinality is the sum of the cardinalities of
1 2

the vertical grid cells in A and the length of its tuple is the sum of the lengths of tuple of 1

the horizontal grid cells f ; ; : : :; ng. But for the purposes of deciding whether to merge
1 2

the grid cells or not, the above formulae are used. For a regular fragment f :
The number of disk accesses N s (f ) required by a set of transactions s to access the
fragment using segment scan is given by:

N s (f ) = Pt2s Cardinality
(
f LengthOfTuple f
pagesize prefetchblockingfactor freqt
(
)(
( ))( ( ))
)

The number of disk accesses N c (f ) required by a set of transactions c to access the


1
Note that this is an approximate value that can be smaller or larger than the actual value depending on the
implementation of the storage manager.
fragment using a clustered index is given by:

N c (f ) = Pt2c Cardinality f
( ( ))(Selectivity(ft ))(LengthOfTuple(f )) freq
(pagesize) t

where Selectivity(ft) gives the fraction of the rows of a relation accessed by transaction t.
The number of disk accesses Nu (f ) required by a set of transactions u to access the
fragment using a non-clustered index is given by:

N u (f ) = Pt2u (Cardinality (f ))(Selectivity (f ))freqt


t

Let R (f ) denote a fragment f which is not merged (i.e. it is a loose collection of grid
cells). Let f denote the merged fragment.
In order to decide whether or not to merge the grid cells to form a mixed fragment, the total
number of disk accesses required by all the transactions, using di erent indexing schemes
and segment scan are considered. If the merging of grid cells results in a smaller number of
disk accesses, then the grid cells are merged else not.
That is, if:
N s (f ) + N c (f ) + N u (f )  N s0 ( R (f )) + N c0 ( R (f )) + N u0 ( R (f ))
then merge the grid cells. The CPU cost is ignored as it is very small compared to the
disk I/O cost.
B. Merging algorithm
The motivation for merging grid cells is to increase the transaction processing eciency,
this is done by reducing the total number of disk accesses needed for processing all the
transactions. A transaction can access one or more grid cells forming a regular fragment,
also a grid cell can be accessed by one or more transactions. There are di erent types of
accesses that can be used by the transactions namely, clustered index, non-clustered index
and segment scan. Therefore, only the sets of grid cells that are accessed by at least one
transaction are considered. For each such set, we check whether they can be merged to form
a regular fragment. If so, these sets of grid cells can be potentially merged to form a mixed
fragment.
The algorithm considers the merging possibilities in the sets of grid cells fik 2 T k where
( )

k = 2; 3; : : : ; card(V )  card(H ) and j = 1; 2; : : : ; kn. Let M be the sets of grid cells that
can be merged to form regular fragments. Then the algorithm for grid optimization is as
follows:
Merging Possibilities()
1. Let M = ;.
2. For k = 2; 3; : : : ; card(V )  card(H ), consider T k : ( )

(a) For each set of grid cells (fik ) in T k which forms a regular fragment, if
( )

Ns (fik ) + Nc (fik ) + Nu (fik )  Ns0 (R(fik )) + Nc0 (R(fik )) + Nu0 (R(fik )) (1)
then merge the grid cells else not.
(b) If (fik ) is selected to be merged then M = M S(fik ).
M is the set of sets of grid cells fik which are possible candidates for merging. But some
of these merging possibilities (fik ) may have some grid cells common with other merging
possibilities.
Claim 1: The algorithm Merging Possibilities() generates all the mixed fragments.
Justi cation: The above claim is supported by the following points:
1. The step 1 of the algorithm initializes the set of possible mixed fragments to an empty
set.
2. The steps 2(a) and 2(b) are executed for each of the sets of grid cells de ned by (fik ) 2
T k and the following points are validated:
( )

(a) The fact that the set of grid cells fik form a regular fragment can be checked by using
the de nition of the well formed expression. If the representation of the well formed
expression satis es the condition for regular fragment, then the set of grid cells fik
forms a regular fragment.
(b) For a set of grid cells fik if equation 1 is satis ed then it implies that the number of
disk I/O's is less if the set of grid cells fik are merged to form a mixed fragment. The
reason for this conclusion is presented in the Section V-A.
(c) In step 2(b), only those sets of grid cells fik that reduce the number of disk I/O's to
process all the transactions are included in the set M .
3. Therefore, the set M consists of sets of grid cells fik , all of which form mixed frag-
ments. All the possible sets of grid cells fik accessed by at least one transaction are
tested to check if they form a regular fragment; furthermore, those sets of grid cells fik
which satisfy equation 1 are included in the set M . Therefore, the set M consists of
all those sets of grid cells that form regular mixed fragments. 2
The above algorithm can generate an overlapping set of mixed fragments. That is, a set
of mixed fragments wherein each grid cell may belong to one or more mixed fragments.
There are two scenarios for overlapping mixed fragments, i) is pure overlapping case when
the two mixed fragments have at least one grid cell which is not present in the other, and
ii) contained-in case when all the grid cells belonging to one mixed fragment are contained
in the other mixed fragment.

g- g- g-
f - f - tlc t trc
c t

f - r g- g g -ls f g-
s s rs

g- g-
b c
g- g- g-
blc b brc

Overlapping Fragments
Contained-in fragments
Fig. 10. Overlapping and Contained-in Fragments

C. The case of overlapping fragments


Let f and g be two fragments that can be merged from the set M de ned above, such
that f T g 6= ;. Note that f and g are both regular fragments. Let r = f T g, which is also
a regular fragment. De ne f ? = f ? r and g? = g ? r; note that f ? T g? = ;, f ? 6= ; and
g? 6= ;. Now, in order to generate a non-overlapping mixed fragmentation scheme, the set
of grid cells r must be considered separately, and the set of grid cells f ? or/and g? must be
considered separately.
Note that the sets of grid cells f ? and g? may not form regular fragments, but they can be
de ned as a collection of regular fragments; therefore, f ? and g? need to be represented as a
collection of regular fragments. There may be more than one way to represent the fragments
f ? and g? as a collection of regular fragments. All the possible alternatives to generate
the set of non-overlapping mixed fragments from an overlapping set of mixed fragments
are compared and the one that minimizes the total number of disk I/O's to process the
transactions is selected.
The various alternatives for generating the non-overlapping mixed fragments from the over-
lapping mixed fragments are now described. As shown in the Figure 10, for two overlapping
fragments f and g without any loss of generality f can be written as, f = r + fs? + ft? + fc?
2

and g = r + gs? + gb? + gc?, where fs? and gs? are the sets of grid cells to the sides of the
regular fragment r, and ft? and gb? are the set of grid cells which are either above or below
the regular fragment. And gc? and fc? are grid cells in the corner.
The set of regular fragments ffs?; ft? ; fc? g can be generated by comparing the representa-
tion scheme of fragment r with representation schemes of fragments f and g. The grid cells
in ft? is de ned by the set of grid cells in f whose horizontal fragments are not in r but whose
vertical fragments are in r. Similarly, the grid cells in fs? is de ned by the set of grid cells in
f whose horizontal fragments are the same as that of r, but whose vertical fragments are not
the same as that of r. And the grid cells in fc? are the set of grid cells in f whose horizontal
fragments and vertical fragments do not belong to the vertical or horizontal fragments from
r. In a similar manner, the grid cells in gs?, gb? , and gc? are de ned. Note that in the above
set of alternatives some of the elements like fs? may be empty sets. Note that all of the
above sets of grid fragments are regular and moreover, gs? S gc? is regular, gc? kgb? is regular,
so are fs? S fc? , and ft? kfc?. In order to generate non-overlapping fragmentation schemes,
the following alternatives for fragments f and g need to be considered.
Evaluate Overlapping Fragments()
1. For each pair of overlapping fragments f , g 2 M do:
(a) ffs? ; ft? ; fc? g vs ffs? ; ft? kfc?g vs fft?; fs? S fc? g.
(b) fgs? ; gb?; gc? g vs fgs? ; gc?kgb? g vs fgb? ; gs? S gc? g.
(c) Select the alternative from above which gives rise to the least number of disk I/O's
to process the transactions as described in Section V-A
Note that each alternative rede nes the fragment f ? or g? as a set of non-overlapping
2
The operator + is used as a common notation for Concatenation and Union operations so as to not complicate
the expression. It is clear from the expression and Figure 10 as to when + means concatenation and when it means
union.
regular fragments. With respect to the example in Figure 11. for the overlapping mixed
fragments f and g, r = f2 b;c ; 3 b;c g, ft? = f2a; 3ag, fc? = f1ag, gb? = f2d; 3d g, gc? = f4d g,
( ) ( )

fs? = f1 b;c g, and gs? = f4 b;c g.


( ) ( )

1a 2a 3a

g 2b 3b 1a 2a f
1b

1c 2c 3c 1b 2b

Contained-in Grid Cells.

1a 2a 3a 2b 3b 4b

1b 2b 3b
f 2c 3c 4c g
1c 2c 3c
2d 3d 4d

Overlapping Grid Cells


Fig. 11. Example of overlapping and contained-in mixed fragments

D. The case of contained-in fragments


Let f and g be two fragments such that f T g = f . In this case, the fragment g can be
written as, (see Figure 10) g = (f + gt? + gb? + gls? + grs? + gblc
? + g ? + g ? + g ? ) where
brc tlc trc
3

g? = g ? f . Note that the grid cells belonging to regular fragments gtlc, gt , etc,. are
? ?
de ned by ordering the horizontal fragments so that there are some horizontal fragments
above the horizontal fragments de ning f , and there are some horizontal fragments below,
and there are vertical fragments to the left and right of the vertical fragments de ning f .
Then using a similar reasoning as in case of overlapping fragments, the regular fragments
covering fragment f can be de ned. For example, the regular fragment gtrc ? is de ned by
the grid cells generated by intersecting the set of horizontal fragments above those in f and
a set of vertical fragments to the right of those in f . In order to generate non-overlapping
fragments the following alternatives need to be considered. Note that the set of grid cells g?
3
The subscripts t and b mean top and bottom, rs and ls mean right and left side respectively and blc , brc , tlc , trc
represent the fragments at four corners of f , for e.g, top-left-corner, etc,.
may not form a regular fragment.
Evaluate Contained in Fragments()
1. For each pair of contained in fragments f , g 2 M do:
(a) fgrs? S gtrc
? S g? ; g? S g? S g? ; g? ; g?g
brc ls tlc blc t b
S S
(b) fgrs? gtrc gbrc ; gls gtlc
? ? ? S ? ; g ? ; g ? ; g ? g vs fg ? S g ? S g ? ; g ? S g ? ; g ? kg ? ; g ? g vs
blc t b rs trc brc ls tlc blc b t
S S ? S ? ? ? ? S ? S ? ? S
fgrs? gtrc gbrc ; gls gblc ; gtlc; gt ; gb g vs fgrs? gtrc gbrc ; gls gblc ; gtlc? kgt? ; gb?g,
? ? ?
(c) fgls? S gtlc
? S g ? ; g ? S g ? ; g ? ; g ? ; g ? g vs fg ? S g ? S g ? ; g ? S g ? ; g ? kg ? ; g ? g vs
blc rs trc brc t b ls tlc blc rs trc brc b t
? S ? S ? S ? ? ? ? ? S
fgls gtlc gblc ; grs? gbrc ; gtrc; gt ; gb g vs fgls gtlc S gblc? ; grs? S gbrc
? ? ; g ? kg ? ; g ? g,
trc t b
(d) Select the alternative from above which gives rise to the least number of disk I/O's
to process the transactions as described in Section V-A
Among all the choices above the representation that has the least number of disk i/o's to
process all the transactions is chosen (as described in section V-A). Note that some of the
fragments like gtrc ? , g ? , g ? , g ? , g ? , g ? , g ? , g ? may be empty, thus reducing the number
t ls rs trc tlc blc brc
of alternatives.
With respect to the example in Figure 11, r = f1 a;b ; 2 a;b g, gt? = gls? = gblc
( ) ( )
? = g? = g? =
tlc trc
;, gb = f1c ; 2cg, gbrc = f3c g and grs = f3 a;b g.
? ? ? ( )

In this section an algorithm to generate the overlapping mixed fragments by merging the
grid cells is presented. Two ways of decomposing the overlapping mixed fragments to non-
overlapping mixed fragments are described. These algorithms are used to merge the sets of
grid cells based on the transaction semantics and the number of disk accesses required to
process the transactions.
Grid Optimization()
1. Merging Possibilities()
2. Sort the candidate mixed fragments in M in the descending order of the number of
grid cells forming the mixed fragment.
(a) Get the rst mixed fragment f in M which has some other mixed fragment g, such
that g is contained in f .
 Evaluated Contained in Fragments()
(b) Else get the rst mixed fragment f in M which has some other mixed fragment g,
such that f and g are overlapping.
 Evaluate Overlapping Fragments()
(c) If there are none which are overlapping or contained-in, then exit the algorithm, else
go to step 2.
Claim 2: The algorithm Grid Optimization() generates the non-overlapping mixed frag-
mentation.
Justi cation: In the rst step the routine Merging Possibilities() is called to generate a set of
merging possibilities to form mixed fragments. But as elaborated earlier the merging possi-
bilities may generate an overlapping fragmentation scheme. Therefore, the mixed fragments
in M are sorted in descending order of the number of grid cells per mixed fragment. This is
because the larger the mixed fragment, the greater the probability that it is overlapping with
some other mixed fragment, or some other mixed fragment is contained in this fragment.
This ordered list is searched until two mixed fragments that are overlapping or contained
are found. The contained-in case is rst considered so as to rede ne the larger mixed frag-
ment for processing all the transactions eciently. In case of the overlapping fragments only
some grid cells are common to both the fragments and rede nition of the fragments gener-
ates fewer new fragments than the contained-in case. Here the large fragments that have
some grid cells in common with other fragments are rede ned so as to generate as many
non-overlapping mixed fragments as possible. After the two contained-in or overlapping
fragments are considered and the non-overlapping mixed fragments are generated, all the
candidate mixed fragments (including the newly generated ones) are again sorted. Note that
in this step the non-overlapping fragments are generated by selecting the alternative that
requires the least number of disk I/O accesses to process all the transactions. This process of
nding a pair of contained-in or overlapping fragments and rede ning is iteratively continued
till non-overlapping fragmentation scheme is generated. This set of nal candidate mixed
fragments gives us the mixed fragmentation scheme for the relation.
Therefore, the algorithm Grid Optimization() generates a non-overlapping mixed fragmen-
tation scheme. As the algorithm is a greedy, its optimality cannot be guaranteed. 2

VI. Conclusion and Further Research


In this paper we have proposed a mixed fragmentation methodology and the necessary
components of a mixed fragmentation tool which can allow the optimal partitioning of global
relations in a distributed database by using a grid approach. The \grid" is a representation of
a populated relation taking into account both vertical and horizontal partitioning. The major
feature of the proposed approach is that it incorporates horizontal and vertical fragmentation
simultaneously based on the same algorithm and supports the investigation of the e ects of
the di erent sequences of partitioning. We use the top-down philosophy of generating grid
cells corresponding to clusters of predicates and attributes used by transactions together.
Then we bring in a \bottom-up" evaluation by considering reduction in cost by merging the
already created cells vertically or horizontally. We claim that ours is the rst comprehensive
treatment of mixed fragmentation. Further extension of our research will be in the direction
of result comparison and fragment allocation steps of Figure 2, approach C. Detailed analysis
of the costs used in the merging heuristics is also being investigated. A prototype of the
mixed fragmentation Distributed Database Design Tool (D T ) has been under development
3

and is presently being developed at the Hong Kong University of Science and Technology.
The tool will allow users to make \distribution design" decisions using vertical, horizontal,
and mixed fragmentation. Models for allocation with and without replication, incorporating
the e ects of change in transactions and change in data are being investigated. The design
of an easy user interface for collecting the distribution requirements as well as user control
in driving the mixed fragmentation process are topics that we will be addressing as a task
of the tool implementation.
Acknowledgments We thank Rajeev Kumar, Pedro I. Rivera Vega, and especially Kiran
Sreewastav of the Distributed Database Design Tool (D T ) project at the University of
3

Florida for their contribution to the development of this approach.


References
[1] S. Ceri, M. Negri, and G. Pelagatti, \Horizontal data partitioning in database design," in Proceedings of ACM
SIGMOD International Conference on Management of Data, pp. 128{136, 1982.
[2] S. Ceri, S. B. Navathe, and G. Wiederhold, \Distribution design of logical database schemas," IEEE Transactions
on Software Engineering, vol. SE-9, pp. 487{504, July 1983.
[3] D. Shin and K. B. Irani, \Fragmenting relations horizontally using a knowledge-based approach," IEEE Trans-
actions on Software Engineering, vol. 17, September 1991.
[4] S. B. Navathe, S. Ceri, G. Wiederhold, and J. Dou, \Vertical partitioning algorithms for database design," ACM
Transactions on Database Systems, vol. 9, no. 4, pp. 680{710, 1984.
[5] D. W. Cornell and P. S. Yu, \A vertical partitioning algorithm for relational databases," in Proceedings of
International Conference on Data Engineering, IEEE, pp. 30{35, February 1987.
[6] S. B. Navathe and M. Ra, \Vertical partitioning for database design: A graphical algorithm," in Proceedings of
ACM SIGMOD International Conference on Management of Data, 1989.
[7] W. W. Chu and I. T. Ieong, \A transaction-based approach to vertical partitioning for relational databases,"
tech. rep., UCLA, 1991.
[8] P.-C. Chu, \A transaction-oriented approach to attribute partitioning," Information Systems, vol. 17, no. 4,
pp. 329{342, 1992.
[9] J. Muthuraj, S. Chakravarthy, R. Varadarajan, and S. B. Navathe, \A formal approach to the vertical partitioning
problem in distributed database design," in Proc. of Second International Conference on Parallel and Distributed
Information Systems, San Diego, California, 1993.
[10] X. Lin, M. Orlowska, and Y. Zhang, \A garph based cluster approach for vertical partitioning in database
design," Data and Knowledge Engineering, vol. 11, pp. 151{169, 1993.
[11] K. Karlapalem and S. Navathe, \Materialization of distributed relational databases," submitted to a journal,
1994.
[12] P. M. G. Apers, \Data allocation in distributed database systems," ACM Transactions on Database Systems,
vol. 13, pp. 263{304, September 1988.
[13] I. Fogg and M. Orlowska, \Valid unbiased fragmentation for distributed database design," International Journal
of Computers and Mathematics with Applications, vol. 25, no. 9, pp. 97{106, 1993.
[14] M. Ra, Data Fragmentation and Allocation Algorithms for Distributed Database Design. PhD thesis, University
of Florida, 1990.
[15] S. Ceri and G. Pelagatti, Distributed Databases: Principles and Systems. McGraw Hill, New York, 1984.
[16] S. Ceri, B. Pernici, and G. Wiederhold, \Distributed database design methodologies and tools," in Proceedings
of the IEEE, pp. 533{546, May 1988.
[17] G. Copeland, W. Alexander, E. Boughter, and T. Keller, \Data placement in bubba," in Proceedings of ACM
SIGMOD International Conference on Management of Data, 1988.
[18] D. J. DeWitt, R. H. Gerber, G. Graefe, M. L. Heytens, K. B. Kumar, and M. Muralikrishna, \Gamma - a high
performance data ow database machine," in Proceedings of International Conference on Very Large Databases,
1986.

You might also like