250 likes | 361 Views
Optimizing Multidimensional Index Trees for Main Memory Access. Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon. Members: Iris Zhang, Grace Yung, Kara Kwon , Jessica Wong. Outline. 1. Abstraction 2. Introduction 3. Motivation 4. MBR Compression 5. CR-tree 6. Analysis 7. Conclusion.
E N D
Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon, Jessica Wong
Outline 1. Abstraction 2. Introduction 3. Motivation 4. MBR Compression 5. CR-tree 6. Analysis 7. Conclusion
Abstraction • CR-tree • Cash Conscious version of the R-tree • Compress MBR key • Remove reading and trailing less significant bits • CR-tree becomes wider and smaller • Faster searching, less memory consuming than ordinary R-tree
Introduction • DB tables and indexes in Main Memory • How to search faster in R-tree ??? • MBR key compression
Motivation • Memory Hierarchy -> Reduce Cache miss !!!
Motivation (Cont’d) 2. Basic Idea - Compression scheme
Motivation (Cont’d) 2. Basic Idea (Cont’d) • Quantize into 16 levels or 4 bits by cutting off trailing insignificant bits • the Result MBR -> QRMBR • CR- tree use QRMBR as index key
Motivation (Cont’d) 2. Basic Idea (Cont’d) • Power of Quantize • Original coordinates • (43166,27102),(43178,27190) After Quantize =>(8,11),(14,15) 8bytes of entry size become 2bytes =>each node can pack 4 times more entry!!!
Motivation (Cont’d) 2. Basic Idea (Cont’d) -Structure of CR-tree node
Motivation (Cont’d) 3. Problem Formulation (reduce index search time) c->node size, Nnode access-> # of node access Tindex search= c · Nnode access· (Ckey compare+ Ccache miss+ CTLB miss/ c) Index search time mostly depends on c · Nnode ccess
Motivation (Cont’d) 3. Problem Formulation (reduce index search time) How to minimize c · Nnode access- ?? • Change node size c · Nnode access-become minimal • Packing more entries into a fixed-size node • Clustering index entries
MBR Compression • Two Desirable properties of MBR Compression • Overlap Check without Decompression • Simplicity
RMBR( Relative Representation of MBR) • Represent the coordinates of an MBR relatively to the left corner of its parents MBR • Cut off leading non-discriminating bits • Can save only 32 bits per MBR
QRMBR (Quantized Relative Representation of MBR) • Cannot obtain a sufficient compression ratio form the RMBR • Cut off trailing insignificant bits form an RMBR • There’s overhead but it’s paid off by the significant savings in cache misses
QRMBR (Cont’d) • Correctness • If two MBRs overlap, the resulting QRMBR must overlap also • Two non-overlapping MBRs may overlap
CR-tree Operations-Search • Query rectangle need to change to QRMBR using MBR of each node as the reference MBR • Compare Query QRMBR and object QRMBR whether they overlap
Entry of R4 Entry of R1 Entry of R5 Entry of R2 Entry of R3 MBR of R3 MBR of R0 R5 R4 CR-tree Operations-Search Node of R0 level Node of R3 level {(43166,27102),(43178,27112)}
CR-tree Operations-Insertion • Choosing child node that needs the least enlargement to enclose the object MBR • In Internal node, Object MBR is first transformed into the QRMBR using the reference MBR • Enlargement calculated between a pair of QRMBR • In leaf node, node MBR is first adjusted such that it encloses the object MBR • Index entry for the object is created in the node • QRMBR in the node are recalculated because their reference MBR has changed
R5 R4 R6 CR-tree Operations-Insertion Node of R3 level Entry of R4 Entry of R5 Entry of R6 MBR of R3 1.Change!!! 2. Insert !!! 3. Recalculate QRMBR
CR-tree Operations-Insertion(Cont’d) Algorithm SplitNode.. Algorithm AdjustTree. Ascend from a leaf node L up to the root, adjusting MBRs of nodes and propagating node splits as necessary. When a node MBR has been adjusted, recalculate the QRMBRs in the node.
CR-tree Operations-Deletion • Algorithm Delete. Remove index record E from a CR-tree • Algorithm Condense Tree. • Eliminate the node if it has too few entries and relocate its entries . • Adjust all MBRs, making them smaller if possible. • Recalculate the QRMBR in the node.
CR-tree Operations-Bulkload • Similar with other R-tree variants
Conclusion • How to optimize cache behavior of indexes in main memory DB environment? • QRMBR – Pack more entries in the node • CR-tree based on QRMBR increases the fanout of the R-tree and decreases the index size for cache behavior • 2.5 times search faster and 60% less memory use than R-tree
References • Jun Rao, Kenneth A. Ross: Making B+-Trees Cache Conscious in Main Memory, ACM SIGMOD 2000 • Shimin Chen, Phillip B. Gibbons, Todd C. Mowry, Gary Valentin: Fractal Prefetching B+trees: Optimizing Both Cache and Disk Performance. ACM SIGMOD 2002 • Kihong Kim, Sang K. Cha, Keunjoo Kwon: Optimizing Multidimensional Index Trees for Main Memory Access. ACM SIGMOD 2001