Professional Documents
Culture Documents
of Sql Server
Paul
Larson,
Microso/
Research
Query engine
Buffer pool
Source: www.jcmit.com/memoryprice.htm
1000000
100000
10000
1000
100
10
10
8
6
4
2
0
2004
2005
2006
2007
2008
2009
Year of introducZon
1
1990
1995
2000
2005
2010
Mainstream
High end
OLTP
Mixed
DW
4
2
SQL 7.0
SQL 2K
SQL
2K5
Paul
Larson,
Nov
2013
SQL
2K8
4
SQL Server
Main-memory DBMSs
Column stores
Hekaton
SQL Server
Apollo
Hekaton
Main-memory
database
engine
integrated
into
SQL
Server
Targeted
for
OLTP
workloads
IniZal
version
in
SQL
2014
C1
C2
C3
C4
10
Dictionary
Segment
Blobs
Encode,
compress
Directory
Encode,
compress
Encode,
compress
11
Update mechanisms
Delete
b itmap
(B-tree)
Row
Group
Row
Group
Delete
bitmap
Row
Group
B-tree
on
disk
Bitmap
in
memory
Delta
stores
Up
to
1M
rows/store
Created
as
needed
Tuple
mover
Delta
Store
Delta
Store
(B-tree)
(B-tree)
Tuple
mover
Paul
Larson,
Nov
2013
12
So does it pay o?
Index
compression
raZo
highly
data
dependent
Regular:
2.2X
23X;
archival:
3.6X
70X
MS People
Belgacom
13
14
Current status
SQL
Server
2012
Secondary
index
only,
not
updateable
15
16
Multi-version optimistic
concurrency control
with full ACID support
Core engine using
lock-free algorithms
No lock manager,
latches or spinlocks
Steadily declining
memory price
T-SQL Compiled to
Machine Code
T-SQL compiled to
machine code via C
code generator and
VC
Invoking a procedure
is just a DLL entrypoint
Aggressive
optimizations @
compile-time
Many-core
processors
Hardware trends
Integrated into
SQL Server
TCO
Business Driver
17
18
19
200,
90,150
Name
John
Susan
City
Beijing
100,
200
Beijing
50,
70, 90
Row format
John
Paris
Jane
Prague
Range
index
on
City
BW-
tree
J
S
Chain ptrs
Susan Brussels
20
MulZversioning
Pro:
readers
do
not
interfere
with
updaters
Con:
more
work
to
create
and
clean
out
versions
OpZmisZc
Pro:
no
overhead
for
locking,
no
waiZng
on
locks
Pro:
highly
parallelizable
Con:
overhead
for
validaZon
Con:
more
frequent
aborts
than
for
locking
21
Txn
phases
Get
txn
start
Zmestamp,
set
state
to
AcZve
Begin
Normal
processing
Precommit
ValidaZon
Commit
Post-
processing
Terminat
e
22
TransacAon validaAon
Read
stability
Check
that
each
version
read
is
sZll
visible
as
of
the
end
of
the
transacZon
Phantom
avoidance
Repeat
each
scan
checking
whether
new
versions
have
become
visible
since
the
transacZon
began
no
validaZon
required
read
stability
read
stability,
phantom
avoidance
23
Non-blocking execuAon
Goal:
enable
highly
concurrent
execuZon
no
thread
switching,
waiZng,
or
spinning
during
execuZon
of
a
transacZon
24
Throughput (tx/sec)
3.5
MV/O
1V/L
3.0
2.5
2.0
5X
1.5
1.0
0.5
0.0
0
12
18
#
Threads
24
25
26
Hekaton
Metadata
Query optim.
Compiler
Metadata
Query interop
Query optimizer
Query processor
Storage
Transactions
High availability
Runtime
Storage
engine
Storage, log
27
28
Transac9on object
Old
versions
100
150
Bob
Write
set
Txn
ID:
250
50
150
$250
Alice
$150
New
versions
150
Bob
$200
150
$200
Alice
Can
discard
the
old
versions
as
soon
as
the
read
Zme
of
the
oldest
acZve
transacZon
is
over
150
Old
versions
easily
found
use
pointers
in
write
set
Two
steps:
unhook
version
from
all
indexes,
release
record
slot
Paul
Larson,
Nov
2013
29
30
31
Speedup
10.8X
18.4X
18.1X
18.9X
20.4X
32
Speedup
0.045
0.059
0.260
1.50
14.4
20.2X
23.4X
31.4X
27.9X
30.5X
33
System
throughput
40,000
35,000
25,000
20,000
15,000
10,000
5,000
-
Number
of
cores
SQL
with
contention
Throughput improvements
30,000
10
12
984
1,363
1,645
1,876
2,118
2,312
1,153
2,157
3,161
4,211
5,093
5,834
Interop
1,518
2,936
4,273
5,459
6,701
7,709
Native
7,078
13,892
20,919
26,721
32,507
36,375
34
35
Status
Hekaton
will
ship
in
SQL
Server
2014
SQL
Server
2014
to
be
released
early
in
2014
Second
public
beta
(CTP2)
available
now
36
37