C-Store: Self-Organizing Tuple Reconstruction Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY Apr. 17, 2009.

Slides:



Advertisements
Similar presentations
Information Retrieval in Practice
Advertisements

An Array-Based Algorithm for Simultaneous Multidimensional Aggregates By Yihong Zhao, Prasad M. Desphande and Jeffrey F. Naughton Presented by Kia Hall.
1 Spatial Join. 2 Papers to Present “Efficient Processing of Spatial Joins using R-trees”, T. Brinkhoff, H-P Kriegel and B. Seeger, Proc. SIGMOD, 1993.
1 DynaMat A Dynamic View Management System for Data Warehouses Vicky :: Cao Hui Ping Sherman :: Chow Sze Ming CTH :: Chong Tsz Ho Ronald :: Woo Lok Yan.
Query Optimization CS634 Lecture 12, Mar 12, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
The Volcano/Cascades Query Optimization Framework
Query Execution, Concluded Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems November 18, 2003 Some slide content may.
Chapter 4: Trees Part II - AVL Tree
1 Introduction to Database Systems CSE 444 Lectures 19: Data Storage and Indexes November 14, 2007.
TIME 2002, Manchester, UK Index Based Processing of Semi- Restrictive Temporal Joins Donghui Zhang, Vassilis J. Tsotras University of California, Riverside.
Transaction.
C-Store: Updates Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May. 15, 2009.
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Multiple-key indexes Index on one attribute provides pointer to an index on the other. If V is a value of the first attribute, then the index we reach.
Xyleme A Dynamic Warehouse for XML Data of the Web.
1 Chapter 10 Query Processing: The Basics. 2 External Sorting Sorting is used in implementing many relational operations Problem: –Relations are typically.
B+-tree and Hashing.
Last Time –Main memory indexing (T trees) and a real system. –Optimize for CPU, space, and logging. But things have changed drastically! Hardware trend:
1 Indexing Structures for Files. 2 Basic Concepts  Indexing mechanisms used to speed up access to desired data without having to scan entire.
1 Query Processing: The Basics Chapter Topics How does DBMS compute the result of a SQL queries? The most often executed operations: –Sort –Projection,
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
Tree-Structured Indexes. Range Searches ``Find all students with gpa > 3.0’’ –If data is in sorted file, do binary search to find first such student,
Chapter 61 Chapter 6 Index Structures for Files. Chapter 62 Indexes Indexes are additional auxiliary access structures with typically provide either faster.
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
C-Store: Column Stores over Solid State Drives Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY Jun 19, 2009.
CSC271 Database Systems Lecture # 30.
1 Physical Data Organization and Indexing Lecture 14.
Query Optimization. overview Histograms A histogram is a data structure maintained by a DBMS to approximate a data distribution Equiwidth vs equidepth.
DANIEL J. ABADI, ADAM MARCUS, SAMUEL R. MADDEN, AND KATE HOLLENBACH THE VLDB JOURNAL. SW-Store: a vertically partitioned DBMS for Semantic Web data.
1 CPS216: Advanced Database Systems Notes 04: Operators for Data Access Shivnath Babu.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
Chapter 11 Indexing & Hashing. 2 n Sophisticated database access methods n Basic concerns: access/insertion/deletion time, space overhead n Indexing 
March 16 & 21, Csci 2111: Data and File Structures Week 9, Lectures 1 & 2 Indexed Sequential File Access and Prefix B+ Trees.
1 Index Structures. 2 Chapter : Objectives Types of Single-level Ordered Indexes Primary Indexes Clustering Indexes Secondary Indexes Multilevel Indexes.
Trevor Brown – University of Toronto B-slack trees: Space efficient B-trees.
Daniel J. Abadi · Adam Marcus · Samuel R. Madden ·Kate Hollenbach Presenter: Vishnu Prathish Date: Oct 1 st 2013 CS 848 – Information Integration on the.
Efficiently Processing Queries on Interval-and-Value Tuples in Relational Databases Jost Enderle, Nicole Schneider, Thomas Seidl RWTH Aachen University,
C-Store: How Different are Column-Stores and Row-Stores? Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May. 8, 2009.
© Pearson Education Limited, Chapter 13 Physical Database Design – Step 4 (Choose File Organizations and Indexes) Transparencies.
Physical Database Design The last phase of database design. It is to determine how to store the database. RDBMSs usually support a number of alternative.
View Materialization & Maintenance Strategies By Ashkan Bayati & Ali Reza Vazifehdoost.
C-Store: Tuple Reconstruction Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY Mar 27, 2009.
C-Store: Data Model and Data Organization Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May 17, 2010.
Methodology – Physical Database Design for Relational Databases.
ICDE 2002, San Jose, CA Efficient Temporal Join Processing using Indices Donghui Zhang University of California, Riverside Vassilis J. Tsotras University.
Marwan Al-Namari Hassan Al-Mathami. Indexing What is Indexing? Indexing is a mechanisms. Why we need to use Indexing? We used indexing to speed up access.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
M.Kersten MonetDB, Cracking and recycling Martin Kersten CWI Amsterdam.
Indexing Database Management Systems. Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files File Organization 2.
Chapter 5 Record Storage and Primary File Organizations
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2007.
Chapter 10 The Basics of Query Processing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved External Sorting Sorting is used in implementing.
Packet Classification Using Multi- Iteration RFC Author: Chun-Hui Tsai, Hung-Mao Chu, Pi-Chung Wang Publisher: 2013 IEEE 37th Annual Computer Software.
SQL Basics Review Reviewing what we’ve learned so far…….
Database cracking Stratos Idreos, Martin Kersten and Stefan Manegold
10/3/2017 Chapter 6 Index Structures.
Module 11: File Structure
CPS216: Data-intensive Computing Systems
Indexing Structures for Files and Physical Database Design
Top 50 Data Structures Interview Questions
Record Storage, File Organization, and Indexes
Indexing ? Why ? Need to locate the actual records on disk without having to read the entire table into memory.
B+Trees The slides for this text are organized into chapters. This lecture covers Chapter 9. Chapter 1: Introduction to Database Systems Chapter 2: The.
One-Pass Algorithms for Database Operations (15.2)
General External Merge Sort
Self-organizing Tuple Reconstruction in Column-stores
Tree-Structured Indexes
Efficient Processing of Top-k Spatial Preference Queries
Presentation transcript:

C-Store: Self-Organizing Tuple Reconstruction Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY Apr. 17, 2009

Review of Tuple Reconstruction Stitch together separate column values of the same logical tuple.  Join on Tuple IDs/positions. Two Strategies  Early materialization  Late matertialization

Motivation Tuple Reconstruction is easy  if columns are sorted in the same order However the pre-requisite can not always be preserved.  During query processing, many operators (joins, group by, order by, etc.) are not tuple order- preserving.

The Ultimate Access Pattern For each relation R, we have one copy for each attribute in R.  each copy is pre-sorted on the corresponding attribute. All tuple reconstruction initiated by a restriction on an attribute R.a, can be done using the copy that is sorted on R.a. The Limitations:  Space constraint  Idle time for the pre-sortings.

The Proposed Solution Partial Sideways Cracking  Uses auxiliary self-organizing data structures to materialize mappings between pairs of attributes used together for tuple reconstruction. Background  MonetDB  Selection-based Cracking

MonetDB: Every relation table  is represented as a collection of Binary Association Tables (BATs). Each BAT is a set of two columns  For a relation R of k attributes, there exists k BATs.  Each BAT stores (key, attr) pairs.  In each BAT, keys are system generated tuple IDs.  For base BAT, the key column is typically virtual. Like STORAGE KEY in Read Store of C-Store.

MonetDB ’ s Basic Operators (1) select(A, v1, v2)  Searches all (key, attr) pairs in base column A for attribute values between v1 and v2.  Output: A list of keys/positions.  In the output, the tuple order is usually preserved.

MonetDB ’ s Basic Operators (2) join(j1, j2)  Performs a join between attr1 of j1 and attr2 of j2.  Output: A list of (key1, key2) pairs.  In the output, the tuple order is mainly preserved for outer join.

Outer Join An outer join does not require each record in the two joined tables to have a matching record. The joined table retains each record—even if no other matching record exists.  Left outer join  Right outer join  Full outer join

Left Outer Join

MonetDB ’ s Basic Operators (3) reconstruct(A, r)  Output: All (key, attr) pairs of base column A at the position specified by r.

Selection-Based Cracking Cracker column  The first time an attribute A is required by a query, a copy of column A is created, called the cracker column C A of A.  Each selection operator on A triggers a range-based physical reorganization of C A.  Each cracker column, has a cracker index (AVL-tree) to maintain partitioning information.  Future queries benefit from the physically clustered data and do not need to access the whole column.

AVL-Tree An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one.

An example of an unbalanced non-AVL tree

The same tree after being height-balanced

Order for Tuple Reconstruction The order in which tuples are inserted is used for tuple construction.  Physical reorganization happens only on cracker columns.

The crackers.select Operator crackers.select(A, v1, v2)  First, it creates C A if it does not exist.  It searches the index of C A for the area where v1 and v2 fall.  If the bounds do not exist, i.e., no query used them in the past, then C A is physically reorganized to cluster all qualifying tuples into a contiguous area.  Output: A list of keys/positions.

Cracker Map A cracker map M AB is defined as a two- column table over two attributes A and B of a relation R.  Values of A are stored in the left column, called head.  Values of B are stored in the right column, called tail. Values of A and B in the same position of M AB belong to the same tuple.

Maps Are Created on Demand Only When a query q needs access to attribute B based on a restriction on attribute A and M AB does not exist, then q will create M AB by performing a scan over base columns A and B. For each cracker map M AB, there is a cracker index (AVL-tree) that maintains information about how A values are distributed over M AB.

Queries Trigger Cracking Query Style  Access B based on A. Each such query triggers cracking (physical reorganization) of M AB based on the restriction applied to A. Cracking  All tuples with values of A that qualify the restriction are in a contiguous area in M AB.  Realized by splitting a piece of M AB into two or three new pieces.

The sideways.select(A, v1, v2, B) Operator Returns tuples of attribute B of relation R based on a predicate on attribute A of R as follows: (1) If there is no cracker map M AB, then create one. (2) Search the index of M AB to find the contiguous area w of the pieces related to the restriction σ on A. If σ does not match existing piece boundaries, (3) Physically reorganize w to move false hits out of the contiguous area of qualifying tuples. (4) Update the cracker index of M AB accordingly. (5) Return a non-materialized view of the tail of w.

Multi-Projection Queries A single-selection query q that projects n attributes requires n maps, one for each attribute to be projected. Select B, C From R Where A < 4; For this query, we need 2 maps M AB and M Ac. All maps that have been created using A as head are collected in the map set S A.

Adaptive Alignment The Problem  Naïve use of the sideways.select operator may lead to non-aligned cracker maps. The Solution  Extend the sideways.select operator with an alignment step to keep the alignment maps. The Basic Idea  Is to apply all physical reorganizations, due to selections on an attribute A, in the same order to all maps in the map set S A.

Cracker Tape For each map set S A, introduce a cracker tape T A.  T A logs (in order of their occurrence) all selections on attribute A that trigger cracking of any map in S A.  Each map M Ax is equipped with a cursor pointing to the entry in T A that represents the last crack on M Ax. Given a tape T A, a map M Ax is aligned (synchronized) by successively forwarding its cursor towards the end of M Ax and incrementally cracking M Ax according to all selections it passes on its way. All maps whose cursors point to the same position in T A, are physically aligned.

The Extended sideways.select Operator

Map Set Choice: Self-organizing Histograms Following the “cracking philosophy”  In an unpredictable environment with no idle system time, always perform the minimum investment. In this way, for a query q, a set SA is chosen such that the restriction on A is the most selective in q.  Yielding a minimal bit vector The most selective restriction can be found using the cracker indices.

Complex Queries No other (relational) operators, rather than tuple reconstruction, depends on tuple insertion order.  Joins,aggregations, groupings, etc. Potentially many operators can exploit the clustering information in the maps.  A MAX operator can consider only the last piece of a map.  Such directions are for future work.

Experimental Analysis Compare the implementation of selection and sideways cracking on top of MonetDB, Against the latest non-cracking version of MonetDB, And against MonetDB on presorted data. Results  Sideways cracking achieves similar performance to presorted data.  But does not have the heavy initial cost and the restrictions on updates and workload prediction.

Partial Sideways Cracking Consider storage restriction Partial Maps  Maps are only partially materialized driven by the workload.  A map consists of several chunks.  Each chunk is a separate two-column table.  Each chunk contains a given value range of the head attribute of this map.  Each chunk is cracked separately.

A Research Direction Improving performance by compression  C-Store uses compression heavily. Can we integrate compression with cracking?

References S. Idreos, M. L. Kersten, S. Manegold. Self- organizing Tuple Reconstruction in Column-stores. In Proceedings of the ACM SIGMOD International Conference on Management of Data, Providence, RI, USA, Accepted for publication, June Daniel J. Abadi, Daniel S. Myers, David J. DeWitt, and Samuel R. Madden 。 Materialization Strategies in a Column-Oriented DBMS. Proceedings of ICDE, April, 2007, Istanbul, Turkey.