byteslice: pushing the envelop of main memory data processing with a new storage layout

78
ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout Ziqiang Feng , Eric Lo , Ben Kao , Wenjian Xu The Hong Kong Polytechnic University The University of Hong Kong

Upload: ziqiang-feng

Post on 16-Apr-2017

151 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

ByteSlice: Pushing the Envelop of Main Memory Data Processing with a

New Storage LayoutZiqiang Feng†, Eric Lo†, Ben Kao‡, Wenjian Xu†

†The Hong Kong Polytechnic University‡The University of Hong Kong

Page 2: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

2

Background

Analytic database

Read-most queries

Main memory

Column storeLightweight compression

Modern hardware

Page 3: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

3

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Year1999

1999

2000

1999

Database on SIMD

128 bits

32 bits

(Zhou & Ross, SIGMOD’02)

1999 1999 2000 1999

Page 4: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Example: scan using SIMDYear

1999

1999

2000

1999

1999 1999 2000 1999

Page 5: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Example: scan using SIMDYear

1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 6: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111010000 000000…11111010000 000000…11111010000 000000…11111010000

2000 2000 2000 2000

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

WHERE𝑣=2000

Example: scan using SIMDYear

1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 7: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

7

SIMD_compare_equal0010

False False True False

000000…11111010000 000000…11111010000 000000…11111010000 000000…11111010000

2000 2000 2000 2000

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

WHERE𝑣=2000

Example: scan using SIMDYear

1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 8: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

8

SIMD_compare_equal0010

False False True False

000000…11111010000 000000…11111010000 000000…11111010000 000000…11111010000

2000 2000 2000 2000

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

WHERE𝑣=2000

Example: scan using SIMDYear

1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

4X parallelism

Page 9: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 10: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

Page 11: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 12: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 13: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

Wasted memory bandwidth

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 14: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

14

SIMD_compare_equal0010

False False True False

000000…11111010000 000000…11111010000 000000…11111010000 000000…11111010000

2000 2000 2000 2000

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

Wasted memory bandwidth

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 15: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

15

SIMD_compare_equal0010

False False True False

000000…11111010000 000000…11111010000 000000…11111010000 000000…11111010000

2000 2000 2000 2000

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

Wasted memory bandwidth

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Page 16: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

16

SIMD_compare_equal0010

False False True False

000000…11111010000 000000…11111010000 000000…11111010000 000000…11111010000

2000 2000 2000 2000

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

Wasted resource Year1999

1999

2000

1999

1999 1999 2000 1999

bus

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Padding

Wasted memory bandwidth

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Wasted computation power

Page 17: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

17

Bit-packed(Willhalm et al., VLDB’09)

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Year1999

1999

2000

1999

11111001111

Page 18: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

18

Bit-packed(Willhalm et al., VLDB’09)

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Year1999

1999

2000

1999

11111001111

No padding

Page 19: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

19

Bit-packed(Willhalm et al., VLDB’09)

bus

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Year1999

1999

2000

1999

11111001111

No padding

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Page 20: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

20

Bit-packed(Willhalm et al., VLDB’09)

bus

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Year1999

1999

2000

1999

11111001111

No paddingSavedmemory bandwidth

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Page 21: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

21

Bit-packed(Willhalm et al., VLDB’09)

bus

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Unpack

Year1999

1999

2000

1999

11111001111

No paddingSavedmemory bandwidth

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Page 22: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

22

Bit-packed(Willhalm et al., VLDB’09)

bus

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Unpack

Year1999

1999

2000

1999

11111001111

No paddingSavedmemory bandwidth

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Unpack overhead

Page 23: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

23

Bit-packed(Willhalm et al., VLDB’09)

bus

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Unpack

Year1999

1999

2000

1999

11111001111

No paddingSavedmemory bandwidth

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

Unpack overhead

Page 24: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

24

Bit-packed(Willhalm et al., VLDB’09)

bus

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999

000000…11111001111 000000…11111001111 000000…11111010000 000000…11111001111

1999 1999 2000 1999

Unpack

Year1999

1999

2000

1999

11111001111

No paddingSavedmemory bandwidth

1999 1999 2000 1999

11111001111 11111001111 11111010000 11111001111 …11111001111 11111001111 11111010000 11111001111 …

1999 1999 2000 1999Wasted computation power

Unpack overhead

Page 25: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

25

VBP and HBP• Vertical Bit Parallel (VBP)• Horizontal Bit Parallel (HBP)

(Li & Patel, SIGMOD’13)

Page 26: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

26

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

……… ………

1 1 1 1 1 0 0 1 1 1 11 1 1

Page 27: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

27

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

Page 28: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

28

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000

1 1 1 1 1 0 0 1 1 1 11 1 1

Page 29: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

29

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000

1 1 1 1 1 0 0 1 1 1 11 1 1

Page 30: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

30

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

𝑣=0

Page 31: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

31

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

𝑣=0

Page 32: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

32

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 … … … …

False

False

False

False

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

𝑣=0

(∧…∨…⊕)

Page 33: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

33

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 … … … …

False

False

False

False

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

E a r l y - S t o p

𝑣=0

(∧…∨…⊕)

Page 34: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

34

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 … … … …

False

False

False

False

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

E a r l y - S t o p

Early-stop savesmemory bandwidth

𝑣=0

(∧…∨…⊕)

Page 35: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

35

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 … … … …

False

False

False

False

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

E a r l y - S t o p

Early-stop savesmemory bandwidth

𝑣=0

(∧…∨…⊕)

No wasted computation power

Page 36: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

36

… … … …1 1 1 1 1 1 … … … …1 1 1 1 1 1 … … … …

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

bus

1 1 1 1 1 1 … … … …

1 1 1 1 1 1 … … … …

1 1 0 1 1 1 … … … …

……… ………1 1 1 1 1 1 … … … …

1999

2000 WHERE𝑣=0

0 0 0 0 … … … …

False

False

False

False

0 0 0 0 0 0 … … … …

1 1 1 1 1 0 0 1 1 1 11 1 1

Expensive lookup

E a r l y - S t o p

Early-stop savesmemory bandwidth

𝑣=0

(∧…∨…⊕)

No wasted computation power

Page 37: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

37

High lookup cost in VBP

1 1 1 1 … … … …

1 1 1 1 … … … …

1 1 0 1 … … … …

……… ………1

1

0

Year1999

1999

2000

1999

Page 38: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

38

High lookup cost in VBP

1 1 1 1 … … … …

1 1 1 1 … … … …

1 1 0 1 … … … …

……… ………

Lookup = Given a position ID, retrieve a column value in integer form.

Used for: projection, aggregation, group-by, etc.

1

1

0

Year1999

1999

2000

1999

Page 39: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

39

High lookup cost in VBP

1 1 1 1 … … … …

1 1 1 1 … … … …

1 1 0 1 … … … …

……… ………

Lookup = Given a position ID, retrieve a column value in integer form.

Used for: projection, aggregation, group-by, etc.

… …

2000

= 2000

1

1

0

Year1999

1999

2000

1999

Page 40: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

40

High lookup cost in VBP

1 1 1 1 … … … …

1 1 1 1 … … … …

1 1 0 1 … … … …

……… ………

Lookup = Given a position ID, retrieve a column value in integer form.

Used for: projection, aggregation, group-by, etc.

… …

2000

= 2000

1

1

0

Year1999

1999

2000

1999

1 1 0

Page 41: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

41

High lookup cost in VBP

1 1 1 1 … … … …

1 1 1 1 … … … …

1 1 0 1 … … … …

……… ………

Lookup = Given a position ID, retrieve a column value in integer form.

Used for: projection, aggregation, group-by, etc.

… …

2000

= 2000

1

1

0

Many instructions

Year1999

1999

2000

1999

1 1 0

Page 42: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

42

11111001111

HBP(Li & Patel, SIGMOD’13)

Year1999

1999

2000

1999

11111001111

Page 43: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

43

11111001111

HBP1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

Year1999

1999

2000

1999

11111001111

Page 44: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

44

11111001111

HBP1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

Year1999

1999

2000

1999

11111001111

Delimiter

Page 45: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

45

11111001111

HBP

bus

1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

1999 1999 2000 1999

Year1999

1999

2000

1999

11111001111

Delimiter

Page 46: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

46

11111001111

HBP

bus

1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

1999 1999 2000 1999

0 11111010000 0 11111010000 0 11111010000 0 11111010000 … … … … … …

2000 2000 2000 2000 WHERE𝑣=2000

Year1999

1999

2000

1999

11111001111

Delimiter

Page 47: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

47

11111001111

HBP

bus

1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

1999 1999 2000 1999

0 11111010000 0 11111010000 0 11111010000 0 11111010000 … … … … … …

2000 2000 2000 2000 WHERE𝑣=2000

0 00000000000 0 00000000000 1 00000000000 0 00000000000 … … … … … …False False True False

+−∧∨→←

Year1999

1999

2000

1999

11111001111

Delimiter

Page 48: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

48

11111001111

HBP

bus

1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

1999 1999 2000 1999

0 11111010000 0 11111010000 0 11111010000 0 11111010000 … … … … … …

2000 2000 2000 2000 WHERE𝑣=2000

0 00000000000 0 00000000000 1 00000000000 0 00000000000 … … … … … …False False True False

+−∧∨→←

No unpack overhead

Year1999

1999

2000

1999

11111001111

Delimiter

Page 49: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

49

11111001111

HBP

bus

1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

1999 1999 2000 1999

0 11111010000 0 11111010000 0 11111010000 0 11111010000 … … … … … …

2000 2000 2000 2000 WHERE𝑣=2000

0 00000000000 0 00000000000 1 00000000000 0 00000000000 … … … … … …False False True False

+−∧∨→←

No unpack overhead

No early-stop like VBP

Year1999

1999

2000

1999

11111001111

Delimiter

Page 50: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

50

11111001111

HBP

bus

1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

0 11111001111 0 11111001111 0 11111010000 0 11111001111 … … … … … …

1999 1999 2000 1999

0 11111010000 0 11111010000 0 11111010000 0 11111010000 … … … … … …

2000 2000 2000 2000 WHERE𝑣=2000

0 00000000000 0 00000000000 1 00000000000 0 00000000000 … … … … … …False False True False

+−∧∨→←

No unpack overhead

No early-stop like VBP

Year1999

1999

2000

1999

11111001111

Wasted bandwidth for extra bits

Delimiter

Page 51: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

51

Our contributionVBP HBP ByteSlice

Scan

Early-stop Lookup

Page 52: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

52

ByteSlice: the layout

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

Page 53: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

53

ByteSlice: the layout

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

11111001

111

Page 54: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

54

ByteSlice: the layout

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

Page 55: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

55

ByteSlice: the layout

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

1999 2000

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

Page 56: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

56

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

Page 57: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

57

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

Page 58: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

58

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

WHERE𝑣=0

𝑣=0

Page 59: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

59

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

WHERE𝑣=0

𝑣=0

Page 60: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

60

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

00000000 00000000 00000000 00000000 … … … … … …

False False False False

WHERE𝑣=0

𝑣=0

Page 61: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

61

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

00000000 00000000 00000000 00000000 … … … … … …

False False False False

WHERE𝑣=0E a r l y - S t o p

𝑣=0

Page 62: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

62

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

00000000 00000000 00000000 00000000 … … … … … …

False False False False

WHERE𝑣=0E a r l y - S t o p

Early-stop savesmemory bandwidth

𝑣=0

Page 63: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

63

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

00000000 00000000 00000000 00000000 … … … … … …

False False False False

WHERE𝑣=0E a r l y - S t o p

Early-stop savesmemory bandwidth

𝑣=0

No unpack overhead

Page 64: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

64

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

Year1999

1999

2000

1999

𝐵𝑆1 11111001 11111001 11111010 11111001 … … … … … …

ByteSlice: scan

bus

11100000 11100000 00000000 11100000 … … … … … …

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1𝐵𝑆2

00000000 00000000 00000000 00000000 … … … … … …

00000000 00000000 00000000 00000000 … … … … … …

False False False False

WHERE𝑣=0E a r l y - S t o p

Early-stop savesmemory bandwidth

Exploit SIMD byte-level instructions(16X parallelism)

𝑣=0

No unpack overhead

Page 65: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

65

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

Page 66: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

66

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

1999

= 1999

Page 67: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

67

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

1999

= 199911111001 111

Page 68: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

68

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

1999

= 1999

Few instructions

11111001 111

Page 69: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

69

Experiments• Setup

• Intel i7 quad-core• AVX2 SIMD instruction (256 bits)

• Micro-benchmark• Vary # bits per value• Vary selectivity• Vary data skew• Scale out multicores

• TPC-H 10 GB• Default and Zipfian

• Real datasets• Adult• Baseball

Page 70: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

70

3 representative queries

Page 71: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

71

Conclusion: ByteSliceCombine the advantages of state-of-the-art

Avoid their disadvantagesEfficient scanEfficient lookupNo tradeoff

Page 72: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

72

Thank you

Page 73: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

73

Appendix

Page 74: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

Alternative:Storing trailing bits in VBP• A hybrid of ByteSlice and VBP

Year1999

1999

2000

1999

11111001 11111111001 111

11111001 11111001 11111010 11111001 … … … … … …𝐵𝑆1

1 1 0 1 1 1 … … … …

1 1 0 1 1 1 … … … …

1 1 0 1 1 1 … … … …𝑉 1

𝑉 2

𝑉 3

Page 75: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

75

Padding / Space overhead?• If value not a multiple of 8 bits, pad 0’s at the end.• We focus on memory bandwidth, because:• Adding RAM is easy• Increasing memory bandwidth is difficult

• Extra RAM space? Cheap.• Extra bandwidth? Early stop helps!

Page 76: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

76

How does the # of bits affects?

Page 77: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

77

Comparison of Early-stop

Layout Early-stop? # of processed bits per valueBit-packed X 15HBP X 16VBP √ 10.53ByteSlice √ 8.94

Page 78: ByteSlice: Pushing the Envelop of Main Memory Data Processing with a New Storage Layout

78

TPC-H results