Data Partitioning. For DB Architects and Mere Mortals. Dmitri Korotkevitch

Similar documents
Azure Data Factory VS. SSIS. Reza Rad, Consultant, RADACAD

SQL Server Internals: The Practical Angle Sneak Peek. Dmitri Korotkevitch Moderated by Roberto Fonseca

Basics of Database Corruption Repair

Martin Cairney SPLIT, MERGE & ELIMINATE. SQL Saturday #572 : Oregon : 22 nd October, 2016

Martin Cairney. The Why and How of Partitioned Tables

Into into Locking and Blocking. Dmitri Korotkevitch ( 1

The Ambiguous Case of Off-Row Storage in In- Memory OLTP. Dmitri Korotkevitch, aboutsqlserver.com Moderated By: Sander Stad

Eternal Story on Temporary Objects

Columnstore in real life

The DBA Survival Guide for In-Memory OLTP. Ned Otter SQL Strategist

SQL Server 2014 Internals and Query Tuning

Automating Information Lifecycle Management with

Designing Database Solutions for Microsoft SQL Server 2012

Locking, Blocking, Versions: Concurrency for Maximum Performance. Kalen Delaney, Moderated By: Daniel Janik

About Speaker. Shrwan Krishna Shrestha. /

Performance Issue : More than 30 sec to load. Design OK, No complex calculation. 7 tables joined, 500+ millions rows

Indexing survival guide for SQL 2016 In-Memory OLTP. Ned Otter SQL Strategist

Seven Awesome SQL Server Features

Getting the most from your SAN File and Filegroup design patterns. Stephen Archbold

So You Want To Be A Rockstar Report Developer?

5/24/ MVP SQL Server: Architecture since 2010 MCT since 2001 Consultant and trainer since 1992

Monitoring Linux Performance for the SQL Server Admin. Anthony E. Nocentino, Enterprise Architect, Centino Systems

Field Testing Buffer Pool Extension and In-Memory OLTP Features in SQL Server 2014

SQL Server DBA Course Details

Developing SQL Databases (762)

Please silence cell phones

Availability and Performance for Tier1 applications

Get the Skinny on Minimally Logged Operations

SQL Server New innovations. Ivan Kosyakov. Technical Architect, Ph.D., Microsoft Technology Center, New York

55144-SQL Server 2014 Performance Tuning and Optimization

Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course:

Oracle Hyperion Profitability and Cost Management

Sepand Gojgini. ColumnStore Index Primer

10/29/2013. Program Agenda. The Database Trifecta: Simplified Management, Less Capacity, Better Performance

EXAMGOOD QUESTION & ANSWER. Accurate study guides High passing rate! Exam Good provides update free of charge in one year!

Real world SQL 2016 In-Memory OLTP

Microsoft Developing SQL Databases

Exam Questions C

Oracle Database In-Memory What s New and What s Coming

Create View With Schemabinding In Sql Server 2005

Data Warehousing & Big Data at OpenWorld for your smartphone

SQL Server 2014 Performance Tuning and Optimization

SQL Server in Azure. Marek Chmel. Microsoft MVP: Data Platform Microsoft MCSE: Data Management & Analytics Certified Ethical Hacker

MySQL Database Administrator Training NIIT, Gurgaon India 31 August-10 September 2015

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

20762B: DEVELOPING SQL DATABASES

SQL Server 2014 In-Memory OLTP: Prepare for Migration. George Li, Program Manager, Microsoft

SQL Server Optimisation

Microsoft. [MS20762]: Developing SQL Databases

Sql Server 2005 Change Schema For All Tables

"Charting the Course... MOC C: Developing SQL Databases. Course Summary

Developing SQL Databases

Martin Cairney. Hybrid data platform making the most of Azure plus your onprem

Functional Testing of SQL Server on Kaminario K2 Storage

Designing Database Solutions for Microsoft SQL Server (465)

CONFIGURING SQL SERVER FOR PERFORMANCE LIKE A MICROSOFT CERTIFIED MASTER

Business Analytics in the Oracle 12.2 Database: Analytic Views. Event: BIWA 2017 Presenter: Dan Vlamis and Cathye Pendley Date: January 31, 2017

Performance Innovations with Oracle Database In-Memory

Horizontal Table Partitioning

Columnstore Technology Improvements in SQL Server Presented by Niko Neugebauer Moderated by Nagaraj Venkatesan

5 Fundamental Strategies for Building a Data-centered Data Center

Exam Questions P

Copyright 2013, Oracle and/or its affiliates. All rights reserved.

SQL Azure. Abhay Parekh Microsoft Corporation

EATING THE ELEPHANT UNDERSTANDING AND IMPLEMENTING SQL SERVER PARTITIONING. Mike Fal -

SQL Server 2014 Highlights der wichtigsten Neuerungen In-Memory OLTP (Hekaton)

SQL Server Development 20762: Developing SQL Databases in Microsoft SQL Server Upcoming Dates. Course Description.

Maintaining a Microsoft SQL Server 2005 Database Course 2780: Three days; Instructor-Led

Azure SQL Database Training. Complete Practical & Real-time Trainings. A Unit of SequelGate Innovative Technologies Pvt. Ltd.

PURGING DATA DYNAMICALLY IN SQL Kirby Richter Dell EMC

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Synergetics-Standard-SQL Server 2012-DBA-7 day Contents

Most SQL Servers run on-premises. This one runs in the Cloud (too).

Insider s Guide on Using ADO with Database In-Memory & Storage-Based Tiering. Andy Rivenes Gregg Christman Oracle Product Management 16 November 2016

Oracle Database 11g for Experienced 9i Database Administrators

Leveraging SAP HANA and ArcGIS. Melissa Jarman Eugene Yang

DESIGNING DATABASE SOLUTIONS FOR MICROSOFT SQL SERVER CERTIFICATION QUESTIONS AND STUDY GUIDE

MySQL High Availability. Michael Messina Senior Managing Consultant, Rolta-AdvizeX /

Indira Bandari. Predictive Analytics using R in SQL Server

In-Memory Tables and Natively Compiled T-SQL. Blazing Speed for OLTP and MOre

Optimize OLAP & Business Analytics Performance with Oracle 12c In-Memory Database Option

Perform scalable data exchange using InfoSphere DataStage DB2 Connector

Exam Questions

New features in SQL Server 2016

Exadata Implementation Strategy

Columnstore Technology Improvements in SQL Server 2016

MOC 6232A: Implementing a Microsoft SQL Server 2008 Database

Teradata Certified Professional Program Teradata V2R5 Certification Guide

Exadata Implementation Strategy

SQL SERVER DBA TRAINING IN BANGALORE

SQL Server Evolution. SQL 2016 new innovations. Trond Brande

Designing Modern Apps Using New Capabilities in Microsoft Azure SQL Database. Bill Gibson, Principal Program Manager, SQL Database

Session 1079: Using Real Application Testing to Successfully Migrate to Exadata - Best Practices and Customer Case Studies

Microsoft SQL Server Training Course Catalogue. Learning Solutions

<Insert Picture Here> DBA Best Practices: A Primer on Managing Oracle Databases

Successfully migrate existing databases to Azure SQL Database. John Sterrett Principal Consultant

Will my workload run faster with In-Memory OLTP?

Implementing Oracle database12c s Heat Map and Automatic Data Optimization to optimize the database storage cost and performance

55144 SQL Server 2014 Performance Tuning and Optimization Microsoft Official Curriculum (MOC 55144)

Microsoft SQL Server Database Administration

Transcription:

Data Partitioning For DB Architects and Mere Mortals Dmitri Korotkevitch http://aboutsqlserver.com

Please silence cell phones

Explore Everything PASS Has to Offer FREE ONLINE WEBINAR EVENTS FREE 1-DAY LOCAL TRAINING EVENTS VOLUNTEERING OPPORTUNITIES LOCAL USER GROUPS AROUND THE WORLD ONLINE SPECIAL INTEREST USER GROUPS PASS COMMUNITY NEWSLETTER FREE ONLINE RESOURCES BUSINESS ANALYTICS TRAINING BA INSIGHTS NEWSLETTER

Session Evaluations 3 Your feedback is important and valuable. ways to access Submit by 5pm Friday November 6 th to WIN prizes Go to passsummit.com Downloadthe GuideBook App and search: PASS Summit 2016 Follow the QR code link displayed on session signage throughout the conference venue and in the program guide

Dmitri Korotkevitch 20+ Years in IT 15+ Years working with SQL Server Microsoft Data Platform MVP Microsoft Certified Master Author: Pro SQL Server Internals Expert SQL Server In-Memory OLTP http://aboutsqlserver.com dk@aboutsqlserver.com @aboutsqlserver

Agenda Architecture-focused discussion about data partitioning Partitioning in the single database Distributed data partitioning Going non-relational

Challenge: Inaccurate Statistics

Challenge: Mixed Workload Support

Challenge: Disaster Recovery / RTO

Challenge: Index Maintenance

Challenge: Storage Cost

Partitioned Tables [Orders2016] [FGFastStorage] 2016-01 2016-07 2016-08 2016-09 >= 2016-10 [Orders2015] 2015-01 2015-02 2015-10 2015-11 2015-12 [Orders2014] < 2014-02 2014-03 2014-10 2014-11 2014-12

Partitioned Views [Orders2016] [FGFastStorage] 2016-01 2016-07 2016-08 2016-09 2016-10 [Orders2015] 2015-01 2015-02 2015-10 2015-11 2015-12 [Orders2014] 2014-01 2014-02 2014-10 2014-11 2014-12

Comparing approaches Partitioned Tables Enterprise and Developer editions only 1,000 / 15,000 partitions max Moving data between filegroups keeping table online requires coding Statistics on the table level Same schema and indexes No partition-level onlineindex rebuild prior SQL Server 2014 Partitioned Views All editions of SQL Server 255 tables/partitions max Datacan be moved between filegroups online(enterprise Edition) (* it depends) Separate statistics per table Different schema and indexes per table. Can combine In-Memory OLTP, B-Tree and columnstore data Onlineindex rebuild within the table (Enterprise Edition) (* it depends) 14

Challenges PARTITIONED TABLES PARTITIONED VIEWS Inaccurate statistics Does not solve Solves Different schema and indexing Not supported Supported Different compression Supported Supported Piecemeal restore and partial backup and availability Supported Supported Per-partition online index rebuild SQL Server 2014+ Supported Development overhead None Significant Tiered storage and online data movement Requires development Supported Sliding window and metadata-level data purge Supported Supported 15

Tiered Storage and Mixed Workload «Hot» Data

Moving Data Demo

Moving Data Online SQL Server2012-2016 Enterprise Edition SQL Server2005-2008R2 Enterprise Edition MOVINGPARTITION TO DIFFERENT FILEGROUP Requires development ONLINE INDEX REBUILD WITH LOB COLUMNS IN THE INDEX Supported Not supported ONLINE INDEX REBUILD WITHOUTLOB COLUMNS INTHE INDEX Supported Supported Non-Enterprise Editions N/A Not supported Not supported MOVING DATA TO DIFFERENT DISK ARRAY Supported in every edition (adds fragmentation)

Mixed Approach [Orders2016] [FGFastStorage] 2016-01 2016-07 2016-08 2016-09 2016-10 [Orders2015] 2015-01 2015-02 2015-10 2015-11 2015-12 [Orders2014] < 2014-02 2014-03 2014-10 2014-12 2014-11 Regular Tables

Mixed Approach [Orders2016] [FGFastStorage] 2016-01 2016-07 2016-08 2016-09 2016-10 [Orders2015] 2015-01 2015-02 2015-10 2015-11 2015-12 < 2014-02 [Orders2014] 2014-03 2014-10 2014-11 2014-12 Partitioned Tables

Mixed Approach [Orders2016] [FGFastStorage] 2016-01 2016-07 2016-08 2016-09 2016-10 [Orders2015] 2015-01 2015-02 2015-10 2015-11 2015-12 < 2014-02 [Orders2014] 2014-03 2014-10 2014-11 2014-12 Partitioned View

Mixed Approach [Orders2016] 2016-09 [FGFastStorage] 2016-01 2016-07 2016-08 2016-09 2016-10 2016-11 [Orders2015] 2015-01 2015-02 2015-10 2015-11 2015-12 < 2014-02 [Orders2014] 2014-03 2014-10 2014-11 2014-12 SCH-M lock during ALTER TABLE ADD CHECK CONSTRAINT (INDEX SCAN)

What about In-Memory OLTP? [Orders2016] In-Memory OLTP FG Clients Articles 2016-01 2016-07 2016-08 [Orders2015] 2016-09 2016-10 2015-01 2015-02 2015-10 2015-11 2015-12 [Orders2014] < 2014-02 2014-03 2014-10 2014-11 2014-12 Native Compilation

What about In-Memory OLTP? [Orders2016] tmp09 In-Memory OLTP FG tblupdated tbldeleted 2016-01 2016-07 2016-08 Trigger [Orders2015] 2016-09 2016-10 2015-01 2015-02 2015-10 2015-11 2015-12 [Orders2014] < 2014-02 2014-03 2014-10 2014-11 2014-12

What about In-Memory OLTP? [Orders2016] tmp09 In-Memory OLTP FG tblupdated tbldeleted 2016-01 2016-07 2016-08 2016-09 Trigger [Orders2015] 2016-09 2016-10 2016-11 2015-01 2015-02 2015-10 2015-11 2015-12 [Orders2014] < 2014-02 2014-03 2014-10 2014-11 2014-12

Moving In-Memory OLTP Data Demo

Linked Servers

Linked Servers Demo

Ugly Workaround select @ArchivedStores = count(*) from @tvpstores where Archived = 1; if @ArchivedStores > 0 begin set @Stores = (select StoreId as [@Id] from @tvpstores where Archived = 1 for xml path); insert into #RemoteOrders exec RemoteServer.DB.dbo.GetOrders @Stores, @StartDate, @StopDate; end select... from ( select.. from dbo.orders union all select.. from #RemoteOrders )

Stretch Database Pros: Transparency Transactional consistency Cons: Limited control price, Price, PRICE!!!!

Outside of Relational Model Raw Data: Sensor Readings Geo Locations Row-by-row processing => NoSQL Reportable Data: Events / Actions Trips Joins; aggregations; analysis; reporting => Relational DB

Sounds Too Good To Be True Partitioning affects execution plans More at: http://aboutsqlserver.com/publications Pro SQL Server Internals No uniqueness across all the data Several other restrictions / incompatibilities

We Covered Partitioning in the single database Distributed data partitioning Going non-relational

Any Questions? Thank you very much! Email: dk@aboutsqlserver.com Blog: http://aboutsqlserver.com

Session Evaluations 3 Your feedback is important and valuable. ways to access Submit by 5pm Friday November 6 th to WIN prizes Go to passsummit.com Downloadthe GuideBook App and search: PASS Summit 2016 Follow the QR code link displayed on session signage throughout the conference venue and in the program guide

Thank You Learn more from Dmitri Korotkevitch dk@aboutsqlserver.com http://aboutsqlserver.com