Parallel Database System
Parallel Database System
Systems
Samaresh Mishra,
School of Computer Engineering,
KIIT University, Bhubaneswar
Parallel Database Systems
Introduction
I/O Parallelism
Inter-query Parallelism
Intra-query Parallelism
Intra-operation Parallelism
Inter-operation Parallelism
Design of Parallel Systems
back
Parallel Database System 41
Fragment-and-Replicate Join
• General case: reduces the sizes of the relations
at each processor.
r is partitioned into n partitions : r0, r1, ..., r n-1;
and s is partitioned into m partitions : s0, s1,
..., s m-1.
Any partitioning technique may be used.
There must be at least m * n processors.
Label the processors as
P0,0, P0,1, ..., P0,m-1, P1,0, ..., Pn-1m-1.
Pi,j computes the join of ri with sj. In order to do so, ri
is replicated to Pi,0, Pi,1, ..., Pi,m-1, while si is replicated
to P0,i, P1,i, ..., Pn-1,i
Any join technique can be used at each processor Pi,j.
Parallel Database System 42
Fragment-and-Replicate Join (Cont.)
• Both versions of fragment-and-replicate work with any
join condition, since every tuple in r can be tested with
every tuple in s.
• Usually has a higher cost than partitioning, since one of
the relations (for asymmetric fragment-and-replicate) or
both relations (for general fragment-and-replicate) have
to be replicated.
• Sometimes asymmetric fragment-and-replicate is
preferable even though partitioning could be used.
– E.g., say s is small and r is large, and already partitioned. It may
be cheaper to replicate s across all processors, rather than
repartition r and s on the join attributes.
• Projection
– Projection without duplicate elimination can be
performed as tuples are read in from disk in parallel.
– If duplicate elimination is required, any of the above
duplicate elimination techniques can be used.
Parallel Database System 48
Grouping/Aggregation
• Partition the relation on the grouping attributes and then
compute the aggregate values locally at each processor.
• Can reduce cost of transferring tuples during partitioning
by partly computing aggregate values before partitioning.
• Consider the sum aggregation operation:
– Perform aggregation operation at each processor Pi on those
tuples stored on disk Di
• results in tuples with partial sums at each processor.
– Result of the local aggregation is partitioned on the grouping
attributes, and the aggregation performed again at each
processor Pi to get the final result.
• Fewer tuples need to be sent to other processors during
partitioning.
Parallel Database System 49
Cost of Parallel Evaluation of Operations
• If there is no skew in the partitioning, and there
is no overhead due to the parallel evaluation,
expected speed-up will be 1/n
• If skew and overheads are also to be taken into
account, the time taken by a parallel operation
can be estimated as
Tpart + Tasm + max (T0, T1, …, Tn-1)
– Tpart is the time for partitioning the relations
– Tasm is the time for assembling the results
– Ti is the time taken for the operation at processor Pi
• this needs to be estimated taking into account the skew, and
the time wasted in contentions.