In-Memory Capabilities

Slides:



Advertisements
Similar presentations
new database engine component fully integrated into SQL Server 2014 optimized for OLTP workloads accessing memory resident data achive improvements.
Advertisements

| Basel SQL Server 2014: In- Memory OLTP Stéphane Haby - Stéphane Savorgnano Consultant dbi services.
HANA database lectures March ©2013 SAP AG or an SAP affiliate company. All rights reserved.2 Outline Part 1 Motivation - Why main memory processing.
Project “Hekaton” adds in-memory technology to boost performance of OLTP workloads in SQL Server.
Meanwhile RAM cost continues to drop Moore’s Law on total CPU processing power holds but in parallel processing… CPU clock rate stalled… Because.
IIS Server ETL IIS Server This is OPERATIONAL ANALYTICS.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today.
Case study DATABASE MANAGEMENT SYSTEMS Oracle Database 11g Release 2 (11.2) – MySQL 5.5 –
Architecture Rajesh. Components of Database Engine.
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.
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.
Sofia Event Center November 2013 Margarita Naumova SQL Master Academy.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today.
Module 11: Managing Transactions and Locks
5 Trends in the Data Warehousing Space Source: TDWI Report – Next Generation DW.
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.
Mladen Prajdić SQL Server MVP Hekaton The New SQL Server In-Memory OLTP Engine.
SQL Server 2016: Real-time operational analytics
Best Practices for Columnstore Indexes Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Memory-Optimized Tables Querying at the speed of light.
Enable Operational Analytics (HTAP) in SQL Server 2016 and Azure SQL Database Sunil Agarwal Principal Program Manager, SQL Server Product Tiger Team
Temporal Databases Microsoft SQL Server 2016
InMemory improvements on SQL Server 2016
Operational Analytics in SQL Server 2016 and Azure SQL Database
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
Temporal Databases Microsoft SQL Server 2016
In-Memory Optimization (OLTP) enhancements overview
How In-Memory Affects Database Design
SQL Server Internals Overview
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
Isolation Levels Understanding Transaction Temper Tantrums
SQL Server In-Memory Internals
Graeme Malcolm | Data Technology Specialist, Content Master
මොඩියුල විශ්ලේෂණය Buffer Pool Extension භාවිතය.
Super Scaling The LMAX Queue Pattern.
Working with Very Large Tables Like a Pro in SQL Server 2014
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
The Vocabulary of Performance Tuning
PREMIER SPONSOR GOLD SPONSORS SILVER SPONSORS BRONZE SPONSORS SUPPORTERS.
In-Memory OLTP (IMOLTP) What Can It Do For Me?
Azure SQL Data Warehouse Performance Tuning
SQL 2014 In-Memory OLTP What, Why, and How
Physical Database Design
20 Questions with Azure SQL Data Warehouse
Transactions, Locking and Query Optimisation
The Five Ws of Columnstore Indexes
Microsoft Ignite /1/ :19 PM
In Memory OLTP Not Just for OLTP.
Statistics for beginners – In-Memory OLTP
In-Memory OLTP for Database Developers
Sunil Agarwal | Principal Program Manager
The Vocabulary of Performance Tuning
Four Rules For Columnstore Query Performance
Clustered Columnstore Indexes (SQL Server 2014)
In Memory OLTP Not Just for OLTP.
SQL Server 2016 In-Memory OLTP for the DBA
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Isolation Levels Understanding Transaction Temper Tantrums
The Vocabulary of Performance Tuning
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Working with Very Large Tables Like a Pro in SQL Server 2017
SQL Server 2016 High Performance Database Offer.
Using Columnstore indexes in Azure DevOps Services. Lessons learned.
Sunil Agarwal | Principal Program Manager
Presentation transcript:

In-Memory Capabilities Dan Andrei STEFAN www.rentadba.eu https://github.com/rentadba/dbaTDPMon 05.05.2017

In-Memory OLTP Developers’s DBA’s How to use it Fully ACID Started in 2007 as Project Verde -> released as Hekaton / In Memory OLTP in SQL Server 2014 How to use it Create a Memory Optimized filegroup (yes, it does have file(s) on disk! ) ALTER DATABASE [db_name] ADD FILEGROUP [fg_name] CONTAINS MEMORY_OPTIMIZED_DATA ALTER DATABASE [db_name] ADD FILE (name=‘logical_name', filename=‘physical_file_name') TO FILEGROUP [fg_name] Create a Memory Optimized table (rowstore !) CREATE TABLE [in-memory-oltp-table] ([..]) WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA); Durability SCHEMA_AND_DATA: level of data durability depends on transaction - full or delayed durability SCHEMA_ONLY Decide on index strategy HASH: unique row lookups pay attention to Bucket_Count parameter Non-Clustered: range lookups (Bw-tree implementation) Fully ACID Isolation levels: Snapshot / Repeatable Read / Serializable T-SQL support some restriction applies: eg: foreign keys, truncate table DBA’s Allocation & Storage Rows are stored as “heaps”: header (max 86 bytes) + payload (the row itself) Index is the only connection between distinct rows Hash indexes: one deterministic function for all / array of pointers NC index page pointer is a position in a mapping table (physical memory address) Durability No WAL protocol Logs generated at commit time / grouped in records up to 24 kb Data file(s): inserted versions of rows Delta file(s): deleted versions or rows Automatic/manual merge of data and delta files Multi-Version Optimistic Concurrency (MVCC) Rows never change: UPDATE = DELETE + INSERT Row versions (not in tempdb) Optimistic approach: in case of a conflict (eg. concurrent updates – same row same time), fail one transaction Starting SQL Server 2016 there is no limit on the size of memory-optimized tables, other than available memory. Supported in Always on Availability Groups / Azure SQL Database Usage scenarios High-throughput and low-latency transaction processing (eg. BWIN, 1.2 million batch requests / sec) Caching ETL staging tables Replacement for tempdb

Native Compilation Developers’s DBA’s How to use it Takes the table and stored procedures definitions as input, generates C code, and leverages the Visual C compiler to generate the native code. The result of the compilation of tables and stored procedures are DLLs that are loaded in memory and linked into the SQL Server process. How to use it Create a stored procedure and mark with NATIVE_COMPILATION CREATE PROCEDURE dbo.[usp_native_compiled] WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER AS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL=snapshot, LANGUAGE=N'us_english') INSERT dbo.[in-memory-oltp-table] VALUES ([...]) END GO Compilation and Query Processing DBA’s The information necessary to recreate the DLLs is stored in the database metadata; the DLLs themselves are not part of the database. the DLLs are not part of database backups. not need to maintain the files that are generated by native compilation. SQL Server automatically removes generated files that are no longer needed (on table and stored procedure deletion, on drop database and also on server or database restart) for natively compiled stored procedures, the query execution plan is compiled into the DLL. Note that natively compiled stored procedures are recompiled on first execution after server restart, as well as after failover to an AlwaysOn secondary, meaning that the query optimizer will create new query plans that are subsequently compiled into the stored procedure DLLs. SELECT name, description FROM sys.dm_os_loaded_modules WHERE description = 'XTP Native DLL'

In-Memory OLTP & ColumnStore Developers’s Full support starting SQL Server 2016 How to use it Create an index alter table [in-memory-oltp-table] add index <index-name> clustered columnstore May control how long a row will stay in tail, using compression delay option Good to know CCI index is persisted, but it is required to be fully resident in memory (approx. 10% more memory usage) It cannot be a filtered index Usage scenarios HTAP IoT DBA’s CCI is a special NCCI that includes all the columns from memory-optimized table (“double” the data) New rows are inserted only in memory optimized table The tail is tracked using a dedicated memory allocator Rows are compressed into CCI once they reach the count of 1 million Column / segment elimination (sys.column_store_segments) Pushdown of aggregates and predicates Batch mode execution: up to 900 records at once

Useful links SQL Server In-Memory OLTP Internals Overview https://msdn.microsoft.com/en-us/library/dn720242.aspx Transactions with Memory-Optimized Tables https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/transactions-with-memory-optimized-tables Merge Operation in Memory-Optimized Tables https://blogs.technet.microsoft.com/dataplatforminsider/2014/01/22/merge-operation-in-memory-optimized-tables/ Transact-SQL Constructs Not Supported by In-Memory OLTP https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/transact-sql-constructs-not-supported-by-in-memory-oltp Bob Ward’s – Inside SQL Server In-Memory OLTP https://www.slideshare.net/BobWard28/inside-sql-server-inmemory-oltp-72339103 Overview of Columnstore Indexes in SQL Server https://blogs.sentryone.com/melissacoates/overview-columnstore-indexes-sql-server/ Columnstore Index Performance: Rowgroup Elimination https://blogs.msdn.microsoft.com/sql_server_team/columnstore-index-performance-rowgroup-elimination/

Q & A