Vous êtes sur la page 1sur 20

Chapter 3:

In-Memory Database Operators


Learning Map
Ioundanons for a
New Lnterpr|se
App||canon
Deve|opment Lra
Ioundanons of
Database Storage
1echn|ques
1he Iuture of
Lnterpr|se
Compunng
Advanced
Database
Storage
1ech-
n|ques
In-Memory
Database
Cperators
Insert


Dr.-Ing. Jrgen Mller
Example
recID fname |name gen
der
country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
... ... ... ... ... ... ...
Lxample 1able: world_populauon
lnSL81 ln1C world_populauon
vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
48
INSERT Without
New Dictionary Entry
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
... ... ... ... ... ... ...
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
0 0
1 1
2 3
3 2
4 3
u Av
AurlbuLe vecLor (Av)
ulcuonary (u)
0 AlbrechL
1 8erg
2 Meyer
3 Schulze
49
1. Look-up on dlcuonary ! enLry found
AurlbuLe vecLor (Av)
ulcuonary (u)
u
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
... ... ... ... ... ... ...
Av
0 0
1 1
2 3
3 2
4 3
INSERT Without
New Dictionary Entry
0 AlbrechL
1 8erg
2 Meyer
3 Schulze
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
30
0 0
1 1
2 3
3 2
4 3
3 3
1. Look-up on dlcuonary ! enLry found
2. Append valuelu Lo aurlbuLe vecLor
AurlbuLe vecLor (Av)
ulcuonary (u)
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze
... ... ... ... ... ... ...
Av
0 AlbrechL
1 8erg
2 Meyer
3 Schulze
u
INSERT Without
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
31
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze
... ... ... ... ... ... ...
0 0
1 0
2 1
3 2
4 3
u Av
0 8erlln
1 Pamburg
2 lnnsbruck
3 oLsdam
AurlbuLe vecLor (Av)
ulcuonary (u)
INSERT With
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
32
1. Look-up on dlcuonary ! no enLry found
u Av
0 0
1 0
2 1
3 2
4 3
0 8erlln
1 Pamburg
2 lnnsbruck
3 oLsdam
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
INSERT With
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
33
1. Look-up on dlcuonary ! no enLry found
2. Append new value Lo dlcuonary (no re-sorung necessary)
0 8erlln
1 Pamburg
2 lnnsbruck
3 oLsdam
4 8osLock
u
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
Av
0 0
1 0
2 1
3 2
4 3
INSERT With
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
34
1. Look-up on dlcuonary ! no enLry found
2. Append new value Lo dlcuonary (no re-sorung necessary)
3. Append valuelu Lo aurlbuLe vecLor
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze 8osLock
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
0 0
1 0
2 1
3 2
4 3
3 4
0 8erlln
1 Pamburg
2 lnnsbruck
3 oLsdam
4 8osLock
u Av
INSERT With
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
33
0 AnLon
1 Panna
2 Marun
3 Mlchael
4 Sophle
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze 8osLock
... ... ... ... ... ... ...
u Av
0 2
1 3
2 1
3 0
4 4
AurlbuLe vecLor (Av)
ulcuonary (u)
INSERT With
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
36
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze 8osLock
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
0 AnLon
1 Panna
2 Marun
3 Mlchael
4 Sophle
u Av
0 2
1 3
2 1
3 0
4 4
INSERT With
New Dictionary Entry
1. Look-up on dlcuonary ! no enLry found
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
37
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze 8osLock
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
0 AnLon
1 Panna
2 Marun
3 Mlchael
4 Sophle
3 karen
u Av
0 2
1 3
2 1
3 0
4 4
INSERT With
New Dictionary Entry
1. Look-up on dlcuonary ! no enLry found
2. Append new value Lo dlcuonary
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
38
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze 8osLock
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
0 AnLon
1 Panna
2 Marun
3 Mlchael
4 Sophle
3 karen
u (old) Av
0 2
1 3
2 1
3 0
4 4
0 AnLon
1 Panna
2 karen
3 Marun
4 Mlchael
3 Sophle
u (new)
INSERT With
New Dictionary Entry
1. Look-up on dlcuonary ! no enLry found
2. Append new value Lo dlcuonary
3. SorL dlcuonary
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
39
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 Schulze 8osLock
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
Av (old)
0 AnLon
1 Panna
2 karen
3 Marun
4 Mlchael
3 Sophle
u (new) Av (new)
0 3
1 4
2 1
3 0
4 3
0 2
1 3
2 1
3 0
4 4
INSERT With
New Dictionary Entry
1. Look-up on dlcuonary ! no enLry found
2. Append new value Lo dlcuonary
3. SorL dlcuonary
4. Change valuelus ln aurlbuLe vecLor
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
60
1. Look-up on dlcuonary ! no enLry found
2. Append new value Lo dlcuonary
3. SorL dlcuonary
4. Change valuelus ln aurlbuLe vecLor
3. Append new valuelu Lo aurlbuLe vecLor
fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 Sophle Schulze f CL8 oLsdam 09-03-1977
3 karen Schulze 8osLock
... ... ... ... ... ... ...
AurlbuLe vecLor (Av)
ulcuonary (u)
0 AnLon
1 Panna
2 karen
3 Marun
4 Mlchael
3 Sophle
u Av
0 3
1 4
2 1
3 0
4 3
3 2
INSERT With
New Dictionary Entry
lnSL81 ln1C world_populauon vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
61
Result
recID fname |name gender country c|ty b|rthday
0 Marun AlbrechL m CL8 8erlln 08-03-1933
1 Mlchael 8erg m CL8 8erlln 03-03-1970
2 Panna Schulze f CL8 Pamburg 04-04-1968
3 AnLon Meyer m Au1 lnnsbruck 10-20-1992
4 ulrlke Schulze f CL8 oLsdam 09-03-1977
3 karen Schulze f CL8 8osLock 06-20-2012
... ... ... ... ... ... ...
lnSL81 ln1C world_populauon
vALuLS (karen, Schulze, f, CL8, 8osLock, 06-20-2012)
62
Lxample 1able: world_populauon
Learning Map
Ioundanons for a
New Lnterpr|se
App||canon
Deve|opment Lra
Ioundanons of
Database Storage
1echn|ques
1he Iuture of
Lnterpr|se
Compunng
Advanced
Database
Storage
1ech-
n|ques
In-Memory
Database
Cperators
Scan Performance


Dr.-Ing. Jrgen Mller
Scan Performance (1)
8 bllllon humans
! AurlbuLes:
" rsL name
" lasL name
" gender
" counLry
" clLy
" blrLhday
! 200 byLe

! Cuesuon: Pow many women, how many men?
! Assumed scan speed: 2M8/ms/core
63
Row
1
Row
2
Row
3
...
Row
8 x 10
First Name
Last Name
Gender
Country
City
Birthday
Table: humans
9
Scan Performance (2)
8ow SLore - LayouL
66
1ab|e: wor|d_popu|anon
Row
1
Row
2
Row
3
...
Row
8 x 10
First Name
Last Name
Gender
Country
City
Birthday
Table: humans
9
Scan Performance (3)
8ow SLore - LayouL
67
! 1able slze:
8 bllllon Luples
200 byLes per
Luple = 1.6 18

1ab|e: wor|d_popu|anon
Row
1
Row
2
Row
3
...
First Name
Last Name Country
City
Birthday
Table: humans
Data loaded
and used
Data loaded
but not used
Row
8 x 10
9
Gender
Scan Performance (4)
! 1able slze:
8 bllllon Luples
200 byLes per
Luple = 1.6 18
! Scan Lhrough
all rows wlLh
2M8/ms/core
! 800 s
wlLh 1 core

8ow SLore - lull 1able Scan
68
1ab|e: wor|d_popu|anon
Row
1
Row
2
Row
3
...
First Name
Last Name Country
City
Birthday
Table: humans
Data
not loaded
Data loaded
and used
Data loaded
but not used
Row
8 x 10
9
Gender
Scan Performance (5)
! 8 bllllon cache
accesses a 64 byLe
= S12 G8
! 8ead wlLh
2M8/ms/core
! 2S6 s
wlLh 1 core
8ow SLore - SLrlde Access Cender"
69
1ab|e: wor|d_popu|anon
First Name
Last Name Country
City
Birthday
Table: humans
Gender
Scan Performance (6)
! AurlbuLe vecLor
slze = 91 G8
! ulcuonary slze
= 700 M8
! 1able slze = 92 G8
! Compresslon
facLor = 17
Column SLore - LayouL
70
1ab|e: wor|d_popu|anon
First Name
Last Name Country
City
Birthday
Table: humans
Data
not loaded
Data loaded
and used
Data loaded
but not used
Gender
Scan Performance (7)
Column SLore - lull Column Scan Cender"
71
1ab|e: wor|d_popu|anon
! Slze of aurlbuLe
vecLor Cender":
8 bllllon Luples
1 blL per Luple
= 1 G8
! Scan Lhrough
column wlLh
2M8/ms/core
! 0.S s wlLh 1 core
First Name
Last Name Country
City
Birthday
Table: humans
Data
not loaded
Data loaded
and used
Data loaded
but not used
Gender
Scan Performance (8)
! Slze of aurlbuLe
vecLor 8lrLhday":
8 bllllon Luples
2 byLe per Luple
= 16 G8
! Scan Lhrough
column wlLh
2M8/ms/core
! 8 s wlLh 1 core
Column SLore - lull Column Scan 8lrLhday"
72
1ab|e: wor|d_popu|anon


Pow many women, how many men?


Scan Performance
Summary
Row Store
Column Store
Full table scan Stride access
Time in seconds 800 256 0.5
Factors compared
to best in class
1,600 512 1
73
Learning Map
Ioundanons for a
New Lnterpr|se
App||canon
Deve|opment Lra
Ioundanons of
Database Storage
1echn|ques
1he Iuture of
Lnterpr|se
Compunng
Advanced
Database
Storage
1ech-
n|ques
In-Memory
Database
Cperators
Tuple Reconstruction


Dr.-Ing. Jrgen Mller
Tuple Reconstruction (1)
! All aurlbuLes
are sLored
consecuuvely
! 200 byLe ! 4 cache
accesses a 64 byLe
! 2S6 byte
! 8ead wlLh
2M8/ms/core
! = 0.128 s
wlLh 1 core

Accesslng a record ln a row sLore
76
1able: world_populauon
Tuple Reconstruction (2)
! All aurlbuLes are
sLored ln separaLe
columns
! lmpllclL record lus
are used Lo
reconsLrucL rows

77
vlrLual record lus
1able: world_populauon
Tuple Reconstruction (3)
! 1 cache access for
each aurlbuLe
! 6 cache accesses
a 64 byLe
! 384 byte
! 8ead wlLh
2M8/ms/core
! = 0.192 s
wlLh 1 core
78
vlrLual record lus
1able: world_populauon
Learning Map
Ioundanons for a
New Lnterpr|se
App||canon
Deve|opment Lra
Ioundanons of
Database Storage
1echn|ques
1he Iuture of
Lnterpr|se
Compunng
Advanced
Database
Storage
1ech-
n|ques
In-Memory
Database
Cperators
Select


Dr.-Ing. Jrgen Mller
SELECT Example
SELECT fname, lname FROM world_population
WHERE country=Italy and gender=m
|d fname |name country gender
2394 Clanlulgl 8uon lLaly m
3010 Lena Cercke Cermany f
3040 Marlo 8aloLelll lLaly m
3949 Manuel neuer Cermany m
4902 Lukas odolskl Cermany m
20102 klaas-!an PunLelaar neLherlands m
81
Query Plan
! redlcaLes are evaluaLed and generaLe posluon llsLs
! lnLermedlaLe posluon llsLs are loglcally comblned
! llnal posluon llsL ls used for maLerlallzauon
82
country = "Italy" gender = "m"
fname,
lname
position
list
position
list
positional
AND
!
Query Execution
os|non
0
2
os|non
0
2
3
4
3
os|non
0
2
country = 3 ("Ita|y")
gender = 1 ("m")
AND
Va|ueID D|cnonary
for "country"
0 Algerla
1 lrance
2 Cermany
3 lLaly
4 neLherlands
.
Va|ueI
D
D|cnonary
for "gender"
0 f
1 m
|d fname |name country gender
2394 Clanlulgl 8uon 3 1
3010 Lena Cercke 2 0
3040 Marlo 8aloLelll 3 1
3949 Manuel neuer 2 1
4902 Lukas odolskl 2 1
20102 klaas-!an PunLelaar 4 1
83

Vous aimerez peut-être aussi