Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis.

Similar presentations


Presentation on theme: "Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis."— Presentation transcript:

1 Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis Aarhus University, Denmark Spyros Sioutas Ionian University, Corfu, Greece Kostas Tsichlas Aristotle University of Thessaloniki, Greece

2 Binary Tree 3 2 8 69 47 1

3 Binary Search Tree 3 2 8 69 47 1

4 5 Insert(5) 3 2 8 69 47 1

5 Balanced Binary Search Tree 3 2 8 69 47 Height O(log n) 1

6 Report(2,7) 3 2 8 69 47 Height O(log n) 1 Time O(log n + t)

7 5 Red-Black Tree 3 2 8 69 47 1 Bayer 1972

8 5 3 2 8 6 9 4 7 1 5 3 2 8 69 47 1 3 6 recolor restructure Red-Black Tree - rebalancing O(log n) O(1)

9 Driscoll, Sarnak, Sleator, Tarjan 1986 Red-Black Tree 3 3 2 3 28 3 28 6 3 28 69 3 28 69 7 3 28 69 7 1 3 28 69 47 1 5 3 2 8 6 947 1 3 28 61 3 28 1 EphemeralPersistent query only Partially 5 3 2 8 6 947 15 3 2 8 6 947 1 Fully Expensive to record updates performing many modifications Version tree Contributions of Driscoll et al. 1.Red-black trees with O(1) modifications per update (displacement paths) 2.General technique to make pointer based data structures fully persistent

10 RAM modelIO model Binary Search Trees Fully Persistent Balanced Binary Search Trees Incremental B-Trees Fully Persistent B-Trees Bayer 1972 Red-Black Trees Bayer 1972 Red-Black Trees w. Displacement Paths Driscoll et al. 1986 Full Persistence: Node splitting Driscoll et al. 1986 Maintaining Order in a List Dietz, Sleator 1987 CPU Complexity = # instructions Memory CPU Complexity = # block transfers Disk Memory B IO Efficient Node Splitting Fully Persistent Search Trees

11 Incremental B-tree with range searches in O(log B n + t/B) IOs, updates in O(log B n) IOs with O(1) key and pointer modifications, O(n/B) space Results Fully persistent B-tree with updates in O(log B n + log 2 B) IOs amortized, range searches in O(log B n + t/B) IOs, O(m/B) space Any emphemeral pointer based IO data structure with O(1) indegree can be made fully persistent with O(1) overhead per block access and O(log 2 B) IOs amortized overhead per field modification Persistent B-tree resultQueryUpdate Arge, Danner, Teh 2003log B n + t/Blog B n Lanka, Mays 1991(log B n + t/B) ∙ log B mlog B n ∙ log B m This talklog B n + t/Blog B n + log 2 B n = # elements in B-tree t= output size m= # versions / updates B = block size Full Partial

12 ... w Incremental Search Tree Updates y x w Displacement path w  x  flip all colors on path + all red siblings (flag w with x) x y w Cascaded recoloring x x... Cascaded splitting B-Tree x degree [B,2B] height O(log B n) x w Overflow flag (path w  x) Counts twice w Splitting pair w Ready to overflow Driscoll et al. 1986 Incremental B-tree Range searches visit O(log B n + t/B) nodes. Updates... 1.visit O(log B n) nodes 2.modify O(1) pointers and keys 3.creates O(1) new empty nodes

13 Fat node Queries = binary search among versions Node splitting (# ekstra fields ≥2∙indegree) 13 Full persistence : Node Splitting Technique Version tree (numbers = version ids) 1 432 657 preorder traversal field:(1,x) (7,z) (5,x) (6,y) (2,x) increasing version field 1 : (1,a) (4,b) (3,a) (2,c) field 2 : (1,f) (7,g) (5,f) [0,[[0,[ [4,3[[4,3[ field 1 : (1,a) (4,b) field 2 : (1,f) (7,g) field 1 : (5,b) (3,a) (2,c) field 2 : (5,f) split version 5 [0,5[[0,5[ [5,[[5,[ [4,5[[4,5[ [5,3[ 1432657 Version list (order maintenance data structure) Driscoll, Sarnak, Sleator, Tarjan 1986 Dietz, Sleator 1987 Updates (1,x) (6,y) (7,z)... in the IO model 1.O(B) fields & updates in a node 2.local version list LVL of all version ids in block 3.each inpointer spans O(1) verions in LVL

14 Thank You Main result Fully persistent B-tree with updates in O(log B n + log 2 B) IOs, searches in O(log B n + t/B) IOs, using space O(m/B) ?


Download ppt "Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis."

Similar presentations


Ads by Google