Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke1 Parallel Database Systems Taken/tweaked from the Wisconsin DB book slides.

Slides:



Advertisements
Similar presentations
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Evaluation of Relational Operations Chapter 12, Part A.
Advertisements

Query Execution, Concluded Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems November 18, 2003 Some slide content may.
Parallel Databases These slides are a modified version of the slides of the book “Database System Concepts” (Chapter 18), 5th Ed., McGraw-Hill, by Silberschatz,
Parallel Databases By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
04/25/2005Yan Huang - CSCI5330 Database Implementation – Parallel Database Parallel Databases.
Database Management Systems 3ed, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 14, Part B.
Database Management Systems, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 12, Part B.
Database Management Systems, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 12, Part B.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 11.
Parallel Database Systems
Parallel Database Systems The Future Of High Performance Database Systems David Dewitt and Jim Gray 1992 Presented By – Ajith Karimpana.
Parallel Database Systems
Data Warehousing 1 Lecture-25 Need for Speed: Parallelism Methodologies Virtual University of Pakistan Ahsan Abdullah Assoc. Prof. & Head Center for Agro-Informatics.
External Sorting CS634 Lecture 10, Mar 5, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Query Evaluation Chapter 11 External Sorting.
Parallel DBMS Slides adapted from textbook; from Joe Hellerstein; and from Jim Gray, Microsoft Research. DBMS Textbook Chapter 22.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Chapter 1 Introduction 1.1A Brief Overview - Parallel Databases and Grid Databases 1.2Parallel Query Processing: Motivations 1.3Parallel Query Processing:
Parallel DBMS Chapter 22, Part A
Query Optimization 3 Cost Estimation R&G, Chapters 12, 13, 14 Lecture 15.
Institut für Scientific Computing – Universität WienP.Brezany Parallel Databases Univ.-Prof. Dr. Peter Brezany Institut für Scientific Computing Universität.
Manajemen Basis Data Pertemuan 11 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
Introduction to Database Systems 1 Join Algorithms Query Processing: Lecture 1.
1 Parallel DBMS Slides by Joe Hellerstein, UCB, with some material from Jim Gray, Microsoft Research. See also:
1 External Sorting for Query Processing Yanlei Diao UMass Amherst Feb 27, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
TDD: Topics in Distributed Databases
Fall 2008Parallel Databases1. Fall 2008Parallel Databases2 Ideal Parallel Systems Two key properties:  Linear Speedup: Twice as much hardware can perform.
CS 4432query processing - lecture 171 CS4432: Database Systems II Lecture #17 Join Processing Algorithms (cont). Professor Elke A. Rundensteiner.
Evaluation of Relational Operations. Relational Operations v We will consider how to implement: – Selection ( ) Selects a subset of rows from relation.
PMIT-6102 Advanced Database Systems
Parallel DBMS Instructor : Marina Gavrilova
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Data Warehousing 1 Lecture-24 Need for Speed: Parallelism Virtual University of Pakistan Ahsan Abdullah Assoc. Prof. & Head Center for Agro-Informatics.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Querying Large Databases Rukmini Kaushik. Purpose Research for efficient algorithms and software architectures of query engines.
Relational Operator Evaluation. Overview Index Nested Loops Join If there is an index on the join column of one relation (say S), can make it the inner.
Implementing Natural Joins, R. Ramakrishnan and J. Gehrke with corrections by Christoph F. Eick 1 Implementing Natural Joins.
Sorting.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 13.
Parallel Database Systems Instructor: Dr. Yingshu Li Student: Chunyu Ai.
Database Management Systems, R. Ramakrishnan and J. Gehrke 1 External Sorting Chapter 13.
Lecture 15- Parallel Databases (continued) Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
Radix Sort and Hash-Join for Vector Computers Ripal Nathuji 6.893: Advanced VLSI Computer Architecture 10/12/00.
CPT-S Topics in Computer Science Big Data 1 Yinghui Wu EME 49.
Mapping the Data Warehouse to a Multiprocessor Architecture
©Silberschatz, Korth and Sudarshan18.1Database System Concepts - 6 th Edition Chapter 18: Parallel Databases Introduction I/O Parallelism Interquery Parallelism.
CPSC 404, Laks V.S. Lakshmanan1 Evaluation of Relational Operations – Join Chapter 14 Ramakrishnan and Gehrke (Section 14.4)
Lecture 14- Parallel Databases Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
Computing & Information Sciences Kansas State University Monday, 03 Nov 2008CIS 560: Database System Concepts Lecture 27 of 42 Monday, 03 November 2008.
©Silberschatz, Korth and Sudarshan20.1Database System Concepts 3 rd Edition Chapter 20: Parallel Databases Introduction I/O Parallelism Interquery Parallelism.
Query Processing CS 405G Introduction to Database Systems.
CS 440 Database Management Systems Lecture 5: Query Processing 1.
Computing & Information Sciences Kansas State University Wednesday, 08 Nov 2006CIS 560: Database System Concepts Lecture 32 of 42 Monday, 06 November 2006.
Implementation of Database Systems, Jarek Gryz1 Evaluation of Relational Operations Chapter 12, Part A.
Unit - 4 Introduction to the Other Databases.  Introduction :-  Today single CPU based architecture is not capable enough for the modern database.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapters 13: 13.1—13.5.
CS 540 Database Management Systems
CS 440 Database Management Systems Parallel DB & Map/Reduce Some slides due to Kevin Chang 1.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 13.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 11.
Implementation of Database Systems, Jarek Gryz 1 Parallel DBMS Chapter 22, Part A.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Evaluation of Relational Operations Chapter 14, Part A (Joins)
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
Term Project #2 Data Management on a Cloud (Azure)
Database System Architectures Centralized Systems Client-Server Systems Transaction Servers Data Servers Parallel DBMS Interconnection Network Architectures.
Akshay Tomar Prateek Singh Lohchubh
Parallel DBMS Chapter 22, Part A
Parallel DBMS Chapter 22, Sections 22.1–22.6
Parallel DBMS DBMS Textbook Chapter 22
Presentation transcript:

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke1 Parallel Database Systems Taken/tweaked from the Wisconsin DB book slides by Joe Hellerstein (UCB) with much of the material borrowed from Jim Gray (Microsoft Research). See also: Mike Carey CS 295 Fall 2011

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke2 Why Parallel Access To Data? 1 Terabyte 10 MB/s At 10 MB/s 1.2 days to scan 1 Terabyte 1,000 x parallel 1.5 minute to scan. Parallelism: Divide a big problem into many smaller ones to be solved in parallel. Bandwidth

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke3 Parallel DBMS: Intro v Parallelism is natural to DBMS processing – Pipelined parallelism: many machines each doing one step in a multi-step process. – Partitioned parallelism: many machines doing the same thing to different pieces of data. – Both are natural in DBMS! Pipeline Partition Any Sequential Program Any Sequential Program Sequential Any Sequential Program Any Sequential Program outputs split N ways, inputs merge M ways

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke4 DBMS: The || Success Story v For a long time, DBMSs were the most (only?!) successful/commercial application of parallelism. –Teradata, Tandem vs. Thinking Machines, KSR. –Every major DBMS vendor has some || server. –(Of course we also have Web search engines now. ) v Reasons for success: –Set-oriented processing (= partition ||-ism). –Natural pipelining (relational operators/trees). –Inexpensive hardware can do the trick! –Users/app-programmers don’t need to think in ||

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke5 Some || Terminology v Speed-Up –Adding more resources results in proportionally less running time for a fixed amount of data. v Scale-Up –If resources are increased in proportion to an increase in data/problem size, the overall time should remain constant. degree of ||-ism Xact/sec. (throughput) Ideal degree of ||-ism sec./Xact (response time) Ideal

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke6 Architecture Issue: Shared What? Easy to program Expensive to build Difficult to scale Hard to program Cheap to build Easy to scale Sequent, SGI, Sun VMScluster, Sysplex Tandem, Teradata, SP2 (Use affinity routing to approximate SN- like non-contention)

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke7 What Systems Work This Way Shared Nothing Teradata: 400 nodes Tandem: 110 nodes IBM / SP2 / DB2: 128 nodes Informix/SP2 48 nodes ATT & Sybase ? nodes Shared Disk Oracle170 nodes DEC Rdb 24 nodes Shared Memory Informix 9 nodes RedBrick ? nodes (as of 9/1995)

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke8 Different Types of DBMS ||-ism v Intra-operator parallelism –get all machines working together to compute a given operation (scan, sort, join) v Inter-operator parallelism –each operator may run concurrently on a different site (exploits pipelining) v Inter-query parallelism –different queries run on different sites v We’ll focus mainly on intra-operator ||-ism

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke9 Automatic Data Partitioning Partitioning a table: RangeHashRound Robin Shared disk and memory less sensitive to partitioning. Shared nothing benefits from "good" partitioning. A...E F...J K...NO...ST...Z A...E F...JK...NO...S T...Z A...EF...J K...N O...S T...Z Good for equijoins, exact-match queries, and range queries Good for equijoins, exact match queries Good to spread load

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke10 Parallel Scans/Selects v Scan in parallel and merge ( a.k.a. union all). v Selection may not require all sites for range or hash partitioning, but always does for RR. v Indexes can be constructed on each partition. –Indexes useful for local accesses, as expected. –However, what about unique indexes...? (May not always want primary key partitioning!)

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke11 Secondary Indexes A..C D..F G...M N...R S.. Base Table A..Z Base Table A..Z v Secondary indexes become a bit troublesome in the face of partitioning... v Can partition them via base table key. –Inserts local (unless unique??). –Lookups go to ALL indexes. v Can partition by secondary key ranges. –Inserts then hit 2 nodes (base, index). –Ditto for index lookups (index, base). –Uniqueness is easy, however. v Teradata’s index partitioning solution: –Partition non-unique by base table key. –Partition unique by secondary key.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke12 Grace Hash Join v In Phase 1 in the parallel case, partitions will get distributed to different sites: –A good hash function automatically distributes work evenly! (Diff hash fn for partitioning, BTW.) v Do Phase 2 (the actual joining) at each site. v Almost always the winner for equi-joins. Original Relations (R then S) OUTPUT 2 B main memory buffers Disk INPUT 1 hash function h B-1 Partitions 1 2 B-1... Phase 1

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke13 Dataflow Network for || Joins v Use of split/merge makes it easier to build parallel versions of sequential join code.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke14 Parallel Sorting v Basic idea: –Scan in parallel, range-partition as you go. –As tuples arrive, perform “local” sorting. –Resulting data is sorted and range-partitioned (i.e., spread across system in known way). –Problem: skew! –Solution: “sample” the data at the outset to determine good range partition points.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke15 Parallel Aggregation v For each aggregate function, need a decomposition: – count (S) =  count (s(i)), ditto for sum () – avg (S) = (  sum (s(i))) /  count (s(i)) –and so on... v For groups: –Sub-aggregate groups close to the source. –Pass each sub-aggregate to its group’s partition site.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke16 Complex Parallel Query Plans v Complex Queries: Inter-Operator parallelism –Pipelining between operators: u note that sort or phase 1 of hash-join block the pipeline! –Bushy Trees A BRS Sites 1-4Sites 5-8 Sites 1-8

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke17 Observations v It is relatively easy to build a fast parallel query executor. –S.M.O.P., well understood today. v It is hard to write a robust and world-class parallel query optimizer. –There are many tricks. –One quickly hits the complexity barrier. –Many resources to consider simultaneously (CPU, disk, memory, network).

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke18 Parallel Query Optimization v Common approach: 2 phases –Pick best sequential plan (System R algorithm) –Pick degree of parallelism based on current system parameters. v “Bind” operators to processors –Take query tree, “decorate” it with site assignments as in previous picture.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke19 v Best serial plan != Best || plan! Why? v Trivial counter-example: –Table partitioned with local secondary index at two nodes –Range query: all of node 1 and 1% of node 2. –Node 1 should do a scan of its partition. –Node 2 should use secondary index. v SELECT * FROM telephone_book WHERE name < “NoGood”; What’s Wrong With That? N..Z Table Scan A..M Index Scan

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke20 Parallel DBMS Summary v ||-ism natural to query processing: –Both pipeline and partition ||-ism! v Shared-Nothing vs. Shared-Memory –Shared-disk too, but less “standard” (~older...) –Shared-memory easy, costly. Doesn’t scaleup. –Shared-nothing cheap, scales well, harder to implement. v Intra-op, Inter-op, & Inter-query ||-ism all possible.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke21 || DBMS Summary, cont. v Data layout choices important! –In practice, will not N-way partition every table. v Most DB operations can be done partition-|| –Select, sort-merge join, hash-join. –Sorting, aggregation,... v Complex plans. –Allow for pipeline-||ism, but sorts and hashes block the pipeline. –Partition ||-ism achieved via bushy trees.

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke22 || DBMS Summary, cont. v Hardest part of the equation: optimization. –2-phase optimization simplest, but can be ineffective. –More complex schemes still at the research stage. v We haven’t said anything about xacts, logging, etc. –Easy in shared-memory architecture. –Takes a bit more care in shared-nothing architecture

Database Management Systems, 2 nd Edition. Raghu Ramakrishnan and Johannes Gehrke23 || DBMS Challenges (mid-1990’s) v Parallel query optimization. v Physical database design. v Mixing batch & OLTP activities. –Resource management and concurrency challenges for DSS queries versus OLTP queries/updates. –Also online, incremental, parallel, and recoverable utilities for load, dump, and various DB reorg ops. v Application program parallelism. –MapReduce, anyone...? –(Some new-ish companies looking at this, e.g., GreenPlum, AsterData, …)