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

Post on 16-Apr-2017

151 Views

Category:

Data & Analytics

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

2

Background

Analytic database

Read-most queries

Main memory

Column storeLightweight compression

Modern hardware

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

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

Example: scan using SIMDYear

1999

1999

2000

1999

1999 1999 2000 1999

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

25

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

(Li & Patel, SIGMOD’13)

26

… … … …

… … … …

… … … …

VBPYear

1999

1999

2000

1999

……… ………

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

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

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

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

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

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

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

(∧…∨…⊕)

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

(∧…∨…⊕)

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

(∧…∨…⊕)

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

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

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

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

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

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

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

42

11111001111

HBP(Li & Patel, SIGMOD’13)

Year1999

1999

2000

1999

11111001111

43

11111001111

HBP1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

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

Year1999

1999

2000

1999

11111001111

44

11111001111

HBP1999 1999 2000 1999

(Li & Patel, SIGMOD’13)

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

Year1999

1999

2000

1999

11111001111

Delimiter

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

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

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

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

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

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

51

Our contributionVBP HBP ByteSlice

Scan

Early-stop Lookup

52

ByteSlice: the layout

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

53

ByteSlice: the layout

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

11111001

111

54

ByteSlice: the layout

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

55

ByteSlice: the layout

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

1999 2000

𝐵𝑆1𝐵𝑆2

Year1999

1999

2000

1999

11111001 11111111001 111

56

Year1999

1999

2000

1999

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

ByteSlice: scan

11100000 11100000 00000000 11100000 … … … … … …

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

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

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

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

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

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

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

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

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

65

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

66

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

1999

= 1999

67

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

1999

= 199911111001 111

68

11111001 11111001 11111010 11111001 … … … … … …

11100000 11100000 00000000 11100000 … … … … … …

ByteSlice: lookupYear

1999

1999

2000

1999

11111001

111

1999

= 1999

Few instructions

11111001 111

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

70

3 representative queries

71

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

Avoid their disadvantagesEfficient scanEfficient lookupNo tradeoff

72

Thank you

73

Appendix

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

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!

76

How does the # of bits affects?

77

Comparison of Early-stop

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

78

TPC-H results

top related