Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha,...
-
Upload
claire-lindsey -
Category
Documents
-
view
213 -
download
0
Transcript of Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha,...
![Page 1: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/1.jpg)
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
![Page 2: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/2.jpg)
Outline
1. Abstraction
2. Introduction
3. Motivation
4. MBR Compression
5. CR-tree
6. Analysis
7. Conclusion
![Page 3: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/3.jpg)
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
![Page 4: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/4.jpg)
Introduction
• DB tables and indexes in Main Memory
• How to search faster in R-tree ???– MBR key compression
![Page 5: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/5.jpg)
Motivation1. Memory Hierarchy
-> Reduce Cache miss !!!
![Page 6: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/6.jpg)
Motivation (Cont’d)2. Basic Idea
- Compression scheme
![Page 7: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/7.jpg)
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
![Page 8: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/8.jpg)
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!!!
![Page 9: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/9.jpg)
Motivation (Cont’d)
2. Basic Idea (Cont’d)
-Structure of CR-tree node
![Page 10: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/10.jpg)
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
![Page 11: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/11.jpg)
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
![Page 12: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/12.jpg)
MBR Compression
Two Desirable properties of MBR Compression
• Overlap Check without Decompression
• Simplicity
![Page 13: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/13.jpg)
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
![Page 14: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/14.jpg)
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
![Page 15: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/15.jpg)
QRMBR (Cont’d)Correctness
• If two MBRs overlap, the resulting QRMBR must overlap also
• Two non-overlapping MBRs may overlap
![Page 16: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/16.jpg)
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
![Page 17: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/17.jpg)
CR-tree Operations-Search
MBR of R3 Entry of R4
Entry of R5
MBR of R0 Entry of R1
Entry of R2
Entry of R3
Node of R0 level
Node of R3 level
R4R5
{(43166,27102),(43178,27112)}
![Page 18: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/18.jpg)
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
![Page 19: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/19.jpg)
CR-tree Operations-Insertion
R4R5
R6 MBR of R3 Entry of R4
Entry of R6
Node of R3 level
Entry of R5
1.Change!!! 2. Insert !!!
3. Recalculate QRMBR
![Page 20: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/20.jpg)
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.
![Page 21: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/21.jpg)
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.
![Page 22: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/22.jpg)
CR-tree Operations-Bulkload
• Similar with other R-tree variants
![Page 23: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/23.jpg)
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
![Page 24: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/24.jpg)
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
![Page 25: Optimizing Multidimensional Index Trees for Main Memory Access Author: Kihong Kim, Sang K. Cha, Keunjoo Kwon Members: Iris Zhang, Grace Yung, Kara Kwon,](https://reader033.fdocuments.in/reader033/viewer/2022051821/5697bfbe1a28abf838ca2917/html5/thumbnails/25.jpg)
Q&A