Bε-trees
CSCI 333 Williams College
B -trees CSCI 333 Williams College Logistics Lab 2b Office - - PowerPoint PPT Presentation
B -trees CSCI 333 Williams College Logistics Lab 2b Office hours Tuesday night, 7-9pm Final Project Proposals Due Friday Come see me! Last Class General principles of write optimization LSM-trees Operations
CSCI 333 Williams College
*asymptotically, in the DAM model
B-Bε Bε B
O(Bε) children O(log N)
Bε B and ε are parameters:
O(N/B) leaves
High-level: messages + LSM/B-tree hybrid
▪ insert(k,v) ▪ v = search(k) ▪ {(ki,vi), … (kj, vj)} = search(k1, k2) ▪ delete(k)
▪ upsert(k, ƒ, 𝚬)
Talk about soon!
All data is inserted to the root node’s buffer.
When a buffer fills, contents are flushed to children
Flushes can cascade if not enough room in child nodes
Flushes can cascade if not enough room in child nodes Invariant: height in the tree preserves update order
Read and search all nodes
Newest insert is closest to the root. Search all node buffers for messages applicable to target key
FUSE FAT write?
upsert(k,ƒ,𝚬)
Upserts are stored in the tree like any other operation
Read all nodes on root-to- leaf search path Apply updates in reverse chronological order
Memory Disk B B
Point Query: Range Query: Insert/upsert:
O(logBεN)
Bε B − Bε
O(logBεN)
D i f f e r e n t b a s e s …
Point Query: Range Query: Insert/upsert:
O(logBεN)
Bε B − Bε
ε
Point Query: Range Query: Insert/upsert:
ε
"
B )
O(logBεN)
Bε B − Bε
O( `
B )
Point Query: Range Query: Insert/upsert:
ε
"
B )
O(logBεN)
Bε B − Bε
O(logBεN)
Bε
B-Bε Bε B
Point Query: Range Query: Insert/upsert:
ε
"
B )
εB1−ε )
O(logBεN)
Bε B − Bε
Each flush operation moves items
O( B−Bε
Bε
)
Each insert message is flushed times O(logBεN)
B-Bε Bε B
B-Bε Bε B