Docsity

Parallel Database Technology - Lecture Notes | COP 5711, Study notes of Computer Science

Partial preview of the text

Download Parallel Database Technology - Lecture Notes | COP 5711 and more Study notes Computer Science in PDF only on Docsity!

PARALLEL DATABASE TECHNOLOGY

Kien A. Hua

School of Computer Science University of Central Florida Orlando, FL 32816-

Topics

EXECUTOR (3)

STORAGE MANAGER (2)

HARDWARE (1)

(4)

QUERY OPTIMIZATION

PROCESS STRUCTURE

Results Queries

* Parallelizing QueryOptimization Techniques

* Parallel Algorithms

* Data PlacementStrategies

* Parallel Architectures

COMMERCIAL SYSTEMS (5)

Relational Data Mo del

0005 John Smith Orlando

EMP# NAME ADDR

A relation (table)

An attribute (column)

A tuple (row)

 A database structure is a collection of tables.

 Each table is organized into rows and

columns.

 The p ersistent ob jects of an application are

captured in these tables.

Relational Op erator: SCAN

SELECT NAME FROM EMPLOYEE WHERE ADDR = \Orlando";

PROJECT(NAME)

NAME Jane Doe John Smith

0002 Jane Doe Orlando 0005 John Smith Orlando

EMP# NAME ADDR

SELECT (ADDR=Orlando)

0005 John Smith Orlando

EMP# NAME ADDR 0002 Jane Doe Orlando

SCAN

Hash-Based Join

EMPLOYEE: EMP#^ NAME^ ADDR^ PROJECT: ENUM^ PROJ^ DEPT

JOIN JOIN JOIN JOIN

0004

0004 0008

E0 P0 E1 P1 E2 P2 E3 P

EMP_PROJ_0 EMP_PROJ_1 EMP_PROJ_2 EMP_PROJ_

(^0004 )

HASH:(EMP#) = EMP# mod 4 HASH(ENUM) = ENUM mod 4‘

Examples: 0 mo d 4 = 0 4 mo d 4 = 0 1 mo d 4 = 1 5 mo d 4 = 1 2 mo d 4 = 2 6 mo d 4 = 2 3 mo d 4 = 3 7 mo d 4 = 3

Bucket Sizes and I/O Costs

Bucket A Bucket B

Memory One tuple at a time

Bucket B do es not t in the memory in its entirety. It must b e loaded several time.

Memory

Bucket A(1)

Bucket A(2)

Bucket A(3)

Bucket B(2)

Bucket B(3)

LOAD

One tuple at a time Bucket B(1)

Bucket B ts in the memory. It needs to b e loaded only once.

Barriers to Parallelism

 Startup:

The time needed to start a paral lel operation (thread creation/connection overhead) may dominate the actual computation time.

 Interference:

When accessing shared resources, each new process slows down the others (hot spot problem).

 Skew:

The response time of a set of paral lel processes is the time of the slowest one.

The Challenge

 The ideal database machine has:

  1. a single in nitely fast pro cessor,
  2. an in nitely large memory with in nite bandwidth

! Unfortunately, technology is not

delivering such machines!

 The challenge is:

  1. to build an in nitely fast pro cessor out of in nitely many pro cessors of nite sp eed, and
  2. to build an in nitely large memory with in nitely many storage units of nite sp eed.

Hardware Architectures

P : Processor

M : Memory Module

: Disk Drive

(a) Shared Nothing (SN)

Network

Communication

P P P P M M M M

P

M

(b) Shared Disk (SD)

Network

Communication

P P P P M M M M

M M M

P P P

Communication Network

(c) Shared Everything (SE)

Examples

HARDWARE SOFTWARE

 Shared-Everything:

{ IBM mainframes { HP T { SGI Challenge { Pentium-based SMP

 Shared-Disk:

{ Intel Paragon { nCUBE/ { Tandem's ServerNet-based machines

 Shared-Nothing:

{ Teradata's DBC { Tandem NonStopSQL { IBM 6000 SP

 Shared-Everything: { Informix 7.2 Online Dy- namic Server { Oracle 7.3 Parallel Query Option { IBM DB2/MVS

 Shared-Disk:

{ IBM IMS/VS Data Shar- ing Pro duct { DEC VAX DBMS and Rdb pro ducts { Oracle on DEC's VAX- cluster and nCUBE Com- puters

 Shared-Nothing:

{ Teradata's DBC { Tandem NonStopSQL { IBM DB2 Parallel Edi- tion

Hybrid Architecture

...

Cluster N

...

Bus

Memory

Cluster 1

Memory

Bus

P P P P P... P

COMMUNICATION NETWORK

 SE clusters are interconnected through a communication network to form an SN structure at the inter-cluster level.

 This approach minimizes the communication overhead asso ciated with the SN structure, and yet each cluster size is kept small within the limitation of the lo cal memory and I/O bandwidth.

 Examples of this architecture include Sequent computers, NCR 5100M and Bull PowerCluster.

 Some of the DBMSs designed for this structure are the Teradata Database System for the NCR WorldMark 5100 computer, Sybase MPP, Informix Online Extended Parallel Server.

Parallelism in Relational Data Mo del

 Pip eline Parallelism : If one op erator sends its output to another, the two op erators can execute in parallel.

INSERT

JOIN

SCAN SCAN

C

A B

INSERT INTO C SELECT FROM WHERE

A, B A.x = B.y;

 Partitioned Parallelism : By taking the large relational op erators and partitioning their inputs and outputs, it is p ossible to turn one big job into many concurrent indep endent little ones.

JOIN SCAN

INSERT INSERT INSERT

SCAN B0B

A0A

A

C0 C1 C

Data Partitioning Strategies

Data partitioning is the key to partitioned execution:

 Round-Robin: maps the ith tuple to disk i mo d n.

 Hash Partitioning: maps each tuple to a disk lo cation based on a hash function.

 Range Partitioning: maps contiguous attribute ranges of a relation to various disks.

NETWORK P0 P1 P2 P

NETWORK P0 P1 P2 P

A - F G - L M - R S - Z Range Partitioning

NETWORK P0 P1 P2 P

...

HASH

... Hashed Partitioning

Round-Robin

Comparing Data Partitioning Strategies

 Round Robin Partitioning:

Advantage: simple

Disadvantage: It does not support associative search.

 Hash Partitioning:

Advantage: Associative access to the tuples with a speci c attribute value can be directed to a single disk.

Disadvantage: It tends to randomize data rather than cluster it.

 Range Partitioning:

Advantage: It is good for associative search and clustering data.

Disadvantage: It risks execution skew in which al l the execution occurs in one partition.