Date post: | 26-May-2015 |
Category: |
Technology |
Upload: | itproceed |
View: | 202 times |
Download: | 4 times |
In Memory OLTP
SQL server 2014 Hekaton Engine
Frederik Bogaerts
Give me more
NSLOOKUP 127.0.0.0
Hekaton in a nutshell
Please ExplainWhy Demo
So long …
Hekaton – In Memory OLTPHash
Indexes
Memory Optimiz
ed Tables
Range Indexe
s
Latch-free
Hekaton Engine
Source: Microsoft.com
Prepare your databaseCreate Database Add memory optimized filegroup Add file to filegroup
Memory Optimized TablesCREATE TABLE [Customer]( [CustomerID] INT NOT NULL
PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = 1000000),
[Name] NVARCHAR(250) NOT NULL, [CustomerSince] DATETIME NULL
INDEX [ICustomerSince] NONCLUSTERED)WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA);
Limitations No DML
no LOBs, no XML and no CLR data types
No Foreign Key or Check constraints
No UNIQUE indexes other than PK
Max 8 indexes
Data Structures
New Row Format
Versioning : Timestamps
No data page
containers
Row header Payload (table columns)
Begin Ts End Ts StmtId IdxLinkCount
8 bytes 8 bytes 4 bytes 2 + 2 (padding) bytes
8 bytes * (IdxLinkCount)
Source: Microsoft.com
Indexes
Buckets
Point Lookups
HashRange Scanning
BW-Tree
Non Clustered
Hash Indexes
Source: Microsoft.com
Range Indexes
Source: Microsoft.com
Natively Compiled Procs CREATE PROCEDURE [dbo].[InsertOrder] @id INT, @date DATETIME WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNERAS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'us_english')
-- insert T-SQL hereEND
LimitationsOnly In MEM tables
No OUTER JOIN, no DISTINCT no OR, no subqueries, no CASE
Limited built-in functions
BUT: Fastest way!
Good news : Interface will be expanded in next version
T-SQL (Not) Supported
INTEROP
Truncate
Dynamic en keyset cursors
Cross database
Linked servers
Locking Hints – Isolation Levels
Merge
Garbage Collection
Multi Versioning Stale Rows Scans slow Bloathing memory
DiagnosticsAll starting with sys.dm_db_xtpDMO
• sys.dm_db_xtp_checkpoint_files• sys.dm_db_xtp_table_memory_stats• Sys.dm_db_xtp_index_stats
XEvents• From SYS.dm_xe_objects O JOIN SYS.dm.xe_packages P on O.package_guid = P.guid where P.name = ‘XtpEngine’
Perfomance Counters• From sys.dm_os_performance_counters where object_name like ‘XTP%’
Keep In MindData in memory at all times
Still using log files
Do not exceed 256 GB of InMem table
Going For Gold
Please ExplainWhy Demo
Follow Technet Belgium@technetbelux
Subscribe to the TechNet newsletteraka.ms/benews
Be the first to know
A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?
The SQL query found the table by doing a full scan of the other tables…
In the meanwhile, the waitress arrived at the table. Woohoow what a nice view…
Thank You!
Belgium’s biggest IT PRO Conference