Modern BTree techniques DMITRY DOLGOV 31-01-2020 @aspis7 1 - - PowerPoint PPT Presentation

modern btree techniques
SMART_READER_LITE
LIVE PREVIEW

Modern BTree techniques DMITRY DOLGOV 31-01-2020 @aspis7 1 - - PowerPoint PPT Presentation

Modern BTree techniques DMITRY DOLGOV 31-01-2020 @aspis7 1 @aspis7 1 Graefe, Goetz and Harumi A. Kuno. Modern B- tree techniques. IEEE 27th International Confer- ence on Data Engineering, 2011. D. Comet, Ubiquitous B-tree,


slide-1
SLIDE 1

Modern BTree techniques

DMITRY DOLGOV

31-01-2020

slide-2
SLIDE 2

@aspis7

1

slide-3
SLIDE 3

@aspis7

1

slide-4
SLIDE 4
  • D. Comet, ”Ubiquitous B-tree”, ACM Comp. Surv.,
  • vol. 11, no. 2, 1979.

Graefe, Goetz and Harumi A. Kuno. ”Modern B- tree techniques.” IEEE 27th International Confer- ence on Data Engineering, 2011.

2

slide-5
SLIDE 5
  • D. Comet, ”Ubiquitous B-tree”, ACM Comp. Surv.,
  • vol. 11, no. 2, 1979.

Graefe, Goetz and Harumi A. Kuno. ”Modern B- tree techniques.” IEEE 27th International Confer- ence on Data Engineering, 2011.

2

slide-6
SLIDE 6

RUM conjecture B-Tree Key normalization & friends SB-Tree MDAM Hybrid, Bw-Tree, DPTree Trie Everything else

3

slide-7
SLIDE 7

B-Tree B+-Tree Blink-Tree DPTree wB+-Tree NV-Tree FPTree FASTFAIR HiKV Masstree Skip List ART WORT CDDS-Tree Bw-Tree HOT KISS-Tree VAST-Tree FAST HV-Tree UB-Tree LHAM MDAM Hybrid B+-Tree

4

slide-8
SLIDE 8

Mem Write Read

5

slide-9
SLIDE 9

Mem Write Read

5

slide-10
SLIDE 10

Complexity? Mem Write Read

5

slide-11
SLIDE 11

B+Tree

  • P. Lehman and S. Yao, Efficient Locking for Concurrent Operations on B-Trees, ACM Transactions on Database Systems, Vol 6, No. 4, December

1981, pp 650-670

6

slide-12
SLIDE 12

B+Tree

  • P. Lehman and S. Yao, Efficient Locking for Concurrent Operations on B-Trees, ACM Transactions on Database Systems, Vol 6, No. 4, December

1981, pp 650-670

6

slide-13
SLIDE 13

B+Tree

  • P. Lehman and S. Yao, Efficient Locking for Concurrent Operations on B-Trees, ACM Transactions on Database Systems, Vol 6, No. 4, December

1981, pp 650-670

6

slide-14
SLIDE 14

B+Tree

  • P. Lehman and S. Yao, Efficient Locking for Concurrent Operations on B-Trees, ACM Transactions on Database Systems, Vol 6, No. 4, December

1981, pp 650-670

6

slide-15
SLIDE 15

B+Tree

  • P. Lehman and S. Yao, Efficient Locking for Concurrent Operations on B-Trees, ACM Transactions on Database Systems, Vol 6, No. 4, December

1981, pp 650-670

6

slide-16
SLIDE 16

B+Tree

  • P. Lehman and S. Yao, Efficient Locking for Concurrent Operations on B-Trees, ACM Transactions on Database Systems, Vol 6, No. 4, December

1981, pp 650-670

6

slide-17
SLIDE 17

Page split

7

slide-18
SLIDE 18

Page split

7

slide-19
SLIDE 19

Page split

7

slide-20
SLIDE 20

Page split

7

slide-21
SLIDE 21

Page merge ”By adding periodic rebuilding of the tree, we

  • btain a data structure that is theoreticaly

superior to standard B-trees in many ways. Our results suggest that rebalancing on deletion no only unnecessary but may be harmful.”

  • S. Sen and R. E. Tarjan, ”Deletion without rebalancing in multiway search trees.” ISAAC, pp.

832-841, 2009

8

slide-22
SLIDE 22

Mem Write Read B-Tree

9

slide-23
SLIDE 23

Mem Write Read B-Tree

9

slide-24
SLIDE 24

Mem Write Read B-Tree

9

slide-25
SLIDE 25

Key normalization 1 ”Dirk” ”Bart” 1 0..01 1 11..00 ∅ 1 10..10 ∅ 2 ”Todd” Null 1 0..10 1 01..00 ∅ 0 Null ”” Null 0 1 ∅ 0

  • R. C. Singleton, ”An efficient algorithm for sorting with minimal storage”, Communications of the ACM, vol. 12, no.3 pp. 185-186, 1969

10

slide-26
SLIDE 26

Prefix truncation Smith Jack 01-02-2019 Smith Jane 02-03-2019 Smith James 03-04-2019

11

slide-27
SLIDE 27

Prefix truncation Smith Ja ck 01-02-2019 Smith Ja ne 02-03-2019 Smith Ja mes 03-04-2019

11

slide-28
SLIDE 28

Prefix truncation Smith Ja ck 01-02-2019 ne 02-03-2019 mes 03-04-2019

11

slide-29
SLIDE 29

Prefix truncation

11

slide-30
SLIDE 30

Prefix truncation

11

slide-31
SLIDE 31

Dynamic prefix truncation

12

slide-32
SLIDE 32

Dynamic prefix truncation

12

slide-33
SLIDE 33

Dynamic prefix truncation

12

slide-34
SLIDE 34

Suffix truncation Johnson David 04-02-2019 Miller Kevin 01-02-2019 Miller Ned 02-03-2019 Miller Steven 03-04-2019 Smith Jack 01-02-2019

  • R. Bayer, K. Unterauer, ”Prefix B-trees”, ACM Transactions on Database Systems, vol. 2, no. 1, pp. 11-26, 1977

13

slide-35
SLIDE 35

Suffix truncation Johnson David 04-02-2019 Miller Kevin 01-02-2019 Miller Ned 02-03-2019 Miller Steven 03-04-2019 Smith Jack 01-02-2019

  • R. Bayer, K. Unterauer, ”Prefix B-trees”, ACM Transactions on Database Systems, vol. 2, no. 1, pp. 11-26, 1977

13

slide-36
SLIDE 36

Suffix truncation Johnson David 04-02-2019 Miller Kevin 01-02-2019 Miller N ed 02-03-2019 Miller Steven 03-04-2019 Smith Jack 01-02-2019

  • R. Bayer, K. Unterauer, ”Prefix B-trees”, ACM Transactions on Database Systems, vol. 2, no. 1, pp. 11-26, 1977

13

slide-37
SLIDE 37

Suffix truncation J ohnson David 04-02-2019 Miller Kevin 01-02-2019 Miller Ned 02-03-2019 Miller Steven 03-04-2019 Smith Jack 01-02-2019

  • R. Bayer, K. Unterauer, ”Prefix B-trees”, ACM Transactions on Database Systems, vol. 2, no. 1, pp. 11-26, 1977

13

slide-38
SLIDE 38

Indirection vector

CPU Cache

  • G. Graefe, Per-Ake Larson, ”B-tree indexes and CPU caches”, International Conference on Data Engineering, pp. 349-358, 2001

14

slide-39
SLIDE 39

Indirection vector

a b c d

CPU Cache

  • G. Graefe, Per-Ake Larson, ”B-tree indexes and CPU caches”, International Conference on Data Engineering, pp. 349-358, 2001

14

slide-40
SLIDE 40

Indirection vector

a b c d

CPU Cache

  • G. Graefe, Per-Ake Larson, ”B-tree indexes and CPU caches”, International Conference on Data Engineering, pp. 349-358, 2001

14

slide-41
SLIDE 41

SB-tree

  • P. E. O’Neil, ”The SB-tree: An index-sequential structure for high performance sequential access”, Acta Informatica, vol. 29, no. 3. pp. 241-265, 1992

15

slide-42
SLIDE 42

SB-tree

  • P. E. O’Neil, ”The SB-tree: An index-sequential structure for high performance sequential access”, Acta Informatica, vol. 29, no. 3. pp. 241-265, 1992

15

slide-43
SLIDE 43

Multidimentional Access Method

1,a ... 1,z 2,a ... 2,z 3,a ... 3,z

  • H. Leslie, R. Jain, D. Birdsall, H. Yaghmai, ”Efficient search of multidimentionel B-trees”,

ACM Transactions on Database Systems, vol. 6, no. 4, pp. 650-670, 1995

16

slide-44
SLIDE 44

Multidimentional Access Method

1,a ... 1,z 2,a ... 2,z 3,a ... 3,z

  • H. Leslie, R. Jain, D. Birdsall, H. Yaghmai, ”Efficient search of multidimentionel B-trees”,

ACM Transactions on Database Systems, vol. 6, no. 4, pp. 650-670, 1995

16

slide-45
SLIDE 45

Multidimentional Access Method

1,a ... 1,z 2,a ... 2,z 3,a ... 3,z

  • H. Leslie, R. Jain, D. Birdsall, H. Yaghmai, ”Efficient search of multidimentionel B-trees”,

ACM Transactions on Database Systems, vol. 6, no. 4, pp. 650-670, 1995

16

slide-46
SLIDE 46

Multidimentional Access Method

1,a ... 1,z 2,a ... 2,z 3,a ... 3,z

  • H. Leslie, R. Jain, D. Birdsall, H. Yaghmai, ”Efficient search of multidimentionel B-trees”,

ACM Transactions on Database Systems, vol. 6, no. 4, pp. 650-670, 1995

16

slide-47
SLIDE 47

17

slide-48
SLIDE 48

Partitioned B-tree

18

slide-49
SLIDE 49

Partitioned B-tree

18

slide-50
SLIDE 50

Partitioned B-tree

  • G. Graefe, ”Sorting and indexing with partitioned B-Trees”, Classless Inter Domain

Routing, 2003

18

slide-51
SLIDE 51

Partitioned B-tree

  • G. Graefe, ”Sorting and indexing with partitioned B-Trees”, Classless Inter Domain

Routing, 2003

18

slide-52
SLIDE 52

Partitioned B-tree

Riegger Christian, Vincon Tobias, Petrov Ilia. (2017). Write-optimized indexing with partitioned b-trees. 296-300.

18

slide-53
SLIDE 53

Partitioned B-tree

Riegger Christian, Vincon Tobias, Petrov Ilia. (2017). Write-optimized indexing with partitioned b-trees. 296-300.

18

slide-54
SLIDE 54

Hybrid indexes

Insert

Huanchen Zhang, David G. Andersen, Andrew Pavlo, Michael Kaminsky, Lin Ma, and Rui Shen. 2016. Reducing the Storage Overhead of Main-Memory OLTP Databases with Hybrid Indexes. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD ’16). Association for Computing Machinery, New York, NY, USA, 1567–1581.

19

slide-55
SLIDE 55

Hybrid indexes

Insert

Huanchen Zhang, David G. Andersen, Andrew Pavlo, Michael Kaminsky, Lin Ma, and Rui Shen. 2016. Reducing the Storage Overhead of Main-Memory OLTP Databases with Hybrid Indexes. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD ’16). Association for Computing Machinery, New York, NY, USA, 1567–1581.

19

slide-56
SLIDE 56

Hybrid indexes

Insert

Huanchen Zhang, David G. Andersen, Andrew Pavlo, Michael Kaminsky, Lin Ma, and Rui Shen. 2016. Reducing the Storage Overhead of Main-Memory OLTP Databases with Hybrid Indexes. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD ’16). Association for Computing Machinery, New York, NY, USA, 1567–1581.

19

slide-57
SLIDE 57

Hybrid indexes

Insert

Huanchen Zhang, David G. Andersen, Andrew Pavlo, Michael Kaminsky, Lin Ma, and Rui Shen. 2016. Reducing the Storage Overhead of Main-Memory OLTP Databases with Hybrid Indexes. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD ’16). Association for Computing Machinery, New York, NY, USA, 1567–1581.

19

slide-58
SLIDE 58

Hybrid indexes

Insert Read

Huanchen Zhang, David G. Andersen, Andrew Pavlo, Michael Kaminsky, Lin Ma, and Rui Shen. 2016. Reducing the Storage Overhead of Main-Memory OLTP Databases with Hybrid Indexes. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD ’16). Association for Computing Machinery, New York, NY, USA, 1567–1581.

19

slide-59
SLIDE 59

Hybrid indexes

Insert Read

Huanchen Zhang, David G. Andersen, Andrew Pavlo, Michael Kaminsky, Lin Ma, and Rui Shen. 2016. Reducing the Storage Overhead of Main-Memory OLTP Databases with Hybrid Indexes. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD ’16). Association for Computing Machinery, New York, NY, USA, 1567–1581.

19

slide-60
SLIDE 60

Bw-Tree

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-61
SLIDE 61

Bw-Tree

1 2

ID PTR 1 0x... 2 0x...

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-62
SLIDE 62

Bw-Tree

ID PTR 1 0x... 2 0x...

∆ Page

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-63
SLIDE 63

Bw-Tree

ID PTR 1 0x... 2 0x...

∆ Page

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-64
SLIDE 64

Bw-Tree

ID PTR 1 0x... 2 0x...

∆ Page

CAS

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-65
SLIDE 65

Bw-Tree

ID PTR 1 0x... 2 0x...

∆1 ∆2 ∆3 Page

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-66
SLIDE 66

Bw-Tree

ID PTR 1 0x... 2 0x...

∆1 ∆2 ∆3 Page Merged Page

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-67
SLIDE 67

Bw-Tree

ID PTR 1 0x... 2 0x...

∆1 ∆2 ∆3 Page

CAS

Merged Page

Levandoski Justin, Lomet David, Sengupta Sudipta. (2012). The Bw-Tree: A B-tree for New Hardware Platforms. Proceedings - International Conference on Data Engineering.

20

slide-68
SLIDE 68

DPTree

Insert Read

Zhou Xinjing, Shou Lidan, Chen Ke, Hu Wei, Chen Gang. (2019). DPTree: differential indexing for persistent memory. Proceedings of the VLDB Endowment.

21

slide-69
SLIDE 69

DPTree

Insert Read

Zhou Xinjing, Shou Lidan, Chen Ke, Hu Wei, Chen Gang. (2019). DPTree: differential indexing for persistent memory. Proceedings of the VLDB Endowment.

21

slide-70
SLIDE 70

DPTree

Insert Read

Zhou Xinjing, Shou Lidan, Chen Ke, Hu Wei, Chen Gang. (2019). DPTree: differential indexing for persistent memory. Proceedings of the VLDB Endowment.

21

slide-71
SLIDE 71

DPTree

Insert Read Read Merge

Zhou Xinjing, Shou Lidan, Chen Ke, Hu Wei, Chen Gang. (2019). DPTree: differential indexing for persistent memory. Proceedings of the VLDB Endowment.

21

slide-72
SLIDE 72

Trie

1 01 1

10

11

0010

1

010

1

011

1

1111

00 00

001100

01

111001

1

11101 0011000

1

0011001

22

slide-73
SLIDE 73

Trie

1 01 1

10

11

0010

1

010

1

011

1

1111

00 00

001100

01

111001

1

11101 0011000

1

0011001 Leis V., Kemper Alfons, Neumann Thomas. (2013). The adaptive radix tree: ARTful indexing for main-memory databases. Proceedings - International Conference on Data Engineering. 38-49.

22

slide-74
SLIDE 74

Trie

1 01 1

10

11

0010

1

010

1

011

1

1111

00 00

001100 0011000

1

0011001

01

111001

1

11101 Binna Robert, Zangerle Eva, Pichl Martin, Specht Guenther, Leis Viktor. (2018). HOT: A Height Optimized Trie Index for Main-Memory Database Systems. 521-534.

22

slide-75
SLIDE 75

Is that all?

23

slide-76
SLIDE 76

@Unzucht

23

slide-77
SLIDE 77

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-78
SLIDE 78

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-79
SLIDE 79

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-80
SLIDE 80

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-81
SLIDE 81

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-82
SLIDE 82

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-83
SLIDE 83

Buffered (Lazy) B-Tree Cache conscious B-Tree Learned indexes UB-Tree Skip List LSM Tree ...

24

slide-84
SLIDE 84

25

slide-85
SLIDE 85

Questions?

 @erthalion  dmitrii.dolgov at zalando dot de  9erthalion6 at gmail dot com

26