Dynamic Granular Locking Approach to Phantom Protection in R-trees Kaushik Chakrabarti Sharad Mehrotra Department of Computer Science University of Illinois.

Slides:



Advertisements
Similar presentations
1 DATA STRUCTURES USED IN SPATIAL DATA MINING. 2 What is Spatial data ? broadly be defined as data which covers multidimensional points, lines, rectangles,
Advertisements

CpSc 3220 File and Database Processing Lecture 17 Indexed Files.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 4: More on Locks Professor Chen Li.
1 CS216 Advanced Database Systems Shivnath Babu Notes 12: Concurrency Control (II)
Concurrency Control Amol Deshpande CMSC424. Approach, Assumptions etc.. Approach  Guarantee conflict-serializability by allowing certain types of concurrency.
Managing Hierarchies of Database Elements (18.6) 1 Presented by Sarat Dasika (114) February 16, 2012.
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Concurrency Control Part 2 R&G - Chapter 17 The sequel was far better than the original! -- Nobody.
Chapter 11 Indexing and Hashing (2) Yonsei University 2 nd Semester, 2013 Sanghyun Park.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo Lecture#22: Concurrency Control – Part 2 (R&G.
COMP 451/651 Indexes Chapter 1.
2-dimensional indexing structure
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.
Managing Hierarchies of Database Elements (18.6) -Neha Saxena Class Id: 214.
Spatial Indexing SAMs. Spatial Access Methods PAMs Grid File kd-tree based (LSD-, hB- trees) Z-ordering + B+-tree R-tree Variations: R*-tree, Hilbert.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter Trees and B-Trees.
Concurrency Control Managing Hierarchies of Database Elements (18.6) 1 Presented by Ronak Shah (214) March 9, 2009.
CPSC 231 B-Trees (D.H.)1 LEARNING OBJECTIVES Problems with simple indexing. Multilevel indexing: B-Tree. –B-Tree creation: insertion and deletion of nodes.
Data Indexing Herbert A. Evans. Purposes of Data Indexing What is Data Indexing? Why is it important?
SIGMOD 99 Efficient Concurrency Control in Multidimensional Access Methods Kaushik Chakrabarti Sharad Mehrotra University of.
1 R-Trees for Spatial Indexing Yanlei Diao UMass Amherst Feb 27, 2007 Some Slide Content Courtesy of J.M. Hellerstein.
Chapter 3: Data Storage and Access Methods
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part B Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
Quick Review of material covered Apr 8 B+-Tree Overview and some definitions –balanced tree –multi-level –reorganizes itself on insertion and deletion.
1 Database indices Database Systems manage very large amounts of data. –Examples: student database for NWU Social Security database To facilitate queries,
GRANULARITY OF LOCKS IN SHARED DATA BASE J.N. Gray, R.A. Lorie and G.R. Putzolu.
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.
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
CS 255: Database System Principles slides: B-trees
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,
Locking Key Ranges with Unbundled Transaction Services 1 David Lomet Microsoft Research Mohamed Mokbel University of Minnesota.
Indexing and Hashing (emphasis on B+ trees) By Huy Nguyen Cs157b TR Lee, Sin-Min.
Practical Database Design and Tuning. Outline  Practical Database Design and Tuning Physical Database Design in Relational Databases An Overview of Database.
Spatial Data Management Chapter 28. Types of Spatial Data Point Data –Points in a multidimensional space E.g., Raster data such as satellite imagery,
The X-Tree An Index Structure for High Dimensional Data Stefan Berchtold, Daniel A Keim, Hans Peter Kriegel Institute of Computer Science Munich, Germany.
Indexing for Multidimensional Data An Introduction.
Chapter 11 Indexing & Hashing. 2 n Sophisticated database access methods n Basic concerns: access/insertion/deletion time, space overhead n Indexing 
Department of Computer Science and Engineering, HKUST 1 More on Isolation.
Indexing for Multidimensional Data An Introduction.
DBMS 2001Notes 4.1: B-Trees1 Principles of Database Management Systems 4.1: B-Trees Pekka Kilpeläinen (after Stanford CS245 slide originals by Hector Garcia-Molina,
1 Tree Indexing (1) Linear index is poor for insertion/deletion. Tree index can efficiently support all desired operations: –Insert/delete –Multiple search.
Indexing and hashing Azita Keshmiri CS 157B. Basic concept An index for a file in a database system works the same way as the index in text book. For.
Index tuning-- B+tree. overview Overview of tree-structured index Indexed sequential access method (ISAM) B+tree.
Midterm 3 Revision Professor Sin-Min Lee Department of Computer Science.
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
1 CSIS 7101: CSIS 7101: Spatial Data (Part 1) The R*-tree : An Efficient and Robust Access Method for Points and Rectangles Rollo Chan Chu Chung Man Mak.
CS 540 Database Management Systems
Indexing. 421: Database Systems - Index Structures 2 Cost Model for Data Access q Data should be stored such that it can be accessed fast q Evaluation.
R* Tree By Rohan Sadale Akshay Kulkarni.  Motivation  Optimization criteria for R* Tree  High level Algorithm  Example  Performance Agenda.
A Spatial Index Structure for High Dimensional Point Data Wei Wang, Jiong Yang, and Richard Muntz Data Mining Lab Department of Computer Science University.
1 Tree-Structured Indexes Chapter Introduction  As for any index, 3 alternatives for data entries k* :  Data record with key value k   Choice.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Tree-Structured Indexes Content based on Chapter 10 Database Management Systems, (3 rd.
1 CSCE 520 Test 2 Info Indexing Modified from slides of Hector Garcia-Molina and Jeff Ullman.
Chapter 11 Indexing And Hashing (1) Yonsei University 1 st Semester, 2016 Sanghyun Park.
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.
Spatial Data Management
Mehdi Kargar Department of Computer Science and Engineering
Concurrency Control Managing Hierarchies of Database Elements (18.6)
CS522 Advanced database Systems
Azita Keshmiri CS 157B Ch 12 indexing and hashing
Concurrency Control More !
Chapter 12: Query Processing
Transactions, Locking and Query Optimisation
Transactions and Concurrency
Concurrency Control E0 261 Prasad Deshpande, Jayant Haritsa
Presentation transcript:

Dynamic Granular Locking Approach to Phantom Protection in R-trees Kaushik Chakrabarti Sharad Mehrotra Department of Computer Science University of Illinois at Urbana Champaign Presented at: ICDE 98

MARS February 27, 1998 ICDE 98 Multidimensional Index Structures §Applications: GIS, CAD, Content-based multimedia retrieval, time-series §Data structures: R-trees, k-d-B-trees, hB- trees, X-trees, TV-trees, SS-trees §Most of them not supported in any commercial system (Exception: R-tree in Informix Universal Server as Spatial Datablade)

MARS February 27, 1998 ICDE 98 Why Multidimensional Index Structures are NOT supported as ACCESS METHODS by commercial DBMSs today? §Lack of protocols to concurrent access to data via multidimensional index structures §Two problems of concurrency control: l Preserving the physical consistency of the data structure l Phantom protection This paper provides an approach to phantom protection in R-trees.

MARS February 27, 1998 ICDE 98 Why do we choose R-trees in preference to other multidimensional access methods? §The most popular multidimensional index structure used today §Only one used in a commercial DBMS (Informix IUS)

MARS February 27, 1998 ICDE 98 What are phantoms? §Consider a range query over a B-tree based on employee salary: select employees where 50K < salary < 100K §Locking all employee records do not prevent insertion of an employee making 80K after the read is over but before it commits because there is no lock on nonexistent records. §Insertions may be due to new insertions or rolling back deletions. §If the searcher repeats its scan, it finds a new record appeared from nowhere --- PHANTOM! §Not repeatable read => not serializable.

MARS February 27, 1998 ICDE 98 Approaches to Phantom Protection PREDICATE LOCKING §lock predicates instead of objects §lock granted if predicates don’t conflict (or modes don’t conflict) §needs checking for predicate satisfiability to detect conflicts §too expensive to be used in a LM §not used in any commercial DBMS GRANULAR LOCKING §engineering approach to predicate locks §key space divided in resource granules §conflicting predicate locks must request conflicting granular locks on at least one granule in common §locks acquired on granules -- as efficient as object locks §used in all commercial DBMSs

MARS February 27, 1998 ICDE 98 How are phantoms prevented in B-trees? §Key ranges (k, k i+1 ], defined by the ordered list of attribute values present in the B-tree such that k < k i+1, serve as granules

MARS February 27, 1998 ICDE 98 Can KRL be generalized for R-trees? §No : KRL relies on total order of underlying objects based on their key values. Such an order does not exists for spatial objects indexed using R-trees.

MARS February 27, 1998 ICDE 98 Granular Locks

MARS February 27, 1998 ICDE 98 Criteria for choosing lock granules §Define resource granules: l dynamic l covering l fine §Easy mapping of predicates to locks §Take care of possibility of overlap among granules - no exclusive lock coverage

MARS February 27, 1998 ICDE 98 R-trees §Leaf granules: BR(R3), BR(R4), BR(R5), BR(R6), BR(R7) §External Granules l ext(root) covering S-(BR(R1) U BR(R2)) l ext(R1) covering BR(R1)-(BR(R3) U BR(R4) U BR(R5)) l ext(R2) covering BR(R2)-(BR(R6) U BR(R7))

MARS February 27, 1998 ICDE 98 Rtree

MARS February 27, 1998 ICDE 98 R-trees

MARS February 27, 1998 ICDE 98 Resource Granules in R-trees §Leaf granules (lowest level BRs) §External granules (BR of non-leaf node minus BRs of all its children)

MARS February 27, 1998 ICDE 98 Strategies §Searcher acquires S locks on all overlapping granules §Inserter acquires IX lock on the minimal covering set of granules §Suitable for R-trees since searchers follow all overlapping paths §Searcher acquires S locks on the minimal covering set of granules §Inserter acquires IX locks on all overlapping granules §Suitable for R+-trees since inserters follow all overlapping paths

MARS February 27, 1998 ICDE 98 They don’t work!

MARS February 27, 1998 ICDE 98 Why? §An insertion may cause the loss of coverage of an S lock

MARS February 27, 1998 ICDE 98 How to avoid it? §Require inserters to acquire short duration IX locks on all overlapping granules §Overhead: Extra disk access

MARS February 27, 1998 ICDE 98 Overhead Optimization §ONLY the insertions that causes the granule boundary to change acquires short duration IX locks on all overlapping granules in addition to the commit duration IX on the target granule. Others acquire only the target granule lock. §Reduces overhead drastically: Only 4% of the insertions change granule boundaries for a R-tree with fanout 50.

MARS February 27, 1998 ICDE 98 Can a searcher’s lock even on an external granule lose it coverage? §Yes. Here’s an example:

MARS February 27, 1998 ICDE 98 How to avoid it? §When the granule grows, inserter acquires a short duration SIX on the external granule of the parent.

MARS February 27, 1998 ICDE 98 Node Splits §Can cause loss of lock coverage §Prevented by requesting a short duration SIX on the leaf/external granule being split

MARS February 27, 1998 ICDE 98 Deletions §Deletion can cause loss of lock coverage of the deleter §Prevented by logical deletion §Physical deletion on/after commit (synchronous/asynchronous) §IX lock on the granule before deletion

MARS February 27, 1998 ICDE 98 Lock Protocols §Search: commit duration S locks on all overlapping granules §Insertion: l No granule change: commit duration IX on the target granule l Granule change: commit duration IX on target granule and short duration IX on all overlapping granules/external granules l Node split: short duration SIX on target granule before split; IX lock on granules formed after split §Deletion: l Logical deletion l Asynchronous physical deletion (garbage collection)

MARS February 27, 1998 ICDE 98 Comparison to Predicate Locking Granular Locking §High concurrency by choosing fine granules (lower than PL) §Low lock overhead (no predicate checking ) §Small I/O overhead for some insertions §Lock overhead independent of MPL §Can be implemented using a regular LM Predicate Locking §Maximum permissible concurrency §High lock overhead ( involves predicate checking) §Space overhead of maintaining predicates §Lock overhead increases with MPL §Needs a separate predicate manager component

MARS February 27, 1998 ICDE 98 Conclusions §Concurrency control protocols are crucial to integration of multidimensional index structures as access methods to DBMSs. This paper is a step towards that. §Granular locking provides slightly lower concurrency compared to PL but is more efficient than PL. Proper comparison is possible after implementation of both protocols and measuring throughput and response time Slides available at: