Presentation is loading. Please wait.

Presentation is loading. Please wait.

Parallel Algorithms for Relational Operations Class ID: 21 Name: Shujia Zhang.

Similar presentations


Presentation on theme: "Parallel Algorithms for Relational Operations Class ID: 21 Name: Shujia Zhang."— Presentation transcript:

1 Parallel Algorithms for Relational Operations Class ID: 21 Name: Shujia Zhang

2 Index 15.9.1 Models of Parallelism 15.9.2 Tuple-at-a-Time Operations in Parallel 15.9.3 Parallel Algorithms for Full-Relation Operations 15.9.4 Performance of Parallel Algorithms

3 Models of Parallelism Three most important classes of parallel machine: – Shared Memory – Shared Disk – Shared Nothing

4 Shared-memory

5 Shared-disk

6 Shared-nothing

7 Tuple-at-a-Time Operations in Parallel There are P processors, divide any relation R’s tuples evenly among the P processor’s disks. To compute σ c (R), use each processor to examine the tuples of R on it own disk. To avoid communication among processors, store the result on the processor’s own disk. Thus, the result will be divided among the P processors.

8 Problem: the selection is σ a=10 (R), suppose we divided R according to the value of attribute a. Then, we have all the tuples of R with a=10 are at one of processors, and the the entire relation σ a=10 (R) is at one processor. Solution: to use a hash function h that involves all the components of a tuple in such a way that changing one component of a tuple t can change h(t) to be any possible bucket number.

9 Parallel Algorithms for Full-Relation Operations The Full-Relation operation: δ(R) Use hash function to distribute the tuples of R, then we have all duplicate tuples of R at the same processor Suppose we want to take the union of the R and S – Use the same hash function – Not use the same hash function

10 Then, each processor will receives all the tuples of R and S that belongs in the same bucket and perform the union of R and S As a result, the relation of the union of R and S will be distributed over all the processor.

11 Performance of Parallel Algorithms The running time of a parallel algorithm on a p-processor machine compares with the time to execute an algorithm for the same operation on the same data, using a uniprocessor Result: the multiprocessors machine is faster than the uniprocessor machine. – the multiprocessors have more memory to give us additional efficiency and the extra memory allows us to use a more efficient algorithm – in proportion to the number of processors


Download ppt "Parallel Algorithms for Relational Operations Class ID: 21 Name: Shujia Zhang."

Similar presentations


Ads by Google