Top Banner
Foster B-Trees Lucas Lersch 14.07.2014 M. Sc. Caetano Sauer Advisor
60

Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

Mar 06, 2018

Download

Documents

ngoquynh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

Foster B-TreesLucas Lersch

14.07.2014

M. Sc. Caetano SauerAdvisor

Page 2: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

Foster B-Trees

2

Motivation

Blink-Trees:● multicore● concurrency

Write-Optimized B-Trees:● flash memory● large-writes● wear leveling● defragmentation

Fence Keys:● verification

Page 3: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

1. Background2. Blink-Trees3. Write-Optimized B-Trees4. Verification and Fence Keys5. Foster B-Trees6. Performance Evaluation

Agenda

Page 4: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

Latches

4

Latches and Locks

Locks

● protect in-memory physical structures

● during critical sections

● embedded in the data structure (semaphore)

● deadlock avoidance

● shared and exclusive modes

● simple and efficient

● acquired by threads ● acquired by transactions

● protect database logical contents

● during entire transaction

● lock manager (hash table)

● deadlock detection and resolution

● shared, exclusive, update, intention, etc...

● complex and expensive

Page 5: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

5

B-trees

101 2 5 2321 28

7 12 27

23

2612 55

{key , DATA}

{key , pointer}

32101 2 5 2321 282612 5532

7 12 27

23

Page 6: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

6

Retrieval

101 2 5 2321 3228

7 12 27

23

2612 55

S

S

S

12

RETRIEVE 12

Page 7: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

7

Insertion

101 2 5 2321 3228

7 12 27

23

2612 55

S

S

21

X

17

INSERT 17

Page 8: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

8

Insertion (node split)

101 2 5 2317 28

7 12 27

23

2612

S

S

21

X

553232 55

X

32

X

30

INSERT 30

X

Page 9: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

9

Insertion (worst case)

27 55 93

S

... ......

61 74 85

.........

87 90 91

S

X

X

X88

X

X

90 91

X

XINSERT 88

Page 10: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Merge underflowing nodes:○ Reduce number of internal nodes○ But complex and expensive○ Database tend to increase rather than decrease

● Allow nodes to be completely emptied● Operations must handle empty nodes● Asynchronous utility for clean-up

10

Deletion

Page 11: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

1. Background2. Blink-Trees3. Write-Optimized B-Trees4. Verification and Fence Keys5. Foster B-Trees6. Performance Evaluation

Agenda

Page 12: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

12

Blink-trees

101 2 5 2317 3228

7 12 27

23

2612 5521

Page 13: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Many-core processors● Higher concurrency● Avoid latch contention:

○ reduce number of latches○ reduce granularity of critical sections

● “Link pointer”○ additional method to reach any node

13

Blink-trees

Page 14: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

14

Blink-trees Insertion

101 2 5 2317 28

7 12 27

23

2612

S

21 32 55

X

S

17 21

13

INSERT 13STEP #1

X

Page 15: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

15

Blink-trees Retrieval

101 2 5 2313 28

7 12 27

23

2612 32 5517 21

S

S

S S21

RETRIEVE 21

Page 16: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

16

Blink-trees Insertion

101 2 5 2313 28

7 12 27

23

2612 32 5517 21

17

X

INSERT 13STEP #2

Page 17: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

1. Background2. Blink-Trees3. Write-Optimized B-Trees4. Verification and Fence Keys5. Foster B-Trees6. Performance Evaluation

Agenda

Page 18: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● 20~15 years ago: “90% reads, 10% writes”

● Today:○ memory size grows: increased fraction of writes○ “33% writes”

● Increase performance of writes!

18

Write-optimized B-trees

Page 19: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

19

Write-optimized B-trees

● Classical File Systems:

Buffer:

Disk:

Clean page:

Dirty page:

Page 20: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Log-Structured File Systems

20

Write-optimized B-trees

Buffer:

Disk:

Clean page:

Dirty page:

Large-write block:

INV

ALID

INV

ALID

INV

ALID

INV

ALID

MAPPING LAYER

Page 21: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Log-Structured File Systems:○ Advantages:

■ large-write operation■ reduced number of seek operations■ as large as entire erase blocks of a SSD■ wear leveling

○ Disadvantages:■ mapping layer■ old copies

● space reclamation● defragmentation

write performance to the detriment of scan performance

21

Write-optimized B-trees

NOT DESIRABLE IN MOST DATABASE SYSTEMS!

Page 22: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Large-write operation into B-tree indexes○ mapping overhead == B-tree operations○ update in-place (read optimized)

ORlarge-write (write optimized)

22

Write-optimized B-trees

● Database and B-tree indexes over LSFS

Page 23: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Classical File Systems:

23

Write-optimized B-trees

Buffer:

Disk:

Clean page:

Dirty page:

Large-write block:

INV

ALID

INV

ALID

INV

ALID

INV

ALID

PAGE MIGRATION!

Page 24: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Page migration:○ large-write○ defragmentation○ free space reclamation

24

Write-optimized B-trees

Page 25: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

25

Write-optimized B-trees

101 2 5 2317 28

7 12 27

23

2612 21 55323032

101 2 5 1712 21

7 12

Page 26: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

26

Write-optimized B-trees

5 23

7 12 27

23

2621 5532

32

2 10 12 17- ∞

23 23

+ ∞

- ∞

- ∞

+ ∞

+ ∞28 3012 23 23 27 27 32 3277 12 17 21valid record

26 55

Page 27: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

27

Write-optimized B-trees

● Symmetric fence keys concerns:○ additional storage space in each node

■ prefix and suffix truncation of keys■ additional compression methods

Page 28: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

28

Write-optimized B-trees

● Symmetric fence keys concerns:○ accessing the parent node:

■ probe the buffer pool for the parent node

■ link nodes in the buffer pool to their parents

■ mixed approach

Page 29: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

29

Write-optimized B-trees

● Logging a page migration:○ optimized and inexpensive○ small log records ○ a single log record for an entire operation

Page 30: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

1. Background2. Blink-Trees3. Write-Optimized B-Trees4. Verification and Fence Keys5. Foster B-Trees6. Performance Evaluation

Agenda

Page 31: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

31

Verification and Fence Keys

● Verification of physical integrity of a B-tree○ in-page○ cross-node

● Careful traversal of the whole B-tree structure○ offline verification only :(

● Verification as part of regular maintenance○ online verification○ efficient

Page 32: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

32

Verification and Fence Keys

● In-page verification○ checksum of each individual page

checksum

Page 33: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

33

Verification and Fence Keys

● Cross-node verification○ Approach 1: navigate the whole index structure

■ from lowest to highest key value (depth-first)■ matching forward and backward pointers with key

ranges■ advantage: simple■ disadvantage: repeated read operations for each

page deteriorate performance

Page 34: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

34

Verification and Fence Keys

○ Approach 2: aggregation of facts■ Phase 1:

FACTS:

A

B C

“B is leaf with key range [a,b)”“C is leaf with key range [b,c)”“B is leaf with key range [a,b)”“C follows B”“C is leaf with key range [b,c)”“C follows B”

Page 35: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

35

Verification and Fence Keys

○ Approach 2: aggregation of facts⇒ Phase 2: stream the facts through a matching-

algorithm

MATCHING ALGORITHM

FACTS:

“B is leaf with key range [a,b)”“C is leaf with key range [b,c)”“B is leaf with key range [a,b)”“C follows B”“C is leaf with key range [b,c)”“C follows B”

MATCHES:

“B is leaf with key range [a,b)”“B is leaf with key range [a,b)”

“C is leaf with key range [b,c)”“C is leaf with key range [b,c)”

“C follows B”“C follows B”

Page 36: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

36

Verification and Fence Keys

○ Approach 2: aggregation of facts■ Fact formats:

⇒ “node Y follows node X”⇒ “node X at level N+1 has child Y for key range [a,b)”⇒ “node X at level N has key range [a,b)”

■ “node Y follows node X”⇒ all keys in Y are greater than X?⇒ verification by transitivity

Page 37: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

37

Verification and Fence Keys

○ Approach 2: aggregation of facts■ Cousin nodes

Page 38: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

38

Verification and Fence Keys

○ Approach 2: aggregation of facts

- ∞

+ ∞

- ∞

+ ∞

- ∞

+ ∞

Page 39: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

39

Verification and Fence Keys

○ Approach 2: aggregation of facts■ replace backward and forward pointers with symmetric fence keys■ facts have a single format:

“node X at level N has key value V as low/high fence key”■ each fact is matched with a exact copy that was extracted from the

parent node■ only equality comparisons required for matching facts

○ Approach 3: bit vector filtering○ fact = {node_id, node_level, key_value, (low,high)_fence}○ hash fact to a value ○ reverse the bit in the position indicated by this value in a bitmap○ matching facts hash to the same value○ facts match in even numbers○ at end, bitmap should be back to its original state

Page 40: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

1. Background2. Blink-Trees3. Write-Optimized B-Trees4. Verification and Fence Keys5. Foster B-Trees6. Performance Evaluation

Agenda

Page 41: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Blink-trees○ require link-pointer

● Write-optimized B-tree○ avoid backward and forward pointers for inexpensive

page migration

● There is a contradiction. How then?

41

Foster B-Trees

Page 42: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Foster B-tree relax certain requirements○ at an estimated small cost

● A Foster B-tree at an stable state looks like a Write-optimized B-tree

● Like a Blink-tree, nodes are split locally○ no immediate upward propagation○ intermediate states during a split

42

Foster B-Trees

Page 43: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

43

Foster B-Trees

5

7 12 27

23

2 10

- ∞

23 23

+ ∞

- ∞

- ∞

+ ∞

28 3212 23 23 27 2777 12 2117 26 55

+ ∞INSERT 30 S

S

+ ∞5532

30

fosterrelationship

fosterparent

foster child

32

X

foster key

X

Page 44: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

● Foster relationship:○ transient state○ foster child act as an extension of foster parent node○ root-to-leaf traversal may temporarily be longer○ should be resolved quickly (avoid long foster chains)

■ adoption from foster child by permanent parent● opportunistically at root-to-leaf traversal● forced, by asynchronous utility

44

Foster B-Trees

Page 45: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

45

Foster B-Trees

5

7 12 27

23

2 10

- ∞

23 23

+ ∞

- ∞

- ∞

+ ∞

2812 23 23 27 2777 12 2117 26

+ ∞ADOPTION

+ ∞5532

30 32

X

32

X

+ ∞553232

Page 46: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

1. Background2. Blink-Trees3. Write-Optimized B-Trees4. Verification and Fence Keys5. Foster B-Trees6. Performance Evaluation

Agenda

Page 47: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

47

Performance Evaluation

● Shore-MT○ designed for high concurrency○ classical B-trees

● Environment○ 8 CPU cores (64 hardware contexts)○ 64GB of RAM○ RAID-1

Page 48: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

48

Performance Evaluation● Mixed workload

● Foster relations avoid latch contention

● No long chains of foster relations

○ adoption not required

Page 49: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

49

Performance Evaluation● Mixed workload

○ single thread○ 80% reads○ 20% skewed updates

■ force adoption

● E-OPP: queries runtime remains the same

● None: unsolved foster relations, so runtime tend to increase

Page 50: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

50

Conclusion

● Blink-trees○ high concurrency

● Write-optimized B-trees○ high update rates

● Symmetric fence keys○ efficient verification

Foster B-trees simpler

Page 51: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

Thank you!

Questions?

Page 52: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

22

Write-optimized B-trees

● Symmetric fence keys concerns:○ additional storage space in each node

■ prefix and suffix truncation of keys■ additional compression methods

○ inefficient leaf-level scan (no pointers!)■ ~1% of internal nodes■ asynchronous read-ahead■ prefetching of leaf nodes guided by ancestor

nodes

Page 53: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

24

Write-optimized B-trees

● Logging a page migration:○ “Fully-logged”

■ page contents written to log record■ recovery copy page contents from log■ expensive

Page 54: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

25

Write-optimized B-trees

○ “Forced-write”■ log record = {old_location, new location}■ single log record for the whole migration transaction:

⇒ transaction begin⇒ allocation changes⇒ page migration⇒ transaction commit

■ requires forcing page contents to new location prior to writing log record(no write-ahead logging!)

■ update global allocation information only after writing log record (preserve old page location and contents)

■ if there is a log record, page is at new location■ otherwise, migration did not took place and page is at old

location

Page 55: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

26

Write-optimized B-trees

○ “Forced-write”■ advantages:

⇒ single and small log record⇒ asynchronous write of log record

■ disadvantages:⇒ forcing page contents to new location

Page 56: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

27

Write-optimized B-trees

○ “Non-logged”■ similar to “fully-logged”■ force page contents to new location■ introduces a write dependency:

⇒ old page location is deallocated, but...⇒ do not overwrite contents in older page location

before writing page contents to new location■ weakness: backup and recovery

⇒ backup of currently allocated pages of an index⇒ log record must be complemented with updated

page contents⇒ same cost of “fully-logged”

Page 57: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

31

Verification and Fence Keys

○ Approach 2: aggregation of facts■ Phase 2: stream the facts through a matching-

algorithm⇒ From leaf-node X “node Y follows node X” matches from node

Y “node Y follows node X”⇒ From node X “node X at level N+1 has child Y from key range

[a,b)” matches from node Y “node Y at level N has key range [a,b)”

Page 58: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

32

Verification and Fence Keys

○ Approach 2: aggregation of facts■ “node Y follows node X”■ how to verify that all keys in Y are greater than all

the keys in X?⇒ done transitively by the separator key in the

parent of X and Y■ what if X and Y are neighbors but do not share the

same parent, but share a high ancestor?⇒ X and Y are cousin nodes⇒ transitive verification is not guaranteed across

skipped levels

Page 59: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

41

Performance Evaluation● Selection queries

● Read-only

● No foster relations

● No logging

● No latch conflict

● Shore-MT has a higher compression

● Extra effort for reconstructing and compare a key for binary search

Page 60: Foster B-Trees - - TU K · PDF file1. Background 2. Blink-Trees 3. Write-Optimized B-Trees 4. Verification and Fence Keys 5. Foster B-Trees 6. Performance Evaluation Agenda

44

Performance Evaluation● Similar to previous experiment

○ increasing number of threads

● 80% reads○ Foster B-trees perform

better (as seen)