15. Rightmost-link B-link-Tree は各ノードに Single Link Pointer を持つ. 各レベルが単方向リスト . 目的 目的のノードに到達するための Alternative way を提供する どのノードもたどり着く為の 2 つの Pointer を持つ Overflow Replaced by two New node. (usually, the two nodes Are on the same physical page) Essentially same as A single node until the Parent pointer is added.
16. Use high-key 74 74 63 HighKey HighKey Split 直後 ( 親へのリンクポインタが修正されていない ) 72 を探すケースを考えてみる. ここの中に High Key があるはずだが, Split されてない. この時, Link Pointer を辿る必要がある. この条件を High-Key と Search Key の比較によって行う. Search key が High key 以上ならポインタを辿る
17. An structure example of B-link-Tree Additional advantage: level-major order での取得が早い (Leaf をすべて取得する場合など )
18. Search Algorithm current = root; /* root の pointer を設定 */ A = get(current); /* ノードを memory に読み込む */ while (current is not a leaf) /* leaf に到達するまでループ */ current = scannode1(v, A); /* v をキーに memory bloak A を走査 */ /* リンクポインタを返す */ A = get(current); /* リンク先のノード読み込み */ / * now reached to leaves * / * leaf 内の線形探索 */ while ((t = scannode(v,A)) == link pointer of A) current = t; A = get(current); // 値 v を持つ leaf が見つかったか ? if (v is in A) return(success); else return(failure); Simple! Only trick is to have scannode know about high-keys and right-links. Right-link か Child-link かは 問わない
19.
20. Insert(1) initialize stack; /* to remember ancestors */ current = root; A = get(current); /* scan down the tree */ while (current is not a leaf) { t = current; current = scannode(v,A); if (current not link pointer in A) push t; /* remember node at the level */ A = get(current); } /* reached to leaf */ lock(current); A = get(current); move_right(); /* if required, move right and lock the neighbor */
21. // current node の update. // Split Node // for locking.. Remember the oldnode and the parent. // lock parent, oldnode, and the next-sibling.
22. A B C D E F G H splited A Bottom-up Stack (right-most-link) B E Leaf Found G
23. D E G H Leaf A Bottom-up Stack (right-most-link) B E If need to Split Flush Flush B Lock Flush Un Lock Finish! G I ’ G’ I ’ G’ E E
24. P A C Leaf Insert algorithm(Write lock / no read lock) B ’ A ’ P Bottom-up Stack Insert(Split) A ’ Flush Lock A B ’ Flush