Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Sorting and Join Algorithms in Database Systems: Lecture 12 by Andy Pavlo at CMU, Study notes of Algorithms and Programming

A lecture note from Carnegie Mellon University (CMU) course 15-721 (Spring 2016) on Database Systems. The lecture, titled 'Join Algorithms (Sorting)', covers the topic of sorting and merge join algorithms in the context of database systems. agendas, diagrams, and references to related research papers.

Typology: Study notes

2021/2022

Uploaded on 09/12/2022

riciard
riciard 🇬🇧

4.4

(7)

234 documents

1 / 123

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Andy Pavlo // Carnegie Mellon University // Spring 2016
Lecture #12 Join Algorithms (Sorting)
DATABASE
SYSTEMS
15-721
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Sorting and Join Algorithms in Database Systems: Lecture 12 by Andy Pavlo at CMU and more Study notes Algorithms and Programming in PDF only on Docsity!

Andy Pavlo // Carnegie Mellon University // Spring 2016

Lecture #12 – Join Algorithms (Sorting)

DATABASE SYSTEMS

15-

TO DAY ’ S AG E N DA

Background SIMD

Parallel Sort-Merge Join Evaluation

Hate Mail

S O R T- M E R G E J O I N ( R ⨝ S )

Relation R Relation S

S O R T- M E R G E J O I N ( R ⨝ S )

Relation R Relation S

SORT!

SORT!

S O R T- M E R G E J O I N ( R ⨝ S )

Relation R Relation S

SORT!^ ⨝

SORT!

MERGE!

S O R T- M E R G E J O I N ( R ⨝ S )

Relation R Relation S

SORT!^ ⨝

SORT!

MERGE!

I N - M E M O R Y J O I N S

→ → Hashing is faster than Sort-Merge.Sort-Merge will be faster with wider SIMD.

SORT VS. HASH REVISITED: FAST JOIN IMPLEMENTATION ON MODERN MULTI VLDB 2009 - CORE CPUS

→ Sort-Merge is already faster,even without SIMD.

MASSIVELY JOINS IN MAIN MEMORY MULTI CORE DATABASE SYSTEMS VLDB 2012 PARALLEL SORT-MERGE-

→ New optimizations andresults for Radix Hash Join.

MAIN MULTI UNDERLYING HARDWARE ICDE 2013 - MEMORY HASH JOINS ON-CORE CPUS: TUNING TO THE

Source: Cagri Balkesen

S I N G L E I N S T R U C T I O N , M U LT I P L E D ATA

A class of CPU instructions that allow theprocessor to perform the same operation on

multiple data points simultaneously.

Both current AMD and Intel CPUs have ISA andmicroarchitecture support SIMD operations.

→ MMX, 3DNow!, SSE, SSE2, SSE3, SSE4, AVX

S I M D E X A M P L E

X + Y = Z

n n xn y n

xx yy y

yy x

x ... x (^21) ... (^2121) ...^12

Z

S I M D E X A M P L E

X + Y = Z

n n xn y n

xx yy y

yy x

x ... x (^21) ... (^2121) ...^12

X for Z[i] = X[i] + Y[i]; (i=0; i<n; i++) { }

Y

Z

S I M D E X A M P L E

X + Y = Z

n n xn y n

xx yy y

yy x

x ... x (^21) ... (^2121) ...^12

X

SISD

for Z[i] = X[i] + Y[i]; (i=0; i<n; i++) {^ + }

Y

Z

S I M D E X A M P L E

X + Y = Z

n n xn y n

xx yy y

yy x

x ... x (^21) ... (^2121) ...^12

X

SISD

for Z[i] = X[i] + Y[i]; (i=0; i<n; i++) {^ + }

Y

Z

S I M D E X A M P L E

X + Y = Z

n n xn y n

xx yy y

yy x

x ... x (^21) ... (^2121) ...^12

X for Z[i] = X[i] + Y[i]; (i=0; i<n; i++) { }

Y

SIMD

Z

S I M D E X A M P L E

X + Y = Z

n n xn y n

xx yy y

yy x

x ... x (^21) ... (^2121) ...^12

X for Z[i] = X[i] + Y[i]; (i=0; i<n; i++) { }

Y

SIMD