Download presentation
Presentation is loading. Please wait.
1
SQL Server “In-Memory”
Faster Daddy, make it go faster!!! Presented by Pat Phelan @YetAnotherSQL on Twitter, or
2
SQL Server “In-Memory” Introduction
This presentation was created for a specific question, at a specific PASS Local Group meeting. I’ve taken the liberty of making it more general purpose in the hope of being able to re-present it later! The specific question was “How do you use SQL Server In-Memory databases?” The format for this presentation will be: Basics – What slows SQL Server down Details – Why does SQL Server slow down, how to you speed it back up Questions and Answers
3
Fire: A diversion to make a point
We usually understand and use fire safely Fire can be a great tool Fire can help us make great food Fire can help us stay warm Risks, benefits, understanding
4
We need to pay attention to fire
Fire can get out of hand We must pay attention to safety You must understand your fire Know what is fuel Know the oxidizer source(s) Know the heat
5
If we don’t know what we’re doing
Fighting fire you don’t understand is DANGEROUS! Using the wrong techniques can cause serious damage. Fire can get out of control Fire can hurt us Fire can ruin dinner!!!
6
SQL Server Speed Issues
Latches Locks Blocks This kind of touches on Deadlocks I/O
7
SQL Server Speed Issues - Latches
Latches ensure memory consistency Very short duration Only held within engine Latches released before control leaves engine Each latch only protects one page of RAM GAM and SGAM latches
8
SQL Server Speed Issues - Locks
Locks ensure logical transaction consistency Usually user or application defined Locks can be row, table, or database level Locks can be held until spid or SQL Server restarts!!!
9
SQL Server Speed Issues - Blocks
One process has a latch or lock that another process needs Usually fixed by code change (application developer) Usually fixed by timers Manually fixed by Administrator “Killing” blocking process
10
SQL Server Deadlocks Process 1 locks object A Process 2 locks object B
Other “stuff” might happen here Process 2 locks object B Process 1 attempts to lock object B, causing block Process 2 attempts to lock object A, causing deadlock A process (usually A or B) will die
11
SQL Server Speed Issues – I/O
Page (usually extent) I/O Write Read Usually fixed by faster storage media Hybrid disk Like memory cache Front end existing storage with faster storage Flash disk RAM disk
12
SQL Server “In-Memory” Tables
Code-named Hekaton First public discussion at PASS Summit 2012 From the Greek “Heca-” prefix meaning hundreds “-ton” suffix meaning engine or tool Hekaton’s goal is to allow up to 100 times “standard speed” Compatible applications usually see times improvement with no code changes.
13
SQL Server “In-Memory”
Hekaton: Is it another database engine I see Hekaton as a separate database engine used by SQL Server Microsoft considers Hekaton to be part of SQL Server Microsoft also considers Columnstore to be part of the SQL Data Engine
14
SQL Server “In-Memory” design goals
Completely new design Bw-Tree Bw-Trees need an hour on its own! Optimized for In-Memory use Writes are buffered to disk to preserve ACID compliance Latch free design Minimal or no locking MVCC (Multi-Version Concurrency Control) Readers and writers never block each other! Optimistic concurrency used by the engine
15
“In-Memory” Application Migration
Commercial applications designed for In-Memory User developed applications designed for In-Memory Applications using only Microsoft libraries for databases Applications where you have source code
16
In-Memory” Unsupported DDL
Datetimeoffset Geography Geometry Heirarchyid Rowversion XML SQL_Variant Any user defined data type
17
“In-Memory” Unsupported DDL
LOBs Text, BLOB, NTEXT VARCHAR(max), NVARCHAR(max) supported in SQL 2016 and later IDENTITY(1, 1) supported, but there are some restrictions Foreign Keys Check Constraints No schema changes Removing or changing index requires droping tables Some ALTER TABLE and sp_rename allowed in SQL 2016+, none in 2014
18
“In-Memory” Unsupported DML
Data Compression Replication is limited Linked Servers MERGE FROM (source is supported) Unsupported Features (may work, but no support) MS-DTC PBM (Policy Based Management) MERGE INTO Triggers
19
“In-Memory” and “In Cloud”
Azure memory Amazon AWS Google Compute I can’t find a public web reference, but I know at least one case exists Private cloud providers
20
SQL Server “In-Memory” databases
SSD offers “in Flash Memory” databases Pure Storage SIOS HPE Nimble (again part of HP) EMC Xtreme IO NetApp
21
SQL Server “In-Memory” databases
Actual RAM Disk products MS-DOS and PC-DOS offered the VDISK.SYS device driver Imdisk Open Source, Free No option to buy support, use at your own risk! DataRAM 4 GB limit Personal version is free Primo RAMDisk is $30 for two licenses (as of )
22
Questions and Answers The only “dumb” questions are the ones that you don’t ask. In-Memory brings a whole different paradigm, you need to re-think!
23
SQL Server “In-Memory”
Pat is a Database Architect and Mentor at Involta, LLC. SQL Saturday Iowa 2018 Iowa City, IA 23 June 2018 Pat Phelan
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.