1 Minimizing Latency and Memory in DSMS CS240B Notes By Carlo Zaniolo CSD--UCLA.

Slides:



Advertisements
Similar presentations
Evaluating Window Joins over Unbounded Streams Author: Jaewoo Kang, Jeffrey F. Naughton, Stratis D. Viglas University of Wisconsin-Madison CS Dept. Presenter:
Advertisements

CS240B Midterm Spring 2013 Your Name: and your ID: Problem Max scoreScore Problem 140% Problem 232% Problem 228% Total 100%
Analysis of : Operator Scheduling in a Data Stream Manager CS561 – Advanced Database Systems By Eric Bloom.
ECE 667 Synthesis and Verification of Digital Circuits
Architecture-dependent optimizations Functional units, delay slots and dependency analysis.
1 Continuous Query Languages (CQL) Blocking Operators and the expressive power problem Carlo Zaniolo UCLA CSD Spring 2009.
Evaluating Heuristics for the Fixed-Predecessor Subproblem of Pm | prec, p j = 1 | C max.
CSE506: Operating Systems Disk Scheduling. CSE506: Operating Systems Key to Disk Performance Don’t access the disk – Whenever possible Cache contents.
Adaptive Monitoring of Bursty Data Streams Brian Babcock, Shivnath Babu, Mayur Datar, and Rajeev Motwani.
Assessment. Schedule graph may be of help for selecting the best solution Best solution corresponds to a plateau before a high jump Solutions with very.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Stabbing the Sky: Efficient Skyline Computation over Sliding Windows COMP9314 Lecture Notes.
Kuang-Hao Liu et al Presented by Xin Che 11/18/09.
Evaluating Window Joins Over Unbounded Streams By Nishant Mehta and Abhishek Kumar.
Scheduling Algorithms for Wireless Ad-Hoc Sensor Networks Department of Electrical Engineering California Institute of Technology. [Cedric Florens, Robert.
VLDB Revisiting Pipelined Parallelism in Multi-Join Query Processing Bin Liu and Elke A. Rundensteiner Worcester Polytechnic Institute
Chapter 10: Stream-based Data Management Title: Design, Implementation, and Evaluation of the Linear Road Benchmark on the Stream Processing Core Authors:
Flow Algorithms for Two Pipelined Filtering Problems Anne Condon, University of British Columbia Amol Deshpande, University of Maryland Lisa Hellerstein,
UNC Chapel Hill Lin/Manocha/Foskey Optimization Problems In which a set of choices must be made in order to arrive at an optimal (min/max) solution, subject.
Chain: Operator Scheduling for Memory Minimization in Data Stream Systems Authors: Brian Babcock, Shivnath Babu, Mayur Datar, and Rajeev Motwani (Dept.
1 Data Stream Management Systems Checkpoint CS240B Notes by Carlo Zaniolo UCLA CSD.
©Silberschatz, Korth and Sudarshan14.1Database System Concepts 3 rd Edition Chapter 14: Query Optimization Overview Catalog Information for Cost Estimation.
Avoiding Idle Waiting in the execution of Continuous Queries Carlo Zaniolo CSD CS240B Notes April 2008.
Simpath: An Efficient Algorithm for Influence Maximization under Linear Threshold Model Amit Goyal Wei Lu Laks V. S. Lakshmanan University of British Columbia.
1 Relational Operators. 2 Outline Logical/physical operators Cost parameters and sorting One-pass algorithms Nested-loop joins Two-pass algorithms.
Efficient Scheduling of Heterogeneous Continuous Queries Mohamed A. Sharaf Panos K. Chrysanthis Alexandros Labrinidis Kirk Pruhs Advanced Data Management.
Freshness-Aware Scheduling of Continuous Queries in the Dynamic Web Mohamed A. Sharaf Alexandros Labrinidis Panos K. Chrysanthis Kirk Pruhs Advanced Data.
Database Management 9. course. Execution of queries.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Fundamentals of Algorithms MCS - 2 Lecture # 7
05/04/06 1 Integrating Logic Synthesis, Tech mapping and Retiming Presented by Atchuthan Perinkulam Based on the above paper by A. Mishchenko et al, UCAL.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the scheduling.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Randomized Composable Core-sets for Submodular Maximization Morteza Zadimoghaddam and Vahab Mirrokni Google Research New York.
Memory Management during Run Generation in External Sorting – Larson & Graefe.
CPSC 404, Laks V.S. Lakshmanan1 External Sorting Chapter 13: Ramakrishnan & Gherke and Chapter 2.3: Garcia-Molina et al.
Segmented Hash: An Efficient Hash Table Implementation for High Performance Networking Subsystems Sailesh Kumar Patrick Crowley.
Limits of Instruction-Level Parallelism Presentation by: Robert Duckles CSE 520 Paper being presented: Limits of Instruction-Level Parallelism David W.
ACM SIGMOD International Conference on Management of Data, Beijing, June 14 th, Keyword Search on Relational Data Streams Alexander Markowetz Yin.
CS4432: Database Systems II Query Processing- Part 2.
Evaluating Window Joins over Unbounded Streams Jaewoo Kang Jeffrey F. Naughton Stratis D. Viglas {jaewoo, naughton, Univ. of Wisconsin-Madison.
Adaptivity in continuous query systems Luis A. Sotomayor & Zhiguo Xu Professor Carlo Zaniolo CS240B - Spring 2003.
Optimization Problems In which a set of choices must be made in order to arrive at an optimal (min/max) solution, subject to some constraints. (There may.
Adaptive Ordering of Pipelined Stream Filters Babu, Motwani, Munagala, Nishizawa, and Widom SIGMOD 2004 Jun 13-18, 2004 presented by Joshua Lee Mingzhu.
The bin packing problem. For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects.
CS 3343: Analysis of Algorithms Lecture 19: Introduction to Greedy Algorithms.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Chapter 9: Web Services and Databases Title: NiagaraCQ: A Scalable Continuous Query System for Internet Databases Authors: Jianjun Chen, David J. DeWitt,
Rate-Based Query Optimization for Streaming Information Sources Stratis D. Viglas Jeffrey F. Naughton.
On the Placement of Web Server Replicas Yu Cai. Paper On the Placement of Web Server Replicas Lili Qiu, Venkata N. Padmanabhan, Geoffrey M. Voelker Infocom.
1 Scheduling Techniques for Broadcasting Popular Media. Amotz Bar-Noy Brooklyn College Richard Ladner Tami Tamir University of Washington.
Query Optimization for Stream Databases Presented by: Guillermo Cabrera Fall 2008.
T H E O H I O S T A T E U N I V E R S I T Y Computer Science and Engineering 1 1 Sriram Chellappan, Xiaole Bai, Bin Ma ‡ and Dong Xuan Presented by Sriram.
UCLA, Winter Sample from CS240B Past Midterms
Introduction to Wireless Sensor Networks
Database Applications (15-415) DBMS Internals- Part VII Lecture 16, October 25, 2016 Mohammad Hammoud.
5.2 Eleven Advanced Optimizations of Cache Performance
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Objective of This Course
Instance Based Learning
Brian Babcock, Shivnath Babu, Mayur Datar, and Rajeev Motwani
Query Optimization Minimizing Memory and Latency in DSMS
ICS 252 Introduction to Computer Design
Generalized Chain Propose and discuss a simple generalization of the chain algorithm to minimize memory for the following situations: (A) Two simple paths.
CS240B Midterm: Winter 2017 Your Name: and your ID:
Approximation and Load Shedding Sampling Methods
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

1 Minimizing Latency and Memory in DSMS CS240B Notes By Carlo Zaniolo CSD--UCLA

2 Query Optimization in DSMS Opportunities and Challenges Source Sink O2O2 O3O3 O1O1 Source1  U Source2 σ ∑1∑1 Sink ∑2∑2 Source σ Sink ∑2∑2 ∑1 Simple DBMS-like opportunities: e.g. pushing selection. Sharing of operators and buffers can be important. No Major saving in execution time from reordering, indexes and operator implementation. Except for these cases: Total execution time is determine by the query graphs and the buffer contents.

3 Optimization Objectives zRate-based optimization [VN02]: Overall objective is to maximize the tuple output rate for a query zMinimize Memory Consumption: with large buffer memory could become scarce zMinimize response time (latency): yTime from source to sink yMaximize user satisfaction

4 Rate Based Optimization zRate-based optimization [VN02]: yTake into account the rates of the streams in the query evaluation tree during optimization yRates can be known and/or estimated zOverall objective is to maximize the tuple output rate for a query yInstead of seeking the least cost plan, seek the plan with the highest tuple output rate. y maximizing output rate normally leads to optimum response-time. But no actual proof of that. z As opposed to Chain that guarantees optimality for memory [Babcock 2003]

5 Progress charts zEach step represents an operator zThe ith operator takes (t i – t i-1 ) units of time to process a tuple of size s i-1 zResult is a tuple of size s i zWe can define selectivity as the drop in tuple size from operator i to operator i+1. Source O1 O2O3 O1 O2

6 Chain Scheduling Algorithm Time Source O1O1 O2 Sink O3 Memory O1 O2 O3 Memory O1 O2 O3 envelope Lower Original query graph is partitioned into sub-graphs that are prioritized eagerly

7 State of the Art zChain Limitations: y Latency minimization not supported—only memory yGeneralization to general graphs leaves much to be desired yAssumes every tuple behaves in the same way yOptimality achieved only under this assumption---what about if tuples behave differently?

8 Query Graph: Arbitrary DAGs Source σ ∑1∑1 Sink ∑2∑2 Source Sink O2O2 O3O3 O1O1 Source1  U Source2 σ Sink Source1  U Source2 σ ∑1∑1 Sink ∑2∑2

9 Chain for Latency Minimization? zChain Contributions: yUse the efficient chart partitioning algorithm to break up each component into subgraphs, where y resulting subgraphs are scheduled greedly (steepest slope first). yHow can that be used to minimize latency on arbitrary graphs? (assuming that the idle- waiting problem has been solved--or does not occur because of massive and balanced arrivals).

10 Latency: the Output Completion Chart zSuppose we have 3 input tuples at operator O 1 yHorizontal axis is time, vertical axis is # remaining output to be produced yMany waiting tuples  curve smoothes into the dotted slope zThe slope is average tuple processing rate Source O1O1 Sink Remaining Output Time tuple 1 tuple 2 tuple 3 Total Output Time tuple 1 tuple 2 tuple 3 Remaining Output Time N S Example, one operator:

11 Latency Minimization zExample for latency optimization: multiple independent operators zTotal area under the curve represents total latency over time zMinimizing total area under the curve—same as lower envelope yOrder operators by non- increasing slopes Source O1O1 Sink A: Source O2O2 Sink B: Remaining Output: A first Time A B SASA SBSB B first Time A B SBSB SASA Remaining Output Time O1O1 O2O2 O3O3 O4O4

12 Latency Optimization on Tuple-Sharing Fork Tuples shared by multiple branches: scheduling choices at forks: yFinish all tuples on the fastest branch first (break the fork) xAchieve fastest rate over the first branch yTake each input through all branches (no break) xFIFO, achieves the average rate of all branches No Partition at Fork Source Sink O2O2 O3O3 O1O1 Source Sink O2O2 O3O3 O1O1 Time 2N N O 1 +O 2 O3O3 O 1 +O 2 +O 3 N(  1 +  2 +  3 ) Partition at Fork Time 2N N O 1 +O 2 O3O3 O 1 +O 2 +O 3 N(  1 +  2 ) N x  3

13 Latency Optimization on Nested Fork zRecursively apply the partitioning algorithm from bottom-up yStarting from forks closest to sink buffers zSimilar algorithms can be used for memory minimization 1.Slopes are memory-reduction rates 2.Require branch-segmentation, more complicated Remaining Output G+H+P O E D C+A+B Source Sink H P G O D A C B E

14 Optimal Algorithm-Latency Minimization zWe have so far assumed which buffer to process next by the average costs of the tuples in each buffer. Thus for the simple case above the complete schedule is a permutation of A, B, and C. zScheduling based on individual tuple cost: make a scheduling decision for each tuple and the basis of its individual cost. yScheduling is still constrained by tuple-arrival order—thus at each step, we chose between the heads of each buffer. yA greedy approach that selects the least expensive head is not optimal! Source A Sink Source B Sink Source C Sink

15 Optimal Algorithm: when cost of each tuple is known 1.For each buffer chart the costs of the tuples in the buffer: Partion each chart into groups of tuples 2.Schedule group of tuples eagerly, i.e. by decreasing slope 3.Optimality as minimization of resulting: area = cost × time. Source A Sink Source B Sink Source C Sink

16 Example: Optimal Algorithm Source A SinkSource B Sink B1 B3 B2 Time SB2 SB1 A1 A4 A5 A3 A2 SA1 Time SA2 * Naïve Greedy would take B1 before A1 ** Optimal Order: SA1=A1,A2,A3,A4. Then SB1=B1,B2, then SB2=B3, finally SA2=A5. A5,A4,A3,A2,A1B3,B2,B1 \ / a

17 Experiments – Practical vs. Optimal Over many tuples, the practical component-based algorithm for latency minimization closely resemble the performance of the (unrealistic) optimal algorithm. Latency Minimization

18 Results zUnified scheduling algorithms for both latency and memory optimization yThe proposed algorithms are based on the chart-partitioning method first used by Chain for memory minimization yAlso a better memory minimization for tuple-sharing forks. zDerived optimal algorithms under the assumption that the processing costs of individual tuples is known. zExperimental evaluation shows that optimization based on the average costs of tuples in buffer (instead of their individual costs ) produces nearly optimal results.

19 References S. Viglas, J. F. Naughton: Rate-based query optimization for streaming information sources. SIGMOD Conference 2002: [VN02] B. Babcock, S. Babu, M. Datar, R. Motwani: Chain: Operator Scheduling for Memory Minimization in Data Stream Systems. SIGMOD Conference 2003: This is the chain paper referred to as [BBDM03] or [Babcock et al.] Yijian Bai and Carlo Zaniolo: Minimizing Latency and Memory in DSMS: a Unified Approach to Quasi- Optimal Scheduling. The Second International Workshop on Scalable Stream Processing Systems, March 29, 2008, Nantes, France.