In Memory OLTP
SQL server 2014 Hekaton Engine
Frederik Bogaerts
Give me more
NSLOOKUP 127.0.0.0
Hekaton in a nutshell
Please
Explain
Why Demo
So long …
Hekaton – In Memory OLTP
Hekaton Engine
Source: Microsoft.com
Prepare your database
Create Database
Add memory optimized filegroup
Add file to filegroup
Memory Optimized Tables
CREATE TABLE [Customer](
[CustomerID] INT NOT NULL
PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUN...
Limitations
No DML
no LOBs, no XML and no CLR data types
No Foreign Key or Check constraints
No UNIQUE indexes other than ...
Data Structures
New Row
Format
Versioning :
Timestamps
No data
page
containers
Row header Payload (table columns)
Begin Ts...
Indexes
Buckets
Point
Lookups
Hash
Range
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,
SCHEMABINDIN...
Limitations
Only In MEM tables
No OUTER JOIN, no DISTINCT no OR, no subqueries, no CASE
Limited built-in functions
BUT:
Fa...
T-SQL (Not) Supported
INTEROP
Truncate
Dynamic en
keyset
cursors
Cross
database
Linked
servers
Locking
Hints –
Isolation
L...
Garbage Collection
Multi
Versioning
Stale
Rows
Scans
slow
Bloathing
memory
Diagnostics
All starting with sys.dm_db_xtpDMO
•sys.dm_db_xtp_checkpoint_files
•sys.dm_db_xtp_table_memory_stats
•Sys.dm_d...
Keep In Mind
Data in memory at all times
Still using log files
Do not exceed 256 GB of InMem table
Going For Gold
Please
Explain
Why Demo
Follow Technet Belgium
@technetbelux
Subscribe to the TechNet newsletter
aka.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 ta...
Thank You!
Belgium’s biggest IT PRO Conference
SQL Track: In Memory OLTP in SQL Server
Upcoming SlideShare
Loading in...5
×

SQL Track: In Memory OLTP in SQL Server

277

Published on

With SQL server 2014, Microsoft introduced In-Memory OLTP, codename Hekaton.

This technology contains revolutionary concepts for optimizing the performance of OLTP workloads via natively compiled stored procedures,memory optimized tables and much more.

This session will give you an overview of the different aspects of In-memory OLTP and how this is integrated in the SQL server engine.

By giving demo's we will show you what is (im)possible with this new feature and how this really can increase your database performance!

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
277
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • http://msdn.microsoft.com/en-us/library/dn720242.aspx
  • As always with new technology, there are new concepts introduced. Throughout my session I’ll talk about these topics one by one.

  • Kicks in after a couple of minutes.
  • There are also addons done to the SYS.tables, here we can check whether we are dealing with In memory tables and the durability level of the
  • SQL Track: In Memory OLTP in SQL Server

    1. 1. In Memory OLTP SQL server 2014 Hekaton Engine Frederik Bogaerts
    2. 2. Give me more
    3. 3. NSLOOKUP 127.0.0.0
    4. 4. Hekaton in a nutshell Please Explain Why Demo
    5. 5. So long …
    6. 6. Hekaton – In Memory OLTP
    7. 7. Hekaton Engine Source: Microsoft.com
    8. 8. Prepare your database Create Database Add memory optimized filegroup Add file to filegroup
    9. 9. Memory Optimized Tables CREATE 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);
    10. 10. 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
    11. 11. 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
    12. 12. Indexes Buckets Point Lookups Hash Range Scanning BW-Tree Non Clustered
    13. 13. Hash Indexes Source: Microsoft.com
    14. 14. Range Indexes Source: Microsoft.com
    15. 15. Natively Compiled Procs CREATE PROCEDURE [dbo].[InsertOrder] @id INT, @date DATETIME WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER AS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'us_english') -- insert T-SQL here END
    16. 16. Limitations Only 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
    17. 17. T-SQL (Not) Supported INTEROP Truncate Dynamic en keyset cursors Cross database Linked servers Locking Hints – Isolation Levels Merge
    18. 18. Garbage Collection Multi Versioning Stale Rows Scans slow Bloathing memory
    19. 19. Diagnostics All 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%’
    20. 20. Keep In Mind Data in memory at all times Still using log files Do not exceed 256 GB of InMem table
    21. 21. Going For Gold
    22. 22. Please Explain Why Demo
    23. 23. Follow Technet Belgium @technetbelux Subscribe to the TechNet newsletter aka.ms/benews Be the first to know
    24. 24. 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…
    25. 25. Thank You!
    26. 26. Belgium’s biggest IT PRO Conference
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×