Les Conférences Groupe des Utilisateurs SQL Server Juin 2013 – SQL Server in-memory Alexandre Chemla – Masao Frédéric Pichaut – Microsoft.

Slides:



Advertisements
Similar presentations
Phoenix We put the SQL back in NoSQL James Taylor Demos:
Advertisements

Examples of Physical Query Plan Alternatives
Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Understanding SQL Server Query Execution Plans
DAT 342 Advanced SQL Server Performance and Tuning Bren Newman Program Manager SQL Server Development Microsoft Corporation.
Introduction to SQL Tuning Brown Bag Three essential concepts.
Module 3: Creating and Tuning Indexes. Planning Indexes Creating Indexes Optimizing Indexes.
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
SQL Server performance tuning basics
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
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.
1. SQL Server 2014 In-Memory by Design Arthur Zubarev June 21, 2014.
In-Memory Technologies Enhanced High Availability New Hybrid Scenarios In-Memory OLTP 5-25x performance gain for OLTP integrated into SQL Server In-Memory.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Evaluation of Relational Operations Chapter 12, Part A.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
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)
Project “Hekaton” adds in-memory technology to boost performance of OLTP workloads in SQL Server.
Planning on attending PASS Summit 2014? The world’s largest gathering of SQL Server & BI professionals Take your SQL Server skills to the.
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.
MySQL. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The main subsystems in MySQL architecture The different storage.
Insert, Update & Delete Performance Joe Chang
SQL Server 2014: In In-memory OLTP for Database Developers.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server.
SQL Server 2014 adds in-memory technology to boost performance of OLTP workloads.
Parallel Execution Plans Joe Chang
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
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.
Buffer Pool Memory Optimized Tables Available Memory Buffer Pool Memory Optimized Tables Buffer Pool Memory Optimized Tables Buffer Pool Memory.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
Session 1 Module 1: Introduction to Data Integrity
Sofia Event Center November 2013 Margarita Naumova SQL Master Academy.
CS 440 Database Management Systems Lecture 6: Data storage & access methods 1.
CS 540 Database Management Systems
Table Structures and Indexing. The concept of indexing If you were asked to search for the name “Adam Wilbert” in a phonebook, you would go directly to.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
In-Memory OLTP The faster is now simpler in SQL Server 2016.
PASS Virtual Chapter presentation March 27, 2014.
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.
SQL Basics Review Reviewing what we’ve learned so far…….
SQL Server 2014: In-Memory OLTP Adoption Considerations Mike
Mladen Prajdić SQL Server MVP Hekaton The New SQL Server In-Memory OLTP Engine.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
In-Memory Capabilities
Module 11: File Structure
CS 540 Database Management Systems
In-Memory OLTP for DBA Management
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
UFC #1433 In-Memory tables 2014 vs 2016
7/17/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
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 In-Memory Internals
SQL Server 2014 In-Memory OLTP
SQL Server 2014 In-Memory Overview
මොඩියුල විශ්ලේෂණය Buffer Pool Extension භාවිතය.
Super Scaling The LMAX Queue Pattern.
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
Real world In-Memory OLTP
SQL 2014 In-Memory OLTP What, Why, and How
Physical Database Design
Selected Topics: External Sorting, Join Algorithms, …
1/3/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Microsoft Ignite /1/ :19 PM
Statistics for beginners – In-Memory OLTP
In-Memory OLTP for Database Developers
Presentation transcript:

Les Conférences Groupe des Utilisateurs SQL Server Juin 2013 – SQL Server in-memory Alexandre Chemla – Masao Frédéric Pichaut – Microsoft

Memory-optimized Table Filegroup Data Filegroup SQL Server.exe Hekaton Engine: Memory_optimized Tables & Indexes TDS Handler and Session Management Natively Compiled SPs and Schema Buffer Pool for Tables & Indexes Proc/Plan cache for ad-hoc T- SQL and SPs Client App Transaction Log Query Interop Non-durable Table T1 T4 T3 T2 T1 T4 T3 T2 T1 T4 T3 T2 T1 T4 T3 T2 Tables Indexes Interpreter for TSQL, query plans, expressions T1 T4 T3 T2 T1 T4 T3 T2 Checkpoint & Recovery Access Methods Parser, Catalog, Algebrizer, Optimizer Hekaton Compiler Hekaton Component Key Existing SQL Component Generated.dll

Memory-optimized Table Filegroup Data Filegroup SQL Server.exe Hekaton Engine for Memory_optimized Tables & Indexes TDS Handler and Session Management Natively Compiled SPs and Schema Buffer Pool for Tables & Indexes Proc/Plan cache for ad- hoc T-SQL and SPs Client App Transaction Log Query Interop Interpreter for TSQL, query plans, expressions Access Methods Parser, Catalog, Algebrizer, Optimizer Hekaton Compiler 10-30x more efficient Reduced log bandwidth & contention. Log latency remains Checkpoints are background sequential IO No improvements in communication stack, parameter passing, result set generation Hekaton Component Key Existing SQL Component Generated.dll

OperationFactor faster (slower) than regular SQL Comments InteropNative Select count(*) 1 (2.5)= No clustered index scan in Hekaton Hash Join 1 (1.3)N/A Uses index scan Nested-loop Join 1 4.0N/A Probes into hash index Single-row selects SP doing selects in loop Single-row selects Native compiled SP calls SQL’s rand() Single-row updates 1 N/A10 SP doing update in loop Bwin Session State6 Version M4 Expectation for OLTP workloads Advantage of pushing work to SPs Interop targets app migration, not perf (1) 1 million rows accessed in single query or SP

CREATE TABLE DDLTable code generatedCompiler invokedTable DLL producedTable DLL loaded

90,150 Susan Bogota 50, ∞ JanePrague 100, 200 JohnParis 200, ∞ JohnBeijing TimestampsNameChain ptrsCity Hash index on City B P Hash index on Name J S Garbage Collection Removes Unused Rows

Hekaton Memory Transaction log 237 | 001 | George | SEA 235 | 002 | Fred | CHI 237 | 001 | George | SEA 234 | 001 | George | LAX 235 | 002 | Fred | CHI 237 | 001 | George | SEA Checkpoint File Delta File 234 | 001 | 237 XID RowID Name(PK) Airport Create Delete XID RowID XID Del Add 235 | 002 | Fred | CHI 234 | 001 | George | LAX

T-SQL Compiled to Machine Code T-SQL compiled to machine code via C code generator and VC Invoking a procedure is just a DLL entry-point Aggressive compile-time Stalling CPU clock rate Hardware trends Efficient, business- logic processing Customer Benefits Hekaton Tech Pillars Drivers Native Compiled Stored Procedures Non-Native Compilation Performance High. Significantly less instructions to go through No different than T-SQL calls in SQL Server today Migration StrategyApplication changes – development overhead Easier app migration as can still access Memory Optimized (MO) tables Access to objectsCan only interact with Memory Optimized tables All Objects. Access for transactions across MO and b-tree tables Support for T-SQL Constructs Limited.T-SQL surface area (limit on MO interaction) Optimization/Stats and Query Plan Statistics utilized at CREATE -> Compile time Statistics updates can be utilized to modify plan at runtime FlexibilityLimited (e.g., no ALTER procedure, compile-time isolation level) Ad-hoc query patterns

TimeTransaction T1 (SNAPSHOT)Transaction T2 (SNAPSHOT) 1BEGIN 2 3UPDATE t SET c1=‘bla’ WHERE c2=123 4UPDATE t SET c1=‘bla’ WHERE c2=123 (write conflict) First writer wins

CREATE TABLE dbo.Orders( OrderID int NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT= ), CustomerID int NOT NULL INDEX IX_CustomerID HASH WITH (BUCKET_COUNT= ), OrderDate datetime NOT NULL, OrderDescription nvarchar(1000) ) WITH (MEMORY_OPTIMIZED=ON) Assume the Orders table has 1M rows, and the average length of OrderDescription 78 characters. Index size: The bucket_count This is rounded up to the nearest power of 2: * * = bytes Table data size [row size] * [row count] = [row size] * 8379 [row size] = [row header size] + [actual row body size] [row header size] = * [number of indices] = * 2 = 40 bytes [actual row body size] SUM([size of shallow types]) = 4 [int] + 4 [int] + 8 [datetime] = * [number of deep type columns] = * 1 = 4 NULL array = 1 + NULL array padding = 1 Size so far is = 22. Padding to Nearest multiple of 8 is [actual row body size] = *78 = 180 bytes. So [row size] = = 220 bytes [table size] = * = bytes ~= 230Mb

Memory Optimized Data Filegroup Range Range Range Range Range 500- offline checkpoint Thread A transaction with a commit timestamp of 600 inserts one new row and deletes rows inserted by transactions with a commit timestamp of 150, 250 and 420

Memory Optimized Data Filegroup Key Range Range Range Range Range Range Range Range Data file with rows generated in timestamp range a-b Delta file with IDs of Deleted Rows Merge Range Range Deleted Files

sys.dm_db_xtp_checkpointReturns database that has one or more IM objects sys.dm_db_xtp_checkpoint_filesDisplays information about checkpoint files sys.dm_db_xtp_hash_index_statsUseful for understanding and tuning the bucket counts and duplicates for index key sys.dm_db_xtp_index_statsReports statistics about scans on an index sys.dm_db_xtp_memory_consumersReports the database-level memory consumers in the IM database engine. sys.dm_db_xtp_object_statsReports statistics about operations on a memory optimized object. sys.dm_db_xtp_table_memory_statsReturns memory usage statistics for each IM table (user and system) in the current database. sys.dm_db_xtp_transactionsReports the active transactions in the IM database engine. sys.dm_xtp_consumer_memory_usageReports memory usage for all memory consumers level level. sys.dm_xtp_gc_statsReports information about the current behavior of the IM garbage-collection process. sys.dm_xtp_system_memory_consumersReports information about memory usage. sys.dm_xtp_threadsReports the threads that the IM database engine has started internally. sys.dm_xtp_transaction_statsReports statistics about transactions that have run since the server started.

New or updated property, system view, stored procedures, or DMV Change OBJECTPROPERTYEXNew property: TableIsMemoryOptimized. SERVERPROPERTYNew property: IsXTPSupported. sys.data_spacesThe following columns display additional values: type and type_desc sys.indexesThe following columns display additional values: type and type_desc. sys.parametersNew column: is_nullable. sys.all_sql_modulesNew column: uses_native_compilation. sys.sql_modulesNew column: uses_native_compilation. sys.table_typesNew column: is_memory_optimized. sys.tablesNew columns: durability, durability_desc, and is_memory_optimized. sys.hash_indexesNew: Shows the current hash indexes and the hash index properties sp_xtp_merge_checkpoint_filesNew stored procedure: Merges all data and delta files in the transaction range specified.

Column Store (CS) Deleted Bitmap Row Store (RS) Partition

CREATE TABLE ( … ) CREATE CLUSTERED COLUMNSTORE INDEX on Converts entire table to CS format Take care of memory needed and parallelism (MAXDOP 1) BULK INSERT, SELECT INTO on Creates new CS row groups INSERT/UPDATE Store in Row Store Tuple Mover When RS reaches 1M rows, convert to a CS row group Runs every 5 minutes by default Started explicitly by ALTER INDEX ON REORGANIZE Partitioning works on clustered columnstores Just like any other table The motivation is manageability more than performance

Les Conférences Groupe des Utilisateurs SQL Server GUSS.fr