Introduction to Indexing R-trees. Hong Kong University of Science and Technology

Size: px
Start display at page:

Download "Introduction to Indexing R-trees. Hong Kong University of Science and Technology"

Transcription

1 Introduction to Indexing R-trees Dimitris Papadias Hong Kong University of Science and Technology 1

2 Introduction to Indexing 1. Assume that you work in a government office, and you maintain the records of 10 million people HK residents 2. The record of each resident contains the HK ID, address, telephone etc. 3. People come to your office, and ask you to retrieve the records of persons given their HK ID (i.e., "show me the record of person with HK ID: ") 4. Lets forget computers for now. You just want to print the records in a catalog, so you answer these queries by manually looking up the catalog Assuming that you can put 10 records per printed page, the catalog will be 1 million pages 2

3 Introduction to Indexing (2) How would you arrange the records in the catalog? Your goal is to minimize the effort of finding records We measure this cost as the number of pages you have to "open" before finding the record Solution 1 - random order If the catalog contains records in random order of HK ID, then in the worst case you have to search the entire catalog (cost = 10 6 ) before finding a record, or to determine that the HK ID does not exist in the catalog Solution 2 - records sorted on HK ID You can apply binary search with cost log = 20 Same discussion applies when we use computers; instead of the printed pages, we have disk pages (e.g., size 8 KB) Every time we read something from the disk (even a single number) we need to bring an entire page in main memory. The major cost is how many pages we read because disk operations are much more expensive than CPU operations Can you make it even faster? 3

4 Introduction to Indexing (3) Lets keep the sorted file and build an additional index (e.g., at the beginning of the catalog). Each index entry is a small record, that contains a HK ID and the page where you can find this ID (e.g., < , 259> means that HK ID is on page 259 of the catalog. HK ID is called the search key of the index Since each index entry is much smaller than the record, lets assume that we can fit 100 entries per page. The index entries are also sorted on HK ID Do we need an index entry for each of the 10,000,000 records? No: we only need an entry for the first record of each page Example: If I have two consecutive entries < , 259>, < , 260> in the index, then I know that every HK ID between and must be on page 259. Therefore, I only need only 1,000,000 index entries (one for each page of the main catalog). 4

5 Introduction to Indexing (4) Given that I can fit 100 entries per page, and I have 1,000,000 entries, my index is 10,000 pages. How I can use the index to speed up search for a record? Use binary search on the index to find the largest HK ID that is smaller or equal to input HK ID. The cost is log = 14. Then, follow the pointer from that entry to the actual catalog (cost 1) Total cost: 14+1 = 15 Can I drop the cost even further? Yes: Build an index on the index The second level index contains 10,000 entries (one for each page of the first index) in 100 pages. Use binary search on the second level index to find the largest HK ID that is smaller or equal to input HK ID. The cost is log = 7. Then, follow the pointer from that entry to first level index and finally to the actual catalog (cost 2) Total cost: 7+2 = 9 Finally build a third level index containing 100 entries, one for each page of the second level index. These entries fit in one page. Read this page - find the largest HK ID that is smaller or equal to input HK ID and follow the pointers to second level index, first level index and file. Total cost: 4 5

6 B+trees The B+ tree, the most common index for relational databases, applies the same ideas. Instead of the printed pages, we have index pages, called nodes There are several variations, but the main idea is the same - given a search key always follow a path from the root to the actual record. The cost of retrieving a record is always the number of levels in the tree plus 1 6

7 Additional Issues on Indexes In general, the index we choose depends on the type of queries that we want to process efficiently B+-trees are good for record retrieval based on the search key, and range queries: e.g., find all records with HK ID between and Complication: when we update the file, we also need to update the index In order to update the index efficiently, and at the same time guarantee performance, we need some clever algorithms Every index node must be at least half-full (i.e., it must contain a certain number of entries) If most nodes are almost empty then the index may be very large If we find a node that underflows we should do something about it (e.g., take entries from a sibling node - or merge with a sibling node) If a node overflows we must split it 7

8 Primary vs. Secondary Indexes Primary index (also called clustering index): in a sequentially ordered file, the index whose search key specifies the sequential order of the file. The search key of a primary index is usually but not necessarily the primary key. Example: File sorted on HKID and B+-tree on HKID Secondary index (also called non-clustering index): an index whose search key specifies an order different from the sequential order of the file. Example: File sorted on HKID and B+-tree on Name What is the maximum number of primary indexes that you can build on a single file?

9 Example of non-clustering (secondary) B+-tree FILE WITH RECORDS record with search key 11 record with search key 3 record with search key 1 Should be always dense

10 Inserting a Data Entry into a B+ Tree Find correct leaf L. Put data entry onto L. If L has enough space, done! Else, must split L (into L and a new node L2) Redistribute entries evenly, copy up middle key. Insert index entry pointing to L2 into parent of L. This can happen recursively To split index node, redistribute entries evenly, but push up middle key. (Contrast with leaf splits.) Splits grow tree; root split increases height. Tree growth: gets wider or one level taller at top.

11 Deleting a Data Entry from a B+ Tree Start at root, find leaf L where entry belongs. Remove the entry. If L is at least half-full, done! If L less that half-full, Try to re-distribute, borrowing from sibling (adjacent node to the right). If re-distribution fails, merge L and sibling. If merge occurred, must delete entry (pointing to L or sibling) from parent of L. Merge could propagate to root, decreasing height.

12 B+-tree Update Examples Consider the B+-tree below where each node except for the root must contain at least two search key values and 3 pointers. Show the tree that would result after successively applying each of the following operations Remove 1 41 Remove

13 After removing 41 B+-tree Update Examples (cont) Remove 3 Insert

14 After inserting 41 B+-tree Update Examples (cont) Insert

15 Bulk Loading of a B+ Tree If we have a large collection of records, and we want to create a B+ tree on some field, doing so by repeatedly inserting records is very slow. Bulk Loading can be done much more efficiently. Initialization: Sort all data entries (using external sorting), insert pointer to first (leaf) page in a new (root) page. Root Sorted pages of data entries; not yet in B+ tree 3* 4* 6* 9* 10* 11* 12* 13* 20* 22* 23* 31* 35* 36* 38* 41* 44*

16 Index entries for leaf pages always entered into right-most index page just above leaf level. When this fills up, it splits. (Split may go up right-most path to the root.) Much faster than repeated inserts! Bulk Loading (Cont.) 6 Root Data entry pages not yet in B+ tree 3* 4* 6* 9* 10* 11* 12* 13* 20*22* 23* 31* 35*36* 38*41* 44* Root Data entry pages not yet in B+ tree * 4* 6* 9* 10* 11* 12* 13* 20*22* 23* 31* 35*36* 38*41* 44*

17 What is Special About Spatial The search key is now the location of an object and we want to process spatial ranges (e.g., find all buildings that are within 1km of HKUST) or nearest neighbors (e.g., find the 2 closest MTR stations from HKUST) Relational indexes (e.g. B + -trees) and query processing methods are not readily applicable to spatial databases because there is no total ordering of objects in the multidimensional space that preserves spatial proximity 1D ordering using x-coordinate and space filling curves Multidimensional access methods index spatial data and facilitate efficient processing of simple spatial query types (i.e. range queries)

18 MBRs and 2-step Spatial Query Processing A spatial object is approximated by its minimum bounding rectangle (MBR) - i.e., the search key is the MBR A spatial query is then processed in two steps: 1. Filter step: The MBR is tested against the query predicate 2. Refinement step: The exact geometry of objects that pass the filter step is tested for qualification Example: find the objects that intersect the green object filtered pair non-qualifying pair that passes the filter step (false hit) qualifying pair Other approximations possible, but MBRs have in general the best performance

19 R-trees A height balanced tree similar to B + -tree that indexes spatial objects and processes the filter step. Objects are grouped in nodes (disk pages) according to spatial proximity (i.e., a problem similar to clustering) Minimum node utilization m is variable, usually 40% of maximum page capacity b For typical page sizes (e.g., 4Kbytes or more), m and b are in the order of hundreds Each entry is a pair (MBR, ptr), that contains: a pointer ptr to an indexed object or a lower level node the MBR of the pointed object or node R-trees can be used to of most spatial queries

20 y axis e b c f d g E 3 R-Tree Example h a i m j k l Minimum Bounding Rectangle (MBR) x axis Root E 1 E 2 For simplicity node capacity = 3 In practice, in the order of 100 E 1 E 3 E 4 E 5 E 6 E 7 E2 a b c d e f g h i j k l m E E 3 4 E 5 E E

21 R-Tree, Leaf Nodes y axis g h e f E 4 E 5 d b E 3 a c m E 7 l E 6 k i j x axis Root E 1 E 2 E 1 E 3 E 4 E 5 E 6 E 7 E2 a b c d e f g h i j k l m E E 3 4 E 5 E E

22 R-Tree Intermediate Nodes y axis m g h l k e f E 2 i j d E 1 b a c x axis Root E 1 E 2 E 1 E 3 E 4 E 5 E 6 E 7 E2 a b c d e f g h i j k l m E E 3 4 E 5 E E

23 R-tree, Range Query y axis m g h l e f k E 2 i j d E 1 b a c x axis Root E 1 E 2 E 1 E 3 E 4 E 5 E 6 E 7 E2 a b c d e f g h i j k l m E E 3 4 E 5 E E

24 Desirable R-tree Properties 1. The area covered by a node MBR should be minimized (equivalently, minimize the dead space inside MBRs) 2. The overlap between node MBRs should be minimized. Similar to 1, this decreases the number of paths to be traversed during query processing 3. The margin (perimeter) of a node MBR should be minimized. Assuming fixed area, the object with the smallest margin is the square. Since quadratic objects can be packed easier, the MBRs of a level lead to smaller MBRs at the level above R-tree construction algorithms should aim at preserving the above properties

25 R-tree insertion 1. Invoke ChooseSubtree to find an appropriate node N, which to place the new object 2. If N has < b entries, add object in N (no overflow) 3. If N is already full, Split N and propagate split upwards 4. Adjust all covering rectangles in the insertion path such that they are the MBRs enclosing their children rectangles Algorithm ChooseSubtree 1. Set N to be the root 2. If N is a leaf, return N 3. else choose the entry of N that incurs the minimum MBR increase. Resolve ties by choosing the entry with the with the smallest MBR 4. Set N to be the childnode pointed to by the pointer of the chosen entry and goto 2 Deletion: Find the object to be deleted using a top down search of the R-tree and delete it. If there is an underflow (i.e., after deletion the node contains < m entries), delete and re-insert all the objects in the node.

26 Example of ChooseSubtree

27 Quadratic R-tree split algorithm 1. Apply PickSeeds to choose two entries to be the first elements of the groups. Assign each to a group 2. If all entries have been assigned, stop. If one group has so few entries that all the rest must be assigned to it, assign them and stop 3. Invoke Algorithm PickNext to choose the next entry to assign. Add it to the group whose MBR will have to be enlarged least to accommodate it. Resolve ties by adding the entry to the group with smaller MBR, then to the one with fewer entries, then to either 4. Go to 2 PickSeeds 1. For each pair of entries E1 and E2, compose a rectangle J including E1 and E2. Calculate d = area(j) - area(e1) - area(e2) 2. Choose the pair with the largest d (d is the dead space that contains nothing) PickNext 1. For each entry E not yet in a group, calculate d1=the area increase required in the covering rectangle of Group 1 to include E. Calculate d2 similarly for Group 2 2. Choose any entry with the maximum difference between d1 and d2

28 R*-tree R*-tree a more efficient version of the original R-tree that has more complex construction algorithms. R*-tree Insertion 1. Invoke ChooseSubtree to find an appropriate node N, which to place the new entry E 2. If N has < b entries, accommodate E in N (no overflow) 3. If N is already full invoke OverflowTreatment 4. If OverflowTreatment was called and a split was performed, propagate OverflowTreatment upwards 5. Adjust all covering rectangles in the insertion path such that they are the MBRs enclosing their children rectangles

29 R*-tree ChooseSubtree 1. Set N to be the root 2. If N is a leaf, return N 3. else if N points to intermediate nodes, choose the entry that incurs the minimum MBR increase. Resolve ties by choosing the entry with the with the smallest MBR (same as conventional R-tree) If N points to leaves, choose the entry in N whose MBR needs least overlap enlargement to include the new object. Resolve ties by choosing the entry that incurs the minimum MBR increase, then the entry with the smallest MBR 4. Set N to be the childnode pointed to by the pointer of the chosen entry and goto 2

30 R*-tree OverflowTreatment and Reinsert Algorithm OverflowTreatment 1. If the level is not the root level and this is the first call of OverflowTreatment in the given level, then invoke Reinsert 2. else invoke Split Algorithm Reinsert 1. Sort all b+1 entries of (full) node N in decreasing order of distance between their centers and the center of N 2. Remove the first p (30%b) entries and adjust the MBR of N 3. Reinsert the p entries in the tree Note that unlike conventional R-trees, re-insertion also happens at insertions. Reinsertion improves the structure of the tree because it alleviates the effect of insertion order.

31 R*-tree split algorithm Algorithm Split 1. Invoke ChooseSplitAxis to determine the axis, perpendicular to which the split is performed 2. Invoke ChooseSplitIndex to determine the best distribution into two groups along that axis 3. Distribute the entries into two groups Algorithm ChooseSplitAxis 1. For each axis Sort the entries by the lower (then by the upper value of their rectangles) and determine all distributions. Compute the sum S of all margin-values of the different distributions 2. Choose the axis with the minimum S as split axis Algorithm ChooseSplitlndex 1. Along the chosen split axis, choose the distribution with the minimum overlapvalue. Resolve ties by choosing the distribution with the minimum area

32 Example of R* split - ChooseSplitlndex Assume that node capacity is 7 and a node has 8 entries (overflows). The minimum node utilization is m=3 ( 40% 7). We first determine the split axis by considering all possible distributions on each axis. Let the split axis be x. Then we consider again all possible distributions (i.e., sorted orders on x) subject to m (3-5, 4-4, 5-3). The final grouping is the one with minimum overlap.

33 Bulk-loaded R-trees For static objects: Sort objects according to geometric criterion (e.g., x-coordinates, Hilbert value) and insert objects in nodes according to the sorted order (i.e., first b objects go to the first leaf node and so on). Much faster than individual insertions. Trees are packed (i.e., nodes are full) (a) California roads (b) Node MBRs of R* -tree (c) Sorting on x- coordinate (d) Sorting on Hilbert value

34 Selectivity Estimation- Multi-dimensional histograms Goal: Guess how may objects are there in a query window without actually processing the query. Important for Query Optimization and Cost Models Main idea: Divide the space in buckets, so that data in each bucket are almost uniform. Keep in memory the bucket extents and the number of objects per bucket Use this information to estimate the number of objects in query window MINSKEW example y 5 y 4 y 3 y y 5 y 4 y 3 y 2 window query b 1 9 b 3 13 b 4 b 6 y y 1 b 2 b 5 x 1 x 2 x 3 x 4 x 5 x 1 x 2 x 3 x 4 x 5

35 Selectivity Estimation - Other Methods Random Sampling: Keep a sample of n objects out of N (data cardinality) objects in memory Let f be the number of samples that fall inside the query window Then, the expected cardinality of the query output is fn/n Power Laws : Given a dataset with intrinsic dimension d, the average selectivity of biased window queries with extent r (per axis) equals N r d. Assumptions: unit space and queries that follow the data distribution Note: the estimation is independent of the query location a a 2D uniform (d=2) Line dataset (d=1) Sierpinski (d=1.58)

36 Other Uses of R-trees Temporal Databases (1D R-trees) Keep the value of a search key over time Spatio-temporal Databases (3D R-trees) Keep extents of spatial objects over time y N2 d e time b a N 1 b a c d e c d' e' N 2 ' x d and e change location time t 1

37 Predictive Indexing of Spatial Objects The database stores the motion functions of moving objects. For each object o, its motion function gives its location o(t) at a future time t. A predictive window query specifies a query region q R and a future time interval q T retrieves the set of all objects that will fall in q R during q T. Examples Find all airplanes that will be over California in the next 10 minutes. Report all vessels that will enter the United States in the next hour.

38 Motion function We consider linear motion y axis -2-2 b a d 1-2 at time c 2 x axis y axis For each object, the database stores Its MBR at the reference time 0 b a d c at time Its current velocity bounding rectangle (VBR) Examples: MBR(a)={2,4,3,4}, VBR(a)={1,1,1,1}; MBR(c)={8,9,8,9}, VBR(c)={-2,0,-2,0}; x axis An update is necessary only when an object s VBR changes.

39 The Time Parameterized R-Tree Extends the R-tree by introducing the velocity bounding rectangle (VBR) in non-leaf entries. Queries are compared with conservative MBRs of non-leaf entries y axis N 1 d 2 N b a c at time 0 x axis y axis N 1 b a d c N at time 1 q R x axis

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L08: B + -trees and Dynamic Hashing Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR,

More information

Tree-Structured Indexes

Tree-Structured Indexes Tree-Structured Indexes Chapter 9 Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Introduction As for any index, 3 alternatives for data entries k*: Data record with key value k

More information

Physical Level of Databases: B+-Trees

Physical Level of Databases: B+-Trees Physical Level of Databases: B+-Trees Adnan YAZICI Computer Engineering Department METU (Fall 2005) 1 B + -Tree Index Files l Disadvantage of indexed-sequential files: performance degrades as file grows,

More information

Background: disk access vs. main memory access (1/2)

Background: disk access vs. main memory access (1/2) 4.4 B-trees Disk access vs. main memory access: background B-tree concept Node structure Structural properties Insertion operation Deletion operation Running time 66 Background: disk access vs. main memory

More information

Spring 2017 B-TREES (LOOSELY BASED ON THE COW BOOK: CH. 10) 1/29/17 CS 564: Database Management Systems, Jignesh M. Patel 1

Spring 2017 B-TREES (LOOSELY BASED ON THE COW BOOK: CH. 10) 1/29/17 CS 564: Database Management Systems, Jignesh M. Patel 1 Spring 2017 B-TREES (LOOSELY BASED ON THE COW BOOK: CH. 10) 1/29/17 CS 564: Database Management Systems, Jignesh M. Patel 1 Consider the following table: Motivation CREATE TABLE Tweets ( uniquemsgid INTEGER,

More information

Advances in Data Management Principles of Database Systems - 2 A.Poulovassilis

Advances in Data Management Principles of Database Systems - 2 A.Poulovassilis 1 Advances in Data Management Principles of Database Systems - 2 A.Poulovassilis 1 Storing data on disk The traditional storage hierarchy for DBMSs is: 1. main memory (primary storage) for data currently

More information

Introduction to Indexing 2. Acknowledgements: Eamonn Keogh and Chotirat Ann Ratanamahatana

Introduction to Indexing 2. Acknowledgements: Eamonn Keogh and Chotirat Ann Ratanamahatana Introduction to Indexing 2 Acknowledgements: Eamonn Keogh and Chotirat Ann Ratanamahatana Indexed Sequential Access Method We have seen that too small or too large an index (in other words too few or too

More information

Tree-Structured Indexes

Tree-Structured Indexes Tree-Structured Indexes Yanlei Diao UMass Amherst Slides Courtesy of R. Ramakrishnan and J. Gehrke Access Methods v File of records: Abstraction of disk storage for query processing (1) Sequential scan;

More information

Tree-Structured Indexes

Tree-Structured Indexes Tree-Structured Indexes Chapter 9 Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Introduction As for any index, 3 alternatives for data entries k*: ➀ Data record with key value k ➁

More information

Introduction. Choice orthogonal to indexing technique used to locate entries K.

Introduction. Choice orthogonal to indexing technique used to locate entries K. Tree-Structured Indexes Werner Nutt Introduction to Database Systems Free University of Bozen-Bolzano 2 Introduction As for any index, three alternatives for data entries K : Data record with key value

More information

THE B+ TREE INDEX. CS 564- Spring ACKs: Jignesh Patel, AnHai Doan

THE B+ TREE INDEX. CS 564- Spring ACKs: Jignesh Patel, AnHai Doan THE B+ TREE INDEX CS 564- Spring 2018 ACKs: Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? The B+ tree index Basics Search/Insertion/Deletion Design & Cost 2 INDEX RECAP We have the following query:

More information

Chapter 12: Indexing and Hashing. Basic Concepts

Chapter 12: Indexing and Hashing. Basic Concepts Chapter 12: Indexing and Hashing! Basic Concepts! Ordered Indices! B+-Tree Index Files! B-Tree Index Files! Static Hashing! Dynamic Hashing! Comparison of Ordered Indexing and Hashing! Index Definition

More information

Chapter 12: Indexing and Hashing

Chapter 12: Indexing and Hashing Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL

More information

Material You Need to Know

Material You Need to Know Review Quiz 2 Material You Need to Know Normalization Storage and Disk File Layout Indexing B-trees and B+ Trees Extensible Hashing Linear Hashing Decomposition Goals: Lossless Joins, Dependency preservation

More information

Tree-Structured Indexes

Tree-Structured Indexes Tree-Structured Indexes Chapter 10 Comp 521 Files and Databases Fall 2010 1 Introduction As for any index, 3 alternatives for data entries k*: index refers to actual data record with key value k index

More information

Tree-Structured Indexes

Tree-Structured Indexes Introduction Tree-Structured Indexes Chapter 10 As for any index, 3 alternatives for data entries k*: Data record with key value k

More information

Introduction to Data Management. Lecture 15 (More About Indexing)

Introduction to Data Management. Lecture 15 (More About Indexing) Introduction to Data Management Lecture 15 (More About Indexing) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v HW s and quizzes:

More information

Chapter 11: Indexing and Hashing

Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL

More information

Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See  for conditions on re-use Chapter 11: Indexing and Hashing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files Static

More information

Chap4: Spatial Storage and Indexing. 4.1 Storage:Disk and Files 4.2 Spatial Indexing 4.3 Trends 4.4 Summary

Chap4: Spatial Storage and Indexing. 4.1 Storage:Disk and Files 4.2 Spatial Indexing 4.3 Trends 4.4 Summary Chap4: Spatial Storage and Indexing 4.1 Storage:Disk and Files 4.2 Spatial Indexing 4.3 Trends 4.4 Summary Learning Objectives Learning Objectives (LO) LO1: Understand concept of a physical data model

More information

Spatiotemporal Access to Moving Objects. Hao LIU, Xu GENG 17/04/2018

Spatiotemporal Access to Moving Objects. Hao LIU, Xu GENG 17/04/2018 Spatiotemporal Access to Moving Objects Hao LIU, Xu GENG 17/04/2018 Contents Overview & applications Spatiotemporal queries Movingobjects modeling Sampled locations Linear function of time Indexing structure

More information

Lecture 13. Lecture 13: B+ Tree

Lecture 13. Lecture 13: B+ Tree Lecture 13 Lecture 13: B+ Tree Lecture 13 Announcements 1. Project Part 2 extension till Friday 2. Project Part 3: B+ Tree coming out Friday 3. Poll for Nov 22nd 4. Exam Pickup: If you have questions,

More information

Principles of Data Management. Lecture #5 (Tree-Based Index Structures)

Principles of Data Management. Lecture #5 (Tree-Based Index Structures) Principles of Data Management Lecture #5 (Tree-Based Index Structures) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Today s Headlines v Project

More information

Tree-Structured Indexes ISAM. Range Searches. Comments on ISAM. Example ISAM Tree. Introduction. As for any index, 3 alternatives for data entries k*:

Tree-Structured Indexes ISAM. Range Searches. Comments on ISAM. Example ISAM Tree. Introduction. As for any index, 3 alternatives for data entries k*: Introduction Tree-Structured Indexes Chapter 10 As for any index, 3 alternatives for data entries k*: Data record with key value k

More information

CARNEGIE MELLON UNIVERSITY DEPT. OF COMPUTER SCIENCE DATABASE APPLICATIONS

CARNEGIE MELLON UNIVERSITY DEPT. OF COMPUTER SCIENCE DATABASE APPLICATIONS CARNEGIE MELLON UNIVERSITY DEPT. OF COMPUTER SCIENCE 15-415 DATABASE APPLICATIONS C. Faloutsos Indexing and Hashing 15-415 Database Applications http://www.cs.cmu.edu/~christos/courses/dbms.s00/ general

More information

Announcements. Reading Material. Recap. Today 9/17/17. Storage (contd. from Lecture 6)

Announcements. Reading Material. Recap. Today 9/17/17. Storage (contd. from Lecture 6) CompSci 16 Intensive Computing Systems Lecture 7 Storage and Index Instructor: Sudeepa Roy Announcements HW1 deadline this week: Due on 09/21 (Thurs), 11: pm, no late days Project proposal deadline: Preliminary

More information

Tree-Structured Indexes

Tree-Structured Indexes Tree-Structured Indexes CS 186, Fall 2002, Lecture 17 R & G Chapter 9 If I had eight hours to chop down a tree, I'd spend six sharpening my ax. Abraham Lincoln Introduction Recall: 3 alternatives for data

More information

Tree-Structured Indexes. Chapter 10

Tree-Structured Indexes. Chapter 10 Tree-Structured Indexes Chapter 10 1 Introduction As for any index, 3 alternatives for data entries k*: Data record with key value k 25, [n1,v1,k1,25] 25,

More information

Indexing. Chapter 8, 10, 11. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1

Indexing. Chapter 8, 10, 11. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Indexing Chapter 8, 10, 11 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Tree-Based Indexing The data entries are arranged in sorted order by search key value. A hierarchical search

More information

Chapter 12: Indexing and Hashing (Cnt(

Chapter 12: Indexing and Hashing (Cnt( Chapter 12: Indexing and Hashing (Cnt( Cnt.) Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition

More information

R-Trees. Accessing Spatial Data

R-Trees. Accessing Spatial Data R-Trees Accessing Spatial Data In the beginning The B-Tree provided a foundation for R- Trees. But what s a B-Tree? A data structure for storing sorted data with amortized run times for insertion and deletion

More information

Tree-Structured Indexes (Brass Tacks)

Tree-Structured Indexes (Brass Tacks) Tree-Structured Indexes (Brass Tacks) Chapter 10 Ramakrishnan and Gehrke (Sections 10.3-10.8) CPSC 404, Laks V.S. Lakshmanan 1 What will I learn from this set of lectures? How do B+trees work (for search)?

More information

Multimedia Database Systems

Multimedia Database Systems Department of Informatics Aristotle University of Thessaloniki Fall 2016-2017 Multimedia Database Systems Indexing Part A Multidimensional Indexing Techniques Outline Motivation Multidimensional indexing

More information

Intro to DB CHAPTER 12 INDEXING & HASHING

Intro to DB CHAPTER 12 INDEXING & HASHING Intro to DB CHAPTER 12 INDEXING & HASHING Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing

More information

Chapter 11: Indexing and Hashing" Chapter 11: Indexing and Hashing"

Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing" Database System Concepts, 6 th Ed.! Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use " Chapter 11: Indexing and Hashing" Basic Concepts!

More information

Balanced Search Trees

Balanced Search Trees Balanced Search Trees Computer Science E-22 Harvard Extension School David G. Sullivan, Ph.D. Review: Balanced Trees A tree is balanced if, for each node, the node s subtrees have the same height or have

More information

Chapter 11: Indexing and Hashing

Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 11: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree

More information

Problem. Indexing with B-trees. Indexing. Primary Key Indexing. B-trees: Example. B-trees. primary key indexing

Problem. Indexing with B-trees. Indexing. Primary Key Indexing. B-trees: Example. B-trees. primary key indexing 15-82 Advanced Topics in Database Systems Performance Problem Given a large collection of records, Indexing with B-trees find similar/interesting things, i.e., allow fast, approximate queries 2 Indexing

More information

Lecture 8 Index (B+-Tree and Hash)

Lecture 8 Index (B+-Tree and Hash) CompSci 516 Data Intensive Computing Systems Lecture 8 Index (B+-Tree and Hash) Instructor: Sudeepa Roy Duke CS, Fall 2017 CompSci 516: Database Systems 1 HW1 due tomorrow: Announcements Due on 09/21 (Thurs),

More information

Multiway searching. In the worst case of searching a complete binary search tree, we can make log(n) page faults Everyone knows what a page fault is?

Multiway searching. In the worst case of searching a complete binary search tree, we can make log(n) page faults Everyone knows what a page fault is? Multiway searching What do we do if the volume of data to be searched is too large to fit into main memory Search tree is stored on disk pages, and the pages required as comparisons proceed may not be

More information

Tree-Structured Indexes

Tree-Structured Indexes Tree-Structured Indexes Chapter 10 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke Introduction As for any index, 3 alternatives for data entries k*: Data record with key value k

More information

B-Trees & its Variants

B-Trees & its Variants B-Trees & its Variants Advanced Data Structure Spring 2007 Zareen Alamgir Motivation Yet another Tree! Why do we need another Tree-Structure? Data Retrieval from External Storage In database programs,

More information

Chapter 12: Indexing and Hashing

Chapter 12: Indexing and Hashing Chapter 12: Indexing and Hashing Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree

More information

Chapter 11: Indexing and Hashing

Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 11: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree

More information

Indexing. Week 14, Spring Edited by M. Naci Akkøk, , Contains slides from 8-9. April 2002 by Hector Garcia-Molina, Vera Goebel

Indexing. Week 14, Spring Edited by M. Naci Akkøk, , Contains slides from 8-9. April 2002 by Hector Garcia-Molina, Vera Goebel Indexing Week 14, Spring 2005 Edited by M. Naci Akkøk, 5.3.2004, 3.3.2005 Contains slides from 8-9. April 2002 by Hector Garcia-Molina, Vera Goebel Overview Conventional indexes B-trees Hashing schemes

More information

Data Organization B trees

Data Organization B trees Data Organization B trees Data organization and retrieval File organization can improve data retrieval time SELECT * FROM depositors WHERE bname= Downtown 100 blocks 200 recs/block Query returns 150 records

More information

B-Trees. Disk Storage. What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree. Deletion in a B-tree

B-Trees. Disk Storage. What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree. Deletion in a B-tree B-Trees Disk Storage What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree Deletion in a B-tree Disk Storage Data is stored on disk (i.e., secondary memory) in blocks. A block is

More information

Tree-Structured Indexes. A Note of Caution. Range Searches ISAM. Example ISAM Tree. Introduction

Tree-Structured Indexes. A Note of Caution. Range Searches ISAM. Example ISAM Tree. Introduction Tree-Structured Indexes Lecture R & G Chapter 9 If I had eight hours to chop down a tree, I'd spend six sharpening my ax. Abraham Lincoln Introduction Recall: 3 alternatives for data entries k*: Data record

More information

Course Content. Objectives of Lecture? CMPUT 391: Spatial Data Management Dr. Jörg Sander & Dr. Osmar R. Zaïane. University of Alberta

Course Content. Objectives of Lecture? CMPUT 391: Spatial Data Management Dr. Jörg Sander & Dr. Osmar R. Zaïane. University of Alberta Database Management Systems Winter 2002 CMPUT 39: Spatial Data Management Dr. Jörg Sander & Dr. Osmar. Zaïane University of Alberta Chapter 26 of Textbook Course Content Introduction Database Design Theory

More information

Spatial Data Management

Spatial Data Management Spatial Data Management [R&G] Chapter 28 CS432 1 Types of Spatial Data Point Data Points in a multidimensional space E.g., Raster data such as satellite imagery, where each pixel stores a measured value

More information

Multidimensional Data and Modelling - DBMS

Multidimensional Data and Modelling - DBMS Multidimensional Data and Modelling - DBMS 1 DBMS-centric approach Summary: l Spatial data is considered as another type of data beside conventional data in a DBMS. l Enabling advantages of DBMS (data

More information

Spatial Data Management

Spatial Data Management Spatial Data Management Chapter 28 Database management Systems, 3ed, R. Ramakrishnan and J. Gehrke 1 Types of Spatial Data Point Data Points in a multidimensional space E.g., Raster data such as satellite

More information

Extra: B+ Trees. Motivations. Differences between BST and B+ 10/27/2017. CS1: Java Programming Colorado State University

Extra: B+ Trees. Motivations. Differences between BST and B+ 10/27/2017. CS1: Java Programming Colorado State University Extra: B+ Trees CS1: Java Programming Colorado State University Slides by Wim Bohm and Russ Wakefield 1 Motivations Many times you want to minimize the disk accesses while doing a search. A binary search

More information

Access Methods. Basic Concepts. Index Evaluation Metrics. search key pointer. record. value. Value

Access Methods. Basic Concepts. Index Evaluation Metrics. search key pointer. record. value. Value Access Methods This is a modified version of Prof. Hector Garcia Molina s slides. All copy rights belong to the original author. Basic Concepts search key pointer Value record? value Search Key - set of

More information

CS127: B-Trees. B-Trees

CS127: B-Trees. B-Trees CS127: B-Trees B-Trees 1 Data Layout on Disk Track: one ring Sector: one pie-shaped piece. Block: intersection of a track and a sector. Disk Based Dictionary Structures Use a disk-based method when the

More information

CSE 530A. B+ Trees. Washington University Fall 2013

CSE 530A. B+ Trees. Washington University Fall 2013 CSE 530A B+ Trees Washington University Fall 2013 B Trees A B tree is an ordered (non-binary) tree where the internal nodes can have a varying number of child nodes (within some range) B Trees When a key

More information

Remember. 376a. Database Design. Also. B + tree reminders. Algorithms for B + trees. Remember

Remember. 376a. Database Design. Also. B + tree reminders. Algorithms for B + trees. Remember 376a. Database Design Dept. of Computer Science Vassar College http://www.cs.vassar.edu/~cs376 Class 14 B + trees, multi-key indices, partitioned hashing and grid files B and B + -trees are used one implementation

More information

Administrivia. Tree-Structured Indexes. Review. Today: B-Tree Indexes. A Note of Caution. Introduction

Administrivia. Tree-Structured Indexes. Review. Today: B-Tree Indexes. A Note of Caution. Introduction Administrivia Tree-Structured Indexes Lecture R & G Chapter 9 Homeworks re-arranged Midterm Exam Graded Scores on-line Key available on-line If I had eight hours to chop down a tree, I'd spend six sharpening

More information

Multi-way Search Trees. (Multi-way Search Trees) Data Structures and Programming Spring / 25

Multi-way Search Trees. (Multi-way Search Trees) Data Structures and Programming Spring / 25 Multi-way Search Trees (Multi-way Search Trees) Data Structures and Programming Spring 2017 1 / 25 Multi-way Search Trees Each internal node of a multi-way search tree T: has at least two children contains

More information

Find the block in which the tuple should be! If there is free space, insert it! Otherwise, must create overflow pages!

Find the block in which the tuple should be! If there is free space, insert it! Otherwise, must create overflow pages! Professor: Pete Keleher! keleher@cs.umd.edu! } Keep sorted by some search key! } Insertion! Find the block in which the tuple should be! If there is free space, insert it! Otherwise, must create overflow

More information

Main Memory and the CPU Cache

Main Memory and the CPU Cache Main Memory and the CPU Cache CPU cache Unrolled linked lists B Trees Our model of main memory and the cost of CPU operations has been intentionally simplistic The major focus has been on determining

More information

(2,4) Trees Goodrich, Tamassia. (2,4) Trees 1

(2,4) Trees Goodrich, Tamassia. (2,4) Trees 1 (2,4) Trees 9 2 5 7 10 14 (2,4) Trees 1 Multi-Way Search Tree ( 9.4.1) A multi-way search tree is an ordered tree such that Each internal node has at least two children and stores d 1 key-element items

More information

CMPUT 391 Database Management Systems. Spatial Data Management. University of Alberta 1. Dr. Jörg Sander, 2006 CMPUT 391 Database Management Systems

CMPUT 391 Database Management Systems. Spatial Data Management. University of Alberta 1. Dr. Jörg Sander, 2006 CMPUT 391 Database Management Systems CMPUT 391 Database Management Systems Spatial Data Management University of Alberta 1 Spatial Data Management Shortcomings of Relational Databases and ORDBMS Modeling Spatial Data Spatial Queries Space-Filling

More information

amiri advanced databases '05

amiri advanced databases '05 More on indexing: B+ trees 1 Outline Motivation: Search example Cost of searching with and without indices B+ trees Definition and structure B+ tree operations Inserting Deleting 2 Dense ordered index

More information

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 6 - Storage and Indexing

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 6 - Storage and Indexing CSE 544 Principles of Database Management Systems Magdalena Balazinska Winter 2009 Lecture 6 - Storage and Indexing References Generalized Search Trees for Database Systems. J. M. Hellerstein, J. F. Naughton

More information

CS143: Index. Book Chapters: (4 th ) , (5 th ) , , 12.10

CS143: Index. Book Chapters: (4 th ) , (5 th ) , , 12.10 CS143: Index Book Chapters: (4 th ) 12.1-3, 12.5-8 (5 th ) 12.1-3, 12.6-8, 12.10 1 Topics to Learn Important concepts Dense index vs. sparse index Primary index vs. secondary index (= clustering index

More information

CS 310 B-trees, Page 1. Motives. Large-scale databases are stored in disks/hard drives.

CS 310 B-trees, Page 1. Motives. Large-scale databases are stored in disks/hard drives. CS 310 B-trees, Page 1 Motives Large-scale databases are stored in disks/hard drives. Disks are quite different from main memory. Data in a disk are accessed through a read-write head. To read a piece

More information

Multidimensional Indexing The R Tree

Multidimensional Indexing The R Tree Multidimensional Indexing The R Tree Module 7, Lecture 1 Database Management Systems, R. Ramakrishnan 1 Single-Dimensional Indexes B+ trees are fundamentally single-dimensional indexes. When we create

More information

B-Tree. CS127 TAs. ** the best data structure ever

B-Tree. CS127 TAs. ** the best data structure ever B-Tree CS127 TAs ** the best data structure ever Storage Types Cache Fastest/most costly; volatile; Main Memory Fast access; too small for entire db; volatile Disk Long-term storage of data; random access;

More information

Topics to Learn. Important concepts. Tree-based index. Hash-based index

Topics to Learn. Important concepts. Tree-based index. Hash-based index CS143: Index 1 Topics to Learn Important concepts Dense index vs. sparse index Primary index vs. secondary index (= clustering index vs. non-clustering index) Tree-based vs. hash-based index Tree-based

More information

Database System Concepts, 5th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

Database System Concepts, 5th Ed. Silberschatz, Korth and Sudarshan See   for conditions on re-use Chapter 12: Indexing and Hashing Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree

More information

Query Processing and Advanced Queries. Advanced Queries (2): R-TreeR

Query Processing and Advanced Queries. Advanced Queries (2): R-TreeR Query Processing and Advanced Queries Advanced Queries (2): R-TreeR Review: PAM Given a point set and a rectangular query, find the points enclosed in the query We allow insertions/deletions online Query

More information

CS 525: Advanced Database Organization 04: Indexing

CS 525: Advanced Database Organization 04: Indexing CS 5: Advanced Database Organization 04: Indexing Boris Glavic Part 04 Indexing & Hashing value record? value Slides: adapted from a course taught by Hector Garcia-Molina, Stanford InfoLab CS 5 Notes 4

More information

Introduction to Data Management. Lecture 21 (Indexing, cont.)

Introduction to Data Management. Lecture 21 (Indexing, cont.) Introduction to Data Management Lecture 21 (Indexing, cont.) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v Midterm #2 grading

More information

M-ary Search Tree. B-Trees. Solution: B-Trees. B-Tree: Example. B-Tree Properties. B-Trees (4.7 in Weiss)

M-ary Search Tree. B-Trees. Solution: B-Trees. B-Tree: Example. B-Tree Properties. B-Trees (4.7 in Weiss) M-ary Search Tree B-Trees (4.7 in Weiss) Maximum branching factor of M Tree with N values has height = # disk accesses for find: Runtime of find: 1/21/2011 1 1/21/2011 2 Solution: B-Trees specialized M-ary

More information

Database index structures

Database index structures Database index structures From: Database System Concepts, 6th edijon Avi Silberschatz, Henry Korth, S. Sudarshan McGraw- Hill Architectures for Massive DM D&K / UPSay 2015-2016 Ioana Manolescu 1 Chapter

More information

Principles of Data Management. Lecture #14 (Spatial Data Management)

Principles of Data Management. Lecture #14 (Spatial Data Management) Principles of Data Management Lecture #14 (Spatial Data Management) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Today s Notable News v Project

More information

Data Warehousing & Data Mining

Data Warehousing & Data Mining Data Warehousing & Data Mining Wolf-Tilo Balke Kinda El Maarry Institut für Informationssysteme Technische Universität Braunschweig http://www.ifis.cs.tu-bs.de Summary Last week: Logical Model: Cubes,

More information

Introduction to Spatial Database Systems

Introduction to Spatial Database Systems Introduction to Spatial Database Systems by Cyrus Shahabi from Ralf Hart Hartmut Guting s VLDB Journal v3, n4, October 1994 Data Structures & Algorithms 1. Implementation of spatial algebra in an integrated

More information

Chapter 18 Indexing Structures for Files. Indexes as Access Paths

Chapter 18 Indexing Structures for Files. Indexes as Access Paths Chapter 18 Indexing Structures for Files Indexes as Access Paths A single-level index is an auxiliary file that makes it more efficient to search for a record in the data file. The index is usually specified

More information

9/23/2009 CONFERENCES CONTINUOUS NEAREST NEIGHBOR SEARCH INTRODUCTION OVERVIEW PRELIMINARY -- POINT NN QUERIES

9/23/2009 CONFERENCES CONTINUOUS NEAREST NEIGHBOR SEARCH INTRODUCTION OVERVIEW PRELIMINARY -- POINT NN QUERIES CONFERENCES Short Name SIGMOD Full Name Special Interest Group on Management Of Data CONTINUOUS NEAREST NEIGHBOR SEARCH Yufei Tao, Dimitris Papadias, Qiongmao Shen Hong Kong University of Science and Technology

More information

Database Systems. File Organization-2. A.R. Hurson 323 CS Building

Database Systems. File Organization-2. A.R. Hurson 323 CS Building File Organization-2 A.R. Hurson 323 CS Building Indexing schemes for Files The indexing is a technique in an attempt to reduce the number of accesses to the secondary storage in an information retrieval

More information

Multidimensional Indexes [14]

Multidimensional Indexes [14] CMSC 661, Principles of Database Systems Multidimensional Indexes [14] Dr. Kalpakis http://www.csee.umbc.edu/~kalpakis/courses/661 Motivation Examined indexes when search keys are in 1-D space Many interesting

More information

Chapter 12: Query Processing. Chapter 12: Query Processing

Chapter 12: Query Processing. Chapter 12: Query Processing Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Query Processing Overview Measures of Query Cost Selection Operation Sorting Join

More information

System Structure Revisited

System Structure Revisited System Structure Revisited Naïve users Casual users Application programmers Database administrator Forms DBMS Application Front ends DML Interface CLI DDL SQL Commands Query Evaluation Engine Transaction

More information

Goals for Today. CS 133: Databases. Example: Indexes. I/O Operation Cost. Reason about tradeoffs between clustered vs. unclustered tree indexes

Goals for Today. CS 133: Databases. Example: Indexes. I/O Operation Cost. Reason about tradeoffs between clustered vs. unclustered tree indexes Goals for Today CS 3: Databases Fall 2018 Lec 09/18 Tree-based Indexes Prof. Beth Trushkowsky Reason about tradeoffs between clustered vs. unclustered tree indexes Understand the difference and tradeoffs

More information

More B-trees, Hash Tables, etc. CS157B Chris Pollett Feb 21, 2005.

More B-trees, Hash Tables, etc. CS157B Chris Pollett Feb 21, 2005. More B-trees, Hash Tables, etc. CS157B Chris Pollett Feb 21, 2005. Outline B-tree Domain of Application B-tree Operations Hash Tables on Disk Hash Table Operations Extensible Hash Tables Multidimensional

More information

The B-Tree. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland

The B-Tree. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland Yufei Tao ITEE University of Queensland Before ascending into d-dimensional space R d with d > 1, this lecture will focus on one-dimensional space, i.e., d = 1. We will review the B-tree, which is a fundamental

More information

An Introduction to Spatial Databases

An Introduction to Spatial Databases An Introduction to Spatial Databases R. H. Guting VLDB Journal v3, n4, October 1994 Speaker: Giovanni Conforti Outline: a rather old (but quite complete) survey on Spatial DBMS Introduction & definition

More information

Chapter 11: Indexing and Hashing

Chapter 11: Indexing and Hashing Chapter 11: Indexing and Hashing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files B-Tree

More information

Design and Analysis of Algorithms Lecture- 9: B- Trees

Design and Analysis of Algorithms Lecture- 9: B- Trees Design and Analysis of Algorithms Lecture- 9: B- Trees Dr. Chung- Wen Albert Tsao atsao@svuca.edu www.408codingschool.com/cs502_algorithm 1/12/16 Slide Source: http://www.slideshare.net/anujmodi555/b-trees-in-data-structure

More information

M-ary Search Tree. B-Trees. B-Trees. Solution: B-Trees. B-Tree: Example. B-Tree Properties. Maximum branching factor of M Complete tree has height =

M-ary Search Tree. B-Trees. B-Trees. Solution: B-Trees. B-Tree: Example. B-Tree Properties. Maximum branching factor of M Complete tree has height = M-ary Search Tree B-Trees Section 4.7 in Weiss Maximum branching factor of M Complete tree has height = # disk accesses for find: Runtime of find: 2 Solution: B-Trees specialized M-ary search trees Each

More information

Spatial Queries. Nearest Neighbor Queries

Spatial Queries. Nearest Neighbor Queries Spatial Queries Nearest Neighbor Queries Spatial Queries Given a collection of geometric objects (points, lines, polygons,...) organize them on disk, to answer efficiently point queries range queries k-nn

More information

(2,4) Trees. 2/22/2006 (2,4) Trees 1

(2,4) Trees. 2/22/2006 (2,4) Trees 1 (2,4) Trees 9 2 5 7 10 14 2/22/2006 (2,4) Trees 1 Outline and Reading Multi-way search tree ( 10.4.1) Definition Search (2,4) tree ( 10.4.2) Definition Search Insertion Deletion Comparison of dictionary

More information

Module 4: Index Structures Lecture 13: Index structure. The Lecture Contains: Index structure. Binary search tree (BST) B-tree. B+-tree.

Module 4: Index Structures Lecture 13: Index structure. The Lecture Contains: Index structure. Binary search tree (BST) B-tree. B+-tree. The Lecture Contains: Index structure Binary search tree (BST) B-tree B+-tree Order file:///c /Documents%20and%20Settings/iitkrana1/My%20Documents/Google%20Talk%20Received%20Files/ist_data/lecture13/13_1.htm[6/14/2012

More information

CPS352 Lecture - Indexing

CPS352 Lecture - Indexing Objectives: CPS352 Lecture - Indexing Last revised 2/25/2019 1. To explain motivations and conflicting goals for indexing 2. To explain different types of indexes (ordered versus hashed; clustering versus

More information

What we have covered?

What we have covered? What we have covered? Indexing and Hashing Data warehouse and OLAP Data Mining Information Retrieval and Web Mining XML and XQuery Spatial Databases Transaction Management 1 Lecture 6: Spatial Data Management

More information

Laboratory Module X B TREES

Laboratory Module X B TREES Purpose: Purpose 1... Purpose 2 Purpose 3. Laboratory Module X B TREES 1. Preparation Before Lab When working with large sets of data, it is often not possible or desirable to maintain the entire structure

More information

CSE 562 Database Systems

CSE 562 Database Systems Goal of Indexing CSE 562 Database Systems Indexing Some slides are based or modified from originals by Database Systems: The Complete Book, Pearson Prentice Hall 2 nd Edition 08 Garcia-Molina, Ullman,

More information

INDEXES MICHAEL LIUT DEPARTMENT OF COMPUTING AND SOFTWARE MCMASTER UNIVERSITY

INDEXES MICHAEL LIUT DEPARTMENT OF COMPUTING AND SOFTWARE MCMASTER UNIVERSITY INDEXES MICHAEL LIUT (LIUTM@MCMASTER.CA) DEPARTMENT OF COMPUTING AND SOFTWARE MCMASTER UNIVERSITY SE 3DB3 (Slides adapted from Dr. Fei Chiang) Fall 2016 An Index 2 Data structure that organizes records

More information