Pages 8K - SQLPort

Download Report

Transcript Pages 8K - SQLPort

ἑκατόν
by Niko Neugebauer
Niko Neugebauer
• PASS Evangelist
• SQL Server MVP
• SQLPort (http://www.sqlport.com) founder & leader
• BITuga (http://www.bituga.pt) co-founder
• 15+ years in IT
HeKATON
HEK-A-TON, HEK-A-TON, HEK-A-TON
HekAton
• ἑκατόν – means 100 in Greek
• Targeted to improve OLTP performance, 100 Times
Conceptionally?
• Imagine that you have a number of CPU steps to
perform a typical OLTP action
• Optimize it 100 times by removing obstacles like
latches and parallelize it
• Yes, you will need start from the bottom and from the
very beginning?
Hardware Trends
• Look at the CPU speed increase
• Look at the Memory Prices
• You can’t buy a SQL Server Enterprise License for a
price of a TB
• Think, think, think 
New generation DB
Hekaton
History
Sybase SQL Server 1.0
SQL Server 11.0
• 1980 (1989)
• 2012
• Hardware Expensive
• Hardware Cheap
• CPU Bound
• IO & Memory Bound
• Pages 8K
• Pages 8K
Hekaton
• In-Memory Database
• Multi-Core Awareness and Optimizations
• xVelocity compression algorithm (hint: ColumnStore)
• No Pages (no more splits, allocations, etc)
• No Locks, No Latches + different Concurrency Control
• StreamInsight (no more 8K’s)
• Hash Index (no more b-trees)
• Existing T-SQL can be reused
Hekaton
• Highly scalable concurrency control mechanism
• Lock-free data structures
Hekaton
• ACID compliant
• Optimized for extreme Transaction Processing
scenarios like
• Financial Services
• Online Gambling
• There are customers who are using it NOW
Integrated into the
DataBase Engine
Hekaton
Particular Features
• Snapshot_Isolation ONLY
• No support for LOB data types
• No Triggers
• AlwaysOn Support
features
• Durable Tables
• Non-Durable Tables
• TempDB is used inside of the Hekaton, in-memory
• Shares memory with Buffer Pool, but has its own space
Architecture
• Different space allocation for memory buffer
• The very same transaction log, but with fewer writes
• Different filegroups
• Different treatment for Indexes
• A lot of new, different stuff 
HEKATON
It actually looks like a …
Programability
• Create table dbo.Hekaton(
• Id int primary key hash with (bucketcount = 65535),
• Nome varchar(50)
) WITH (MEMORY_OPTIMIZED = ON, DURABILITY
= SCHEMA_AND_DATA );
GO
T-SQL
Stored Procs:
• Uses C as internal intermediate presentation, and then
compiles into native code
• Atomic blocks
• Can’t reference non-hekaton tables
T-SQL Programability
• Create procedure dbo.HekatonNow
• WITH NATIVE_COMPILATION
BEGIN
select name from dbo.Hekaton;
END
GO
Details
• Uses StreamInsight
• No actual updates, but deletes & inserts
UTils
• Migration from the normal DB tables to Hekaton
• Stored Procedures Migration to Hekaton
WHEN ?
Next major version of SQL Server
BUT
• Isn’t it too fast ?
• – No, there is no such concept as too fast. (as long as it
does not create other problems)
Thank you