1 / 22

UB-Tree における様々なデータ型の取り扱いについて

UB-Tree における様々なデータ型の取り扱いについて. 2002/9/6 笹栗 茂. (25,18). UB-Tree について. Attribute 1. UB-Tree. UB-Tree では多次元空間をアドレス変換( Bit interleaving )を用いて 1 次元空間にマップ 正の整数の場合は容易に変換可能 文字列、符号付き整数、実数のような場合は?. Attribute 2. Z address. Attribute 1. 1 1 0 0 1. ( 25 ) 10. ( 841 ) 10.

hova
Download Presentation

UB-Tree における様々なデータ型の取り扱いについて

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UB-Treeにおける様々なデータ型の取り扱いについてUB-Treeにおける様々なデータ型の取り扱いについて 2002/9/6 笹栗 茂

  2. (25,18) UB-Treeについて Attribute 1 UB-Tree • UB-Treeでは多次元空間をアドレス変換(Bit interleaving)を用いて1次元空間にマップ • 正の整数の場合は容易に変換可能 • 文字列、符号付き整数、実数のような場合は? Attribute 2 Zaddress Attribute 1 11001 (25)10 (841)10 _ _ _ _ _ _ _ _ _ _ 1 1 0 1 0 0 1 0 0 1 bitstrings Zaddress 10010 (18)10 Attribute 2

  3. 以前(2000/12)にUB-Treeでの文字列・実数の取り扱いについて尋ねた時の返答以前(2000/12)にUB-Treeでの文字列・実数の取り扱いについて尋ねた時の返答 there are no publications about transforming string and floating numbers into bitstring representation. In the current version there is no efficient mapping of strings and floating numbers to bitstrings. Use fix point numbers instead of floating number! The mapping of integer and fix point (numeric in SQL) are trivial and therefore not published (just a normalization to the range allowed).

  4. Address Caluculation for Arbitrary Data Types(p105-p106) • MISTRAL: Processing Relational Queries using a Multidimensional Access TechniqueV. Markl, Ph.D. Thesis, TU München, 1999, published by infix Verlag, St. Augustin, DISDBIS 59, ISBN 3-89601-459-5, 1999

  5. 文字列のビット列への変換 ASCIIコードと文字列は文字の連なりという事実を用いて文字列をバイナリ表現 例 AB” < “BB” ASCIIコードにマップ 65 ・ 66 < 66 ・ 66 バイナリ表現にマップ 01000001・010000010 < 010000010・010000010   異なる値が少ない集合からなるドメインは列挙型を用いる

  6. 符号付き整数のビット列への変換 • 単純な方法として符号ビットを逆にする 例   大小関係 -3 -2 -1 0 1 2 3 ○ ビット列 変換前 101 110 111 000 001 010 011× 変換後 001 010 011 100 101 110 111○

  7. 2つのR-Treesを用いたJoinについて

  8. Joinへのアプローチ • RestrictionしながらJoin • 2つの木を使用してJoin • Restrictionした結果をJoin • 1-Tree Join • インデックスを使用しないJoin Synchronized Join Restrictionの結果 と木のJoin Restrictionの結果同士 のJoin

  9. 既存のR-Tree同士のSpatial Join • Efficient Processing of Spatial Joins Using R-trees • Brinkhoff, T., Kriegel, H., and Seeger, B., “Proc. of the 1993 ACM SIGMOD Int. Conf. on Management of Data, 1993,pp.237-246 深さ優先 • Spatial Joins Using R-trees: Breadth-First Traversal with Global Optimizations • Yun-Wu Huang, Ning JingProceedings of the 23rd VLDB Conference Athens, Greece, pp.396-405, 1997 幅優先

  10. 1. DFRJ(Depth-First R-tree Join) ①ルートノード同士でMBRが交差するエント   リを求める ② ①でエントリが見つかると再帰的に部分 木を辿りMBRが交差するエントリを求める

  11. Y Y A C DFRJ B ⑤ ③ 2 5 D 3 ② A B ④ 1 ① 4 1 2 3 4 5 X X C D A B A B A B ① ② ④ ③ ⑤ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 C D C D C D ① ② ④ ① ② ④ ① ② ④ ③ ⑤ ③ ⑤ ③ ⑤

  12. 2. BFRJ(Breadth-First R-tree Join) • 中間結果を保存しておいてBreadth-FirstでR-treeを探索

  13. BFRJ Y A B 2 A B 5 A B 3 1 2 3 4 5 1 4 1 2 3 4 5 2 ③ X 1 ① C A 1 ② node同士でjoin A D 2 ② node同士でjoin B C 5 ⑤ B 3 ② D Y C 3 ④ ⑤ ③ 4 ④ C D D C D ② ④ ① ① ② ④ ③ ⑤ ① ② ④ ③ ⑤ X

  14. 部分空間の場合 • 多次元空間においてその部分空間でのJoinを考えた場合、その部分空間で交差するMBRsを探索 2次元空間においてrとsを1次元(軸X)でJoin 交差領域 2次元の場合の交差領域 1次元(X軸)の場合の交差領域 Y Y r1 r1 s2 s2 s3 s3 r3 r3 s1 s1 r2 r2 X X

  15. 部分空間でのJoin(DFRJ) A B B A A B 1 2 3 4 1 2 3 4 3 2 C D ●をJoin C D ① ② ③ ④ ⑤ ⑥ ① ② ③ ④ ⑤ ⑥ 4 1 Join Attribute A B A B 1 2 3 4 ② ⑤ ●をJoin 1 2 3 4 C D ③ C D ① ② ③ ④ ⑤ ⑥ ⑥ ④ ① ① ② ③ ④ ⑤ ⑥ C D ●をJoin アクセスされるノード数が増加するのでRestrictionが重要

  16. 2 4 1 Primary Key 各位置に重複は存在しない TPC-Hのデータ分布 • Joinの条件となる属性(Join属性)はキー属性 • Joinを行う木においてどちらかの木ではJoin属性は主キー • 複合主キーでない場合、軸の各位置に存在する値は唯一 MBR1と2は横軸のみでみると交差 しかし交差範囲においてMBR1(2)中に 点が存在する位置にはMBR2(1)では点は 存在しない Restrictionの条件として利用できるのでは? ⇒ 検討中

  17. 属性の重要度 ② D ⑤ ③ ⑥ ④ ① C • 主キーの重要度を高くする 3 A 1 2 3 4 5 6 7 8 9 10 11 12 Join 1 4 2 A B C D B Primary Key 1 2 3 4 ① ② ③ ④ ⑤ ⑥ 1 2 3 4 5 6 7 8 9 10 11 12 交差する葉のMBR 1,①2,⑤3,⑤ 1,②3,④ 2,③ 4,⑥ • 主キーで多く分割が起こる • Restrictionが有効に働かない • Join属性の交差領域は減

  18. 主キーの重要度低くしてRestrictionで絞込みを行う主キーの重要度低くしてRestrictionで絞込みを行う ② D ⑤ 3 B ③ 4 Join ⑥ ④ ① C 2 A 1 1 2 3 4 5 6 7 8 9 10 11 12 Primary Key A B C D 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 ① ② ③ ④ ⑤ ⑥ • Restrictionで用いられる属性で • 多く分割が起こる • Restrictionが有効 • Join属性の交差領域は増 • ⇒主キーの特性などを利用して •  交差領域を減らすことができないか? 1,① 1,② 1,③ 1,④ 1,⑤ 1,⑥ 2,① 2,② 2,③ 3,③ 3,④ 3,⑤ 4,④ 4,⑤ 4,⑥

  19. 交差領域を減らす手法の提案①(DFRJ) • MBRの再構成 ② D ⑤ C 3 B ③ 4 ⑥ ④ ① Join C 2 A 1 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 AとCのMBRの交差領域に基づきMBRを再構成 ⇒交差領域におけるLowerとUpperの点でMBRを作成 このMBRで探索することに より交差領域削減 1 1

  20. ② D ⑤ ③ 3 B ⑥ 4 ④ ① C ③ Join 1 2 3 4 5 6 7 8 9 10 11 12 2 A 1 1 2 3 4 5 6 7 8 9 10 11 12 A B C D A B C D 1 2 3 4 ① ② ③ ④ ⑤ ⑥ 1 2 3 4 ① ② ③ ④ ⑤ ⑥ AとCの交差領域を覚えておき その中で1のLowerとUpperを探す [Lower,Upper]で交差するMBRをJoin A B C D A B C D 1 2 3 4 ① ② ③ ④ ⑤ ⑥ 1 2 3 4 ① ② ③ ④ ⑤ ⑥ ③のMBRはLower≦ ③ ≦ Upperで構成されていないので探索する必要なし

  21. 問題点 • Lowerが交差領域の最小に近くまたUpperが交差領域の最大に近い場合 ② D ⑤ D 3 B ③ 4 ⑥ ④ ① Join C 2 A 1 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 AとDの交差領域におけるLowerとUpperの点でMBRを作成 1 1 この領域の探索(Eg. ④)は無駄

  22. OLAP(TPC-H)を考慮したJoinについての今後 • クラスタリングの制御、Join属性の片方は主キーなどをふまえた交差領域を減らす手法の考察 • Join Indexなどについて • 集約値をあらかじめもっておく手法の応用

More Related