Memory-Optimized Tables Querying at the speed of light.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

new database engine component fully integrated into SQL Server 2014 optimized for OLTP workloads accessing memory resident data achive improvements.
| Basel SQL Server 2014: In- Memory OLTP Stéphane Haby - Stéphane Savorgnano Consultant dbi services.
Big Data Working with Terabytes in SQL Server Andrew Novick
Meanwhile RAM cost continues to drop Moore’s Law on total CPU processing power holds but in parallel processing… CPU clock rate stalled… Because.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
DBMS Transactions and Rollback Recovery Helia / Martti Laiho.
MySQL. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The main subsystems in MySQL architecture The different storage.
Architecture Rajesh. Components of Database Engine.
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
Transactions and Locks A Quick Reference and Summary BIT 275.
Meet Kevin Liu Principal Lead Program Manager Kevin Liu has been with Microsoft and the SQL Server engine team for 7 years, working on key projects like.
Ἑ κατόν by Niko Neugebauer. Niko Neugebauer PASS EvangelistPASS Evangelist SQL Server MVPSQL Server MVP SQLPort ( founder & leaderSQLPort.
Moore’s Law means more transistors and therefore cores, but… CPU clock rate stalled… Meanwhile RAM cost continues to drop.
SQL Server 2005 Engine Optimistic Concurrency Tony Rogerson, SQL Server MVP Independent Consultant 26 th.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
DMBS Internals I February 24 th, What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the.
Deadlocks 3.0. Final Edition. Everything that developer needs to know Denis Reznik Microsoft SQL Server MVP Director of R&D at Intapp Kyiv.
In-Memory OLTP The faster is now simpler in SQL Server 2016.
Vedran Kesegić. About me  M.Sc., FER, Zagreb  HRPro d.o.o. Before: Vipnet, FER  13+ years with SQL Server (since SQL 2000)  Microsoft Certified.
Does the Optimistic Concurrency resolve your blocking problems Margarita Naumova, SQL Master Academy.
Configuring SQL Server for a successful SharePoint Server Deployment Haaron Gonzalez Solution Architect & Consultant Microsoft MVP SharePoint Server
Doing fast! Optimizing Query performance with ColumnStore Indexes in SQL Server 2012 Margarita Naumova | SQL Master Academy.
Best Practices for Columnstore Indexes Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Session Name Pelin ATICI SQL Premier Field Engineer.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Use Cases for In-Memory OLTP Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Data, Space and Transaction Processing
In-Memory Capabilities
Inside transaction logging
Temporal Databases Microsoft SQL Server 2016
Thank You! #sqlsatdnipro Denis
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
Lecture 16: Data Storage Wednesday, November 6, 2006.
Database Management Systems (CS 564)
UFC #1433 In-Memory tables 2014 vs 2016
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Taking your application to memory
Chapter Overview Understanding the Database Architecture
Introduction to SQL Server Management for the Non-DBA
Hustle and Bustle of SQL Pages
Graeme Malcolm | Data Technology Specialist, Content Master
මොඩියුල විශ්ලේෂණය Buffer Pool Extension භාවිතය.
Database Administration for the Non-DBA
Introduction to Execution Plans
Introducing the SQL Server 2016 Query Store
Introducing the SQL Server 2016 Query Store
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
The Vocabulary of Performance Tuning
Taking your application to memory
Please support our sponsors
In-Memory OLTP (IMOLTP) What Can It Do For Me?
Real world In-Memory OLTP
SQL 2014 In-Memory OLTP What, Why, and How
SQL Server 2014 Hidden Treasures Denis Reznik Microsoft SQL Server MVP
Hidden Gems of SQL Server 2014
Inside transaction logging
Entity Framework from a database perspective
In Memory OLTP Not Just for OLTP.
Statistics for beginners – In-Memory OLTP
In-Memory OLTP for Database Developers
The Vocabulary of Performance Tuning
Hidden Gems of SQL Server 2014
Let Me Finish... Isolating Write Operations
Hidden Gems of SQL Server 2014
In Memory OLTP Not Just for OLTP.
SQL Server 2016 In-Memory OLTP for the DBA
Hidden Gems of SQL Server 2014
The Vocabulary of Performance Tuning
Hybrid Buffer Pool The Good, the Bad and the Ugly
Presentation transcript:

Memory-Optimized Tables Querying at the speed of light

Sponsors Gold Sponsors: Bronze Sponsors: Swag Sponsors:

About me  Enrico van de Laar  Microsoft SQL Server MVP  Database Technology Specialist  Blogger  Author 3

Agenda  Introduction to In-Memory OLTP  Limitations  Memory Optimization Advisor  Memory-Optimized Table Theory  Creating Memory-Optimized Tables  Hash Indexes 4 |

Introduction to In-Memory OLTP  Released in SQL Server 2014  A.k.a. Hekaton  Enterprise only feature 5 | “ The actual performance gain depends on many factors, but 5-to-20 times performance improvements are common.” - Microsoft

Introduction to In-Memory OLTP  What to we need for this feature of awesomeness? 6 | o Windows Server 2008R2 o 1GB RAM o 811MB free space (Database Engine only) o 64-bit o Enterprise / Developer Edition Minimum Specs In-Memory tables o +/- 2 times memory size of expected In- Memory table size o +/- 2 times disk space of expected In- Memory table size o And don’t forget memory for the Buffer Cache to handle ‘traditional’ tables 4 8*4GB In-Memory Table 4GB Buffer Cache

Introduction to In-Memory OLTP  How do we get it? 7 |

(a couple) Limitations 8 | Feature / Data TypeSQL Server 2014 ParallelismNot supported Clustered IndexesNope Foreign KeysNegative Check ConstraintsCan’t do that TriggersNope ALTER TABLEEeeuh…no (DROP + CREATE) CompressionNo LOB Data TypesNope Columnstore IndexesNot Supported Table Size256GB SQL Server 2016 Supported Partially Partially (through REBUILD) Propably Supported 2TB

Memory Optimization Advisor  Memory Optimization Advisor can help you convert ‘traditional’ tables to In-Memory tables 9 | [ DEMO ]

Memory-Optimized Table Theory 10 |

Memory-Optimized Table Theory  Reads and writes to In-Memory tables occur directly in the memory of your SQL Server Instance  Sounds scary? Don’t worry, In-Memory tables are fully durable (if you want them to)  There are some changes to transaction logging though: 11 | o Log records are generated when commit process begins o Changes to In-Memory indexes are not logged o Multiple changes will get grouped into one (large) log record

Memory-Optimized Table Theory 12 | How is this durability achieved?  Memory-Optimized table data is stored in two files, a Data and Delta file o Data file contains rows of one or more Memory- Optimized tables o Delta file tracks deletes in the Data file CFP  Data and Delta files are saved inside a seperate, Memory-Optimized, Filegroup

Memory-Optimized Table Theory 13 | Let’s take a closer look at the Data file  Characteristics: o No page structure like ‘traditional’ tables o Sequential access instead of random o Multiple Memory-Optimized tables can access one Data file row 1 row 2 row 3 Table 1 Table 2 Data file transactions

Memory-Optimized Table Theory Let’s take a closer look at the Data file  Data files have a maximum size of 128MB when there is more than 16GB RAM inside the server, 16MB when there is less then 16GB  Whenever a Data file is full, a new one is created together with a Delta file  Data and Delta files use transaction commit timestamps to keep track of the transactions inside the files 14 |

Memory-Optimized Table Theory 15 | Let’s take a closer look at the Data file Data file Delta file CFP 0 ∞ Data file Delta file CFP 101 ∞ 100

Memory-Optimized Table Theory 16 | What about those Delta files?  Delta files track rows that were deleted from the Data file, they are not directly removed from the Data file!  Eventually, rows that are marked as deleted in the Delta file will be removed from the Data file using a CFP Merge operation

Memory-Optimized Table Theory 17 | Source:

Memory-Optimized Table Theory  In-Memory OLTP uses Snapshot-Based Transaction Isolation with Optimistic Concurrency control  This removes the need of locks and latches to protect transactions  Row versions are stored and maintained inside the Data files instead of TempDB 18 |

Memory-Optimized Table Theory 19 |

Creating Memory-Optimized Tables 20 | [ DEMO ]

Hash Indexes  Indexes on Memory-Optimized tables need to be created in the CREATE TABLE statement  Indexes are not persisted on disk  Fragmentation does not matter for Memory- Optimized indexes  Memory-Optimized index types: 21 | o Non-Clustered o Non-Clustered Hash

Hash Indexes  Hash indexes do no use pages to save their data  Rows are stored in buckets  The bucket amount needs to be specified when creating the table  General guideline for bucket amount: 1-2 times number of distinct values for index key 22 |

Hash Indexes So how do they work?  Hash Indexes use a hash function to place a row inside a specific bucket 23 |

Hash Indexes 24 | Peter = 5 Jim = 3 Chris = 5

Hash Indexes 25 | Peter = 5 Jim = 3 Chris = 5

The End 26 | End of Session

Sponsors Gold Sponsors: Bronze Sponsors: Swag Sponsors: