Chapter 4: Transaction Management

Slides:



Advertisements
Similar presentations
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 5: Tree-based Concurrency Control and Validation Currency Control Professor.
Advertisements

Concurrency Control Part 2 R&G - Chapter 17 The sequel was far better than the original! -- Nobody.
Chapter 4: Trees Part II - AVL Tree
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Tree-Structured Indexes Chapter 9.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
1 Lecture 8: Data structures for databases II Jose M. Peña
2-dimensional indexing structure
Copyright © 2004 Pearson Education, Inc.. Chapter 14 Indexing Structures for Files.
Chapter 15 B External Methods – B-Trees. © 2004 Pearson Addison-Wesley. All rights reserved 15 B-2 B-Trees To organize the index file as an external search.
Processing Data in External Storage CS Data Structures Mehmet H Gunes Modified from authors’ slides.
Indexing Techniques. Advanced DatabasesIndexing Techniques2 The Problem What can we introduce to make search more efficient? –Indices! What is an index?
BTrees & Bitmap Indexes
1 B trees Nodes have more than 2 children Each internal node has between k and 2k children and between k-1 and 2k-1 keys A leaf has between k-1 and 2k-1.
Tree-Structured Indexes. Introduction v As for any index, 3 alternatives for data entries k* : À Data record with key value k Á Â v Choice is orthogonal.
Chapter 6: Database Evolution Title: AutoAdmin “What-if” Index Analysis Utility Authors: Surajit Chaudhuri, Vivek Narasayya ACM SIGMOD 1998.
1 Tree-Structured Indexes Yanlei Diao UMass Amherst Feb 20, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Chapter 10: Stream-based Data Management Title: Design, Implementation, and Evaluation of the Linear Road Benchmark on the Stream Processing Core Authors:
Transactions – T4.3 Title: Concurrency Control Performance Modeling: Alternatives and Implications Authors: R. Agarwal, M. J. Carey, M. Livny ACM TODS,
Chapter 3: Data Storage and Access Methods
1 Tree-Structured Indexes Chapter Introduction  As for any index, 3 alternatives for data entries k* :  Data record with key value k   Choice.
B + -Trees (Part 1). Motivation AVL tree with N nodes is an excellent data structure for searching, indexing, etc. –The Big-Oh analysis shows most operations.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
B + -Trees (Part 1) COMP171. Slide 2 Main and secondary memories  Secondary storage device is much, much slower than the main RAM  Pages and blocks.
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
1 Database Tuning Rasmus Pagh and S. Srinivasa Rao IT University of Copenhagen Spring 2007 February 8, 2007 Tree Indexes Lecture based on [RG, Chapter.
File Structures Dale-Marie Wilson, Ph.D.. Basic Concepts Primary storage Main memory Inappropriate for storing database Volatile Secondary storage Physical.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Tirgul 6 B-Trees – Another kind of balanced trees.
B+ Review. B+ Tree: Most Widely Used Index Insert/delete at log F N cost; keep tree height- balanced. (F = fanout, N = # leaf pages) Minimum 50% occupancy.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Tree-Structured Indexes Chapter 9.
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,
Introduction to Database Systems1 B+-Trees Storage Technology: Topic 5.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, VUW Indexing Large Data COMP
Chapter 61 Chapter 6 Index Structures for Files. Chapter 62 Indexes Indexes are additional auxiliary access structures with typically provide either faster.
B+ Tree What is a B+ Tree Searching Insertion Deletion.
B-Tree. B-Trees a specialized multi-way tree designed especially for use on disk In a B-tree each node may contain a large number of keys. The number.
 B+ Tree Definition  B+ Tree Properties  B+ Tree Searching  B+ Tree Insertion  B+ Tree Deletion.
Index Structures for Files Indexes speed up the retrieval of records under certain search conditions Indexes called secondary access paths do not affect.
ICS 220 – Data Structures and Algorithms Week 7 Dr. Ken Cosh.
Database Management 8. course. Query types Equality query – Each field has to be equal to a constant Range query – Not all the fields have to be equal.
1 Index Structures. 2 Chapter : Objectives Types of Single-level Ordered Indexes Primary Indexes Clustering Indexes Secondary Indexes Multilevel Indexes.
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (continued) Advanced Implementation of Tables.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
COSC 2007 Data Structures II Chapter 15 External Methods.
12.1 Chapter 12: Indexing and Hashing Spring 2009 Sections , , Problems , 12.7, 12.8, 12.13, 12.15,
File Organization Lecture 1
B + -Trees. Motivation An AVL tree with N nodes is an excellent data structure for searching, indexing, etc. The Big-Oh analysis shows that most operations.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture17.
Lecture 11COMPSCI.220.FS.T Balancing an AVLTree Two mirror-symmetric pairs of cases to rebalance the tree if after the insertion of a new key to.
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.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
B+ Tree Index tuning--. overview B + -Tree Scalability Typical order: 100. Typical fill-factor: 67%. –average fanout = 133 Typical capacities (root at.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 B+-Tree Index Chapter 10 Modified by Donghui Zhang Nov 9, 2005.
1 Tree-Structured Indexes Chapter Introduction  As for any index, 3 alternatives for data entries k* :  Data record with key value k   Choice.
Tree-Structured Indexes Chapter 10
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Tree-Structured Indexes Chapter 10.
Database Applications (15-415) DBMS Internals- Part III Lecture 13, March 06, 2016 Mohammad Hammoud.
Tree-Structured Indexes. Introduction As for any index, 3 alternatives for data entries k*: – Data record with key value k –  Choice is orthogonal to.
COMP261 Lecture 23 B Trees.
Indexing Structures for Files and Physical Database Design
Tree-Structured Indexes
External Methods Chapter 15 (continued)
B+-Trees and Static Hashing
CS222/CS122C: Principles of Data Management Notes #07 B+ Trees
Chapter 10 Transaction Management and Concurrency Control
Indexing and Hashing Basic Concepts Ordered Indices
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.
Indexing 4/11/2019.
CS222/CS122C: Principles of Data Management UCI, Fall 2018 Notes #06 B+ trees Instructor: Chen Li.
CS222P: Principles of Data Management UCI, Fall Notes #06 B+ trees
Presentation transcript:

Chapter 4: Transaction Management Title: Efficient Locking for Concurrent Operations on B-Trees Authors: Philip L. Lehman, S. Bing Yao Pages: 334-354

Efficient Locking for Concurrent Operations on B-Trees Problem Problem Statement Why is this problem important? Why is this problem hard? Approaches Approach description, key concepts Contributions (novelty, improved) Assumptions

Problem Statement Given Find: Efficient Locking Objectives Constraints Data on secondary storage devices Database index Find: Efficient Locking Locking mechanisms for search, insertion, and deletion Objectives The mechanisms are safe from concurrent operations Constraints Many processes are allowed to operate on the data simultaneously. Each process do not share its primary memory. Disk page is the smallest unit of read and write. Locks should not prevent other processes from reading the locked page.

Why is this problem important? B-tree or B*-tree is widely used as a data structure for storing large files of information on secondary storage devices. Most databases are manipulated concurrently by several processes.

Why is this problem Hard? Locking root may reduce concurrency. Depending upon nodes parent – child Insert / split may go up many levels split / insert conflicts with read, insert Concurrent operation on B*-tree is erroneous. A, B, C: blocks of primary storage x, y, z: variables in the primary storage

Novelty of Contribution Related Work Naïve approach to concurrent B-tree problem fails. Using semaphore locks entire sub-tree affected by updates. B*-tree Locks are applied mostly in lower sections of tree. Contributions Uses a small (constant) # of locks at any time Locks only prevent multiple update access.

Principles of Blink-tree Add a single ‘link’ pointer field to each node. The link provides an additional method for reaching a node. The split two nodes are joined by a link pointer, and are functionally essentially the same as a single node. The link pointer serves as a ‘temporary fix’ that allows correct concurrent operation. Additionally, the Blink-tree enables serial search, i.e., retrieving nodes in the same level (e.g., retrieving only leaves). Reference: A Guttman ‘R-tree a dynamic index structure for spatial searching’, 1984

Example of Blink-tree

Search, Insertion Algorithms If a current node is to split, the search algorithm rectifies the error by following the link pointer of the newly split node. Insertion The insertion may cause splitting a node. (= unsafe) Lock a node before modification. Example: Splitting node a into node a’ and b’

Locking Efficiency The insertion algorithm uses at most a constant # of locks (three) for any process at any time. Split  chaining across the level of nodes containing the father to find the correct insertion position  Three nodes are locked for the duration of one operation. This type of locking occurs rarely in a Blink-tree Extremely small collision probability Example: Splitting node a into node a’ and b’

Validation Methodology Correctness Proof Theorem 1: Deadlock Freedom. The system can’t produce deadlock. Impose an order: bottom to top / left to right Locks are placed by the inserter according to a well-ordering As long as inserter follow the well-ordering, it never places a lock on any node below a locked node, nor on any node to the left. Theorem 2: All put operations correctly modify tree structure. Classify put operations into three types. Prove the correctness of first case and show consecutive put operations is equivalent to one change. Theorem 3: Interaction Theorem. Actions of an insertion process don’t impair correctness of actions of other processes. Classify three possible types of insertion. Apply lemma 3 to several aspects separately. Livelock: one process runs indefinitely. extremely unlikely problem

Class Exercise 1/2 How can we resolve the erroneous behavior of B*-tree using Blink-tree? A, B, C: blocks of primary storage x, y, z: variables in the primary storage

Class Exercise 2/2 Can insert lead to deadlock? Livelock? Many nodes have 2 pointers pointing to them, One from parent One from left sibling Which one is created first? In the figure (b), why the right link was created first? Example: Splitting node a into node a’ and b’

Summary Paper’s focus Ideas Contributions Analytical Validation Blink-tree – implementations and correctness Ideas Link provides an additional method to reach a node. The split two nodes work as a single node by the link. Contributions Locking scheme is simpler (no read-locks). A constant # of nodes are locked. Analytical Validation Correctness proofs

Assumptions, Rewrite today Many processes can operate on data simultaneously. A process is allowed to lock and unlock a disk page. Rewrite today Compare with newer methods T-tree Experimental evaluation - Simulation Measure lock efficiency