I/O Parallelism Interquery Parallelism Intraquery Parallelism Intraoperation Parallelism Interoperation Parallelism Design of Parallel Systems
I/O Parallelism Interquery Parallelism Intraquery Parallelism Intraoperation Parallelism Interoperation Parallelism Design of Parallel Systems
I/O Parallelism Interquery Parallelism Intraquery Parallelism Intraoperation Parallelism Interoperation Parallelism Design of Parallel Systems
Introduction
I/O Parallelism
Interquery Parallelism
Intraquery Parallelism
Intraoperation Parallelism
Interoperation Parallelism
Design of Parallel Systems
Round robin:
Advantages
Best suited for sequential scan of entire relation on each query.
All disks have almost an equal number of tuples; retrieval work is
thus well balanced between disks.
Range queries are difficult to process
No clustering -- tuples are scattered across all disks
Hash partitioning:
Good for sequential access
Assuming hash function is good, and partitioning attributes form a
key, tuples will be equally distributed between disks
Retrieval work is then well balanced between disks.
Good for point queries on partitioning attribute
Can lookup single disk, leaving others available for answering other
queries.
Index on partitioning attribute can be local to disk, making lookup
and update more efficient
No clustering, so difficult to answer range queries
Range partitioning:
Provides data clustering by partitioning attribute value.
Good for sequential access
Good for point queries on partitioning attribute: only one disk
needs to be accessed.
For range queries on partitioning attribute, one to a few disks
may need to be accessed
Remaining disks are available for other queries.
Good if result tuples are from one to a few blocks.
If many blocks are to be fetched, they are still fetched from one
to a few disks, and potential parallelism in disk access is wasted
Example of execution skew.
If a relation contains only a few tuples which will fit into a single
disk block, then assign the relation to a single disk.
Large relations are preferably partitioned across all the available
disks.
If a relation consists of m disk blocks and there are n disks
available in the system, then the relation should be allocated
min(m,n) disks.
For equi-joins and natural joins, it is possible to partition the two input
relations across the processors, and compute the join locally at each
processor.
Let r and s be the input relations, and we want to compute r r.A=s.B s.
r and s each are partitioned into n partitions, denoted r0, r1, ..., rn-1 and
s0, s1, ..., sn-1.
Can use either range partitioning or hash partitioning.
r and s must be partitioned on their join attributes r.A and s.B), using
the same range-partitioning vector or hash function.
Partitions ri and si are sent to processor Pi,
Each processor Pi locally computes ri ri.A=si.B si. Any of the
standard join methods can be used.
a. Asymmetric
Fragment and
Replicate b. Fragment and Replicate
Database System Concepts 20.25 ©Silberschatz, Korth and Sudarshan
Fragment-and-Replicate Join (Cont.)
Assume that
relation s is much smaller than relation r and that r is stored by
partitioning.
there is an index on a join attribute of relation r at each of the
partitions of relation r.
Use asymmetric fragment-and-replicate, with relation s being
replicated, and using the existing partitioning of relation r.
Each processor Pj where a partition of relation s is stored reads
the tuples of relation s stored in Dj, and replicates the tuples to
every other processor Pi.
At the end of this phase, relation s is replicated at all sites that store
tuples of relation r.
Each processor Pi performs an indexed nested-loop join of
relation s with the ith partition of relation r.
Selection (r)
If is of the form ai = v, where ai is an attribute and v a value.
If r is partitioned on ai the selection is performed at a single
processor.
If is of the form l <= ai <= u (i.e., is a range selection) and the
relation has been range-partitioned on ai
Selection is performed at each processor whose partition overlaps
with the specified range of values.
In all other cases: the selection is performed in parallel at all the
processors.
Duplicate elimination
Perform by using either of the parallel sort techniques
eliminate duplicates as soon as they are found during sorting.
Can also partition the tuples (using either range- or hash-
partitioning) and perform duplicate elimination locally at each
processor.
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.
Pipelined parallelism
Consider a join of four relations
r1 r2 r3 r4
Set up a pipeline that computes the three joins in parallel
Let P1 be assigned the computation of
temp1 = r1 r2
And P2 be assigned the computation of temp2 = temp1 r3
And P3 be assigned the computation of temp2 r4
Each of these operations can execute in parallel, sending result
tuples it computes to the next operation even as it is computing
further results
Provided a pipelineable join evaluation algorithm (e.g. indexed
nested loops join) is used
Independent parallelism
Consider a join of four relations
r1 r2 r3 r4
Let P1 be assigned the computation of
temp1 = r1 r2
And P2 be assigned the computation of temp2 = r3 r4
And P3 be assigned the computation of temp1 temp2
P1 and P2 can work independently in parallel
P3 has to wait for input from P1 and P2
– Can pipeline output of P1 and P2 to P3, combining
independent parallelism and pipelined parallelism
Does not provide a high degree of parallelism
useful with a lower degree of parallelism.
less useful in a highly parallel system,