In-Memory OLTP The faster is now simpler in SQL Server 2016.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
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
6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.
SQL Server 2014 – Features Drilldown Tara Shankar Jana Senior Premier Field Engineer (Microsoft)
Dandy Weyn Sr. Technical Product Mkt.
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
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.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Preview of Oracle Database 12 c In-Memory Option Thomas Kyte
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
MySQL. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The main subsystems in MySQL architecture The different storage.
SQL Server 2014: In In-memory OLTP for Database Developers.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server.
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
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.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
Moore’s Law means more transistors and therefore cores, but… CPU clock rate stalled… Meanwhile RAM cost continues to drop.
Sofia Event Center November 2013 Margarita Naumova SQL Master Academy.
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.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
How to kill SQL Server Performance Håkan Winther.
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.
What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently and safely. Provide.
UNIQUE AND NOT DULLwww.MyGareth.com. UNIQUE AND NOT DULLwww.MyGareth.com Agenda New Features in SQL Server 2016  About me  General Enhancements  In-memory.
SQL Server 2014: In-Memory OLTP Adoption Considerations Mike
Retele de senzori Curs 1 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
Redmond Protocols Plugfest 2016 Jos de Bruijn, Borko Novakovic SQL In-Memory OLTP Senior Program Manager.
Oracle Announced New In- Memory Database G1 Emre Eftelioglu, Fen Liu [09/27/13] 1 [1]
Oracle Database Architectural Components
Session Name Pelin ATICI SQL Premier Field Engineer.
New BI Features SQL 2016 New features of SQL 2016.
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.
Memory-Optimized Tables Querying at the speed of light.
In-Memory Capabilities
Temporal Databases Microsoft SQL Server 2016
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
In-Memory Optimization (OLTP) enhancements overview
CS422 Principles of Database Systems Course Overview
Lecture 16: Data Storage Wednesday, November 6, 2006.
SQL Server 2000 and Access 2000 limits
UFC #1433 In-Memory tables 2014 vs 2016
Taking your application to memory
TechEd /6/2018 7:34 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
SQL Server 2014 In-Memory Overview
Lecture 11: DMBS Internals
මොඩියුල විශ්ලේෂණය Buffer Pool Extension භාවිතය.
Upgrading to Microsoft SQL Server 2014
Taking your application to memory
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
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
Database System Architecture
In Memory OLTP Not Just for OLTP.
In-Memory OLTP for Database Developers
In Memory OLTP Not Just for OLTP.
Presentation transcript:

In-Memory OLTP The faster is now simpler in SQL Server 2016

Our Main Sponsors:

Say Thank you to Volunteers:  They spend their FREE time to give you this event.  Because they are crazy.  Because they want YOU to learn from the BEST IN THE WORLD.

Paulo Matos:

Pedro Simões:

André Batista:

Paulo Borges:

André Melancia:

Murilo Miranda:

Quilson Antunes:

About me Murilo Miranda Lead Database The Pythian

Agenda  Introduction to In-Memory OLTP  Motivation  Overview  Limitations  Current version  SQL Server 2016  In-Memory OLTP improvements

INTRODUCTION In-Memory OLTP

In-Memory OLTP - Motivation HARDWARE EVOLUTION CHANGED

In-Memory OLTP - Motivation  Memory price is being cheaper from year-to- year.  Low price per GB.  Large memory modules are affordable.  DDR4 on Q2/2014.  Higher module density.  Lower voltage requirements.  Higher data rate transfer

In-Memory OLTP - Motivation SQL 2005 SQL 2008 R2 SQL 2008 SQL 2012 SQL 2014 SQL 2000

In-Memory OLTP - Motivation  CPU Clock speed  Problems caused by higher speeds  Excessive power consumption  Heat dissipation  Leakage current  Power consumption is critical for mobile devices.  Mobile computing platforms are increasingly important.

In-Memory OLTP - Motivation

 Industry Solution  Multi-Cores Processors  Hyper-threading  Lx Cache

In-Memory OLTP - Motivation have limitations DB Systems TRADITIONAL

Problems to solve  Concurrency.  CPU usage is inefficient in simultaneous access to shared structures.  Pessimistic model causes too much contention for high levels of concurrency (locking and latching).  Transaction Log has a lot of overhead.  SQL Server use a write-ahead logging (WAL) protocol.  Log records might be generated before commit time.  Index changes are logged.

Overview of (no) latching T1 T2 CONCURRENT INSERT 1) QUERY THE DATAPAGE HEADER 2) WRITE THE DATA RECORD 3) UPDATE HEADER (…) 1) QUERY THE DATAPAGE HEADER 2) WRITE THE DATA RECORD 3) UPDATE HEADER (…) MSSQL Data Page Header Data Record 1 Data Record 2 Data Record 3 INSERT RECORD 3 STEP OPERATION 1) QUERY THE DATAPAGE HEADER 2) WRITE THE DATA RECORD 3) UPDATE HEADER (…) Header (1) Header (2)

Overview of latching T1 T2 CONCURRENT INSERT 1) Take Page_Latch_EX 2) QUERY THE DATAPAGE HEADER 3) WRITE THE DATA RECORD 4) UPDATE HEADER (…) 5) Release page_Latch 1) Blocked by page latch 2) Take Page_Latch_EX 3) QUERY THE DATAPAGE HEADER 4) WRITE THE DATA RECORD 5) UPDATE HEADER (…) 6) Release page_Latch MSSQL Data Page Data Record 1 Data Record 2 Data Record 3 Header (1) Header (2) Header (3)

Introduction to InMemory OLTP  Where we are spending more execution time?  Here are the results from Microsoft analysis. I/O, Thread Management Storage EngineRelational Engine Communicatio n Stack 10% 80%10% Access Methods, Transaction, Lock, Log, Managers T-SQL Interpreter, Query Execution, Expressions

Introduction to In-Memory OLTP  Hekaton Project - Greek word ἑ κατόν (Houndred).  The objective is to improve 100x the performance.  Traditional strategy relies in structures focused on data stored in disk.  By fully using memory capabilities we can have simpler structures.  Available from SQL Server  Highly improved on SQL Server 2016.

Why Hekaton is faster?  Memory is way faster then storage.  Even SSD!

Why Hekaton is faster?  Eliminate locks and latching.  Optimistic model.

Why Hekaton is faster?  New structures.  We already use memory for traditional model.

Why Hekaton is faster?  Compiled objects.  All the steps to interpret code are avoided.

Architecture Client Application Tabular Data Stream (TDS) Handler / Session Management T-SQL Execution Buffer Pool for Tables and Indexes Parser, Catalog and Optimizer InMemory Native Compiler Storage Engine for Memory Optimized Tables and Indexes Native Compiled Stored Procedures and Schema Sqlserv.exe Memory Optimized Table Filegroup Transaction Log Data Filegroup Generated DLL InMemory Component Existing SQL Component Checkpoint Files / Recovery Query interoperability

Hybrid Engine  Integrated queries & transactions.  Integrated HA and backup/restore.  Same database can have in-memory and on- disk.  Same manageability, administration & development experience.

Limitations  Enterprise only.  Total size for durable tables: 256 Gb.  Removal of In-Memory FG not allowed.  No table/index changes.  Row size limit is 8060 bytes.  A bunch of not supported T-SQL.   Good compilation:

IMPROVEMENTS SQL Server 2016

Size of In-Memory Tables  SQL Server 2014 Size of durable tables in a database <= 256 GB  SQL Server 2016  Supports 2TB of durable tables in the database

Checkpoint Files Garbage Collection  SQL Server 2014  The Garbage Collector process is not efficient enough.  This may cause an excessive disk usage.

Checkpoint Files Garbage Collection  The “RAM memory” is a volatile kind of “data storage”.  How DURABLE tables keep the data safe?  Data is saved into checkpoint files.  During recovery - checkpoint files are applied and remaining portion is applied from transaction log.  Checkpoint Files ≠ Checkpoint operation.

Checkpoint Files Garbage Collection  Checkpoint files:  A pair of DATA and DELTA special files.  Stored in a checkpoint container FG  Based on FILESTREAM. Memory Optimized Table Filegroup

Checkpoint Files  CFP Lifecycle DATA DELTA 0 ∞ TIME Only this part has valid data.

Checkpoint Files  Merge Process DATA DELTA TIMESTAMP TIMESTAMP DATA DELTA

Checkpoint Files  Merge Process DELTA DATA DELTA TIMESTAMP 2 30 TIMESTAMP TIMESTAMP TIMESTAMP TIMESTAMP DATA

Checkpoint Files  Merge Process DATA DELTA TIMESTAMP REDUCES USED SPACE BETTER RECOVERY New files with the valid data.

Checkpoint Files  Merge Process  The old files will remain in the disk  Garbage Collector is responsible to remove DATA DELTA TIMESTAMP TIMESTAMP DATA DELTA

Checkpoint Files Garbage Collection  SQL Server 2014  The Garbage Collector from Filestream is not efficient for this case.  SQL Server 2016  Storage management is decoupled from FileStream.  Unused file(s) can be re-used immediately after they are de-referenced from transaction log.

Security (TDE)  SQL Server 2014  No support for TDE.  You choose: Performance OR Security?  SQL Server 2016  Supports Transparent Data Encryption.  Now you have Performance AND Security

Storage Scaling  SQL Server 2014  Limited scaling: up to 2 socket / 64 cores.  The more cores, the more log records are created.  There’s only one “Offline Checkpoint” thread. Single Offline Checkpoint Thread Del Tran2 (TS 450) Del Tran3 (TS 250) Insert into Hekaton T1 Log in SQL Table Del Tran1 (TS150) SQL Transaction log disk To update DATA and DELTA files.

Storage Scaling  SQL Server 2016  No more limitation!  Now there are multiple “Offline Checkpoint” threads – one per container. Offline Checkpoint Thread Del Tran2 (TS 450) Del Tran3 (TS 250) Insert into Hekaton T1 Log in SQL Table Del Tran1 (TS150) SQL Transaction log disk Offline Checkpoint Thread

Development/Maintainability Challenge  SQL Server 2014  No modifications are allowed!  Tuning application/database.  Responding to shifting data patterns.  Application development/modification.  Agile/iterative development methods.  Need to be able to modify the database schema.

Development/Maintainability Challenge  SQL Server 2016  ALTER is now supported!!  ALTER PROC and sp_recompile supported  ALTER TABLE  add/alter/drop column/constraint  ALTER INDEX  Add/drop index supported  Change HASH index bucket_count through index REBUILD

Development/Maintainability Challenge  SQL Server 2016  There are still some limitations...  ALTER TABLE is an offline operation; requires 2X memory  sp_rename not yet supported

Report queried challenge  SQL Server 2014  Parallel plans are used for memory optimized tables.  Optimized for OLTP.  If you join a MOT with a columnstore it will use DOP=1.  You lose the benefit of columnstore.

Report queried challenge  SQL Server 2016  Parallel plans are now supported!  Now you can take the benefit of columnstore while joining with MOT.  Real-time analytics are now possible, in the speed of light!

Supported T-SQL  SQL Server 2016  Easier to convert existing applications!  Now supports:  {LEFT|RIGHT} OUTER JOIN  Disjunction (OR, NOT)  UNION [ALL]  SELECT DISTINCT  Subqueries (EXISTS, IN, scalar)  FOREIGN KEY  CHECK  UNIQUE constraints and indexes  Nested Stored procedures (EXECUTE)  Natively compiled scalar UDFs  Indexes on NULLable columns

Supported T-SQL  SQL Server 2016  Easier to convert existing applications!  Now supports:  DML Triggers are now supported.  AFTER triggers, natively compiled.

Migration/Manageability  SQL Server 2016  On SQL Server 2014 we had a collation limitation...  Now the full range of collations is supported.  Non-BIN2 collations in index key columns  Non-Latin code pages for (var)char columns  Non-BIN2 collations for comparison and sorting in native modules

Migration/Manageability  SQL Server 2016  Migration Assistent for Stored Procedure.  Best Practices Analyzer support.  Table Designer supporter in SSMS.

Thank you! Questions?