Partitioned Tables and Query Performance

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

Module 3: Creating and Tuning Indexes. Planning Indexes Creating Indexes Optimizing Indexes.
SQL Server 2012 New Performance Tuning Tools. Who am I? Menzo Steinhorst Senior Premier Field Engineer SQLRAP, WS+ SQL Server Performance Tuning, WS+
Data Management and Index Options for SQL Server Data Warehouses Atlanta MDF.
This work is by Kendra Little and is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported LicenseCreative Commons Attribution-NonCommercial-NoDerivs.
Big Data Working with Terabytes in SQL Server Andrew Novick
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)
Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT.
BI Technical Infrastructure Approach
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Loading Ola Ekdahl IT Mentors 9/12/08.
Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Denny Cherry twitter.com/mrdenny.
Praveen Srivatsa Director| AstrhaSoft Consulting blogs.asthrasoft.com/praveens |
2012 © Trivadis BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN Welcome November 2012 Columnstore Indexes.
How to kill SQL Server Performance Håkan Winther.
# CCNZ What is going on here???
Or How I Learned to Love the Cube…. Alexander P. Nykolaiszyn BLOG:
Splits, Merges and Purges THE HOW TO OF TABLE PARTITIONING.
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.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Enable Operational Analytics (HTAP) in SQL Server 2016 and Azure SQL Database Sunil Agarwal Principal Program Manager, SQL Server Product Tiger Team
Microsoft Connect /6/ :05 AM
Introduction to Partitioning in SQL Server
Chris Index Feng Shui Chris
In-Memory Capabilities
Operational Analytics in SQL Server 2016 and Azure SQL Database
Module 2: Creating Data Types and Tables
Introduction to SQL Server Analysis Services
SQL Server 2017 Graph Database Inside-Out
Module 4: Creating and Tuning Indexes
Why Should I Care About … Partitioned Views?
Why Should I Care About … Partitioned Views?
Hustle and Bustle of SQL Pages
The Ins and Outs of Partitioned Tables
Four Rules For Columnstore Query Performance
A developers guide to Azure SQL Data Warehouse
Beginner Table Partitioning
Blazing-Fast Performance:
EXEC and sp_executesql An Ad Hoc Rally
PREMIER SPONSOR GOLD SPONSORS SILVER SPONSORS BRONZE SPONSORS SUPPORTERS.
Table Indexing for the .NET Developer
SQL 2014 In-Memory OLTP What, Why, and How
T-SQL Power! The OVER Clause: Your Key to No-Sweat Problem Solving
Introduction to partitioning
Partitioned Tables and Query Performance
A developers guide to Azure SQL Data Warehouse
Table Partitioning Intro and make that a sliding window too!
Microsoft SQL Server 2014 for Oracle DBAs Module 7
In Memory OLTP Not Just for OLTP.
Realtime Analytics OLAP & OLTP in the mix
What’s new with SQL Server
Adding Lightness Better Performance through Compression
Why Should I Care About … Partitioned Views?
Moving from SQL Profiler to xEvents
Table Partitioning Intro and make that a sliding window too!
SQL Operations Studio A Test Drive
Four Rules For Columnstore Query Performance
Clustered Columnstore Indexes (SQL Server 2014)
Table Partitioning Intro and make that a sliding window too!
Applying Data Warehouse Techniques
Managing Table Partitions at the Extreme
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Using Columnstore indexes in Azure DevOps Services. Lessons learned
Using Dbatools to Automate Database Migrations
Applying Data Warehouse Techniques
How To Load A Fact Table Really, Really Fast
Making your M Queries Dynamic in Power BI
SQL Server 2016 High Performance Database Offer.
An Introduction to Partitioning
Presentation transcript:

Partitioned Tables and Query Performance

The Obligatory Bio Page Jay Robinson Senior Systems Engineer, Salesforce Marketing Cloud (formerly ExactTarget) PASS Program Manager Email: downshiftdata@gmail.com Twitter/Slack: @downshiftdata Blog: downshiftdata.arksoftware.net

Come to Indianapolis! Pre-Cons Jonathan Stewart -  In-depth Guide to Visualization Ben Miller - Powershell Modules to make SQL Server easy Shannon Lowder - BIML Bootcamp

Concepts Common Use Cases Optimizer Issues and Query Tactics Summary Concepts Common Use Cases Optimizer Issues and Query Tactics

Concepts Partition Function Assuming integer VALUES of 10, 20, 30... CREATE PARTITION FUNCTION {pf_name} ({param1}) AS RANGE LEFT|RIGHT FOR VALUES ({val1}, {val2}, ... {valN}); sys.partition_functions, sys.partition_parameters, and sys.partition_range_values Assuming integer VALUES of 10, 20, 30... RANGE LEFT: <= 10, 11 to 20, 21 to 30, > 30 RANGE RIGHT: < 10, 10 to 19, 20 to 29, >= 30

Concepts Partition Scheme CREATE PARTITION SCHEME {ps_name} AS PARTITION {pf_name} TO ({fg1}, {fg2}, ... {fgN}); sys.data_spaces and sys.partition_schemes Number of filegroups must match number of values + 1

Concepts Partitioned Tables and Indexes CREATE TABLE {t_name} ({column_defs}) ON {ps_name}({col_name}); sys.partitions and sys.dm_db_partition_stats

Concepts Aligned v Non-Aligned Indexes Partition Elimination Whether or not the index’s partitioning matches the table partitioning Partition Elimination The optimizer’s act of limiting query processing to only relevant partitions

Use Cases for Partitioned Tables Data Deprecation ALTER TABLE ... SWITCH followed by TRUNCATE TABLE SQL Server 2016: WITH PARTITIONS ETL Operations (e.g. OLTP to OLAP) Migration Tasks (e.g. adding compression) Improved Write Performance (striping)

If you know the partition, use the partition function DEMO Scenario 1 Partitioning By Date If you know the partition, use the partition function

Don’t rely on the partition function DEMO Scenario 2 Using a Persisted Computed Column Don’t rely on the partition function

For discrete values, lead with the partitioned column DEMO Scenario 3 Leading with the Computed Column For discrete values, lead with the partitioned column

Introducing Non-Clustered Indexes DEMO Scenario 4 Introducing Non-Clustered Indexes The optimizer isn’t always right

Spanning Multiple Partitions DEMO Scenario 5 Spanning Multiple Partitions Treat each partition independently

Microsoft Connect Issue #240968

Where do we go from here? MSDN (duh!) Video: @Kendra_Little Columnstore: @NikoNeugebauer http://www.nikoport.com/columnstore/ @KimberlyLTripp, @PaulRandal, @BrentO sqlcommunity.slack.com And, as always, #sqlhelp

Thank You! "When I look fast, I'm not smooth and I am going slowly. And when I look slow, I am smooth and going fast." - Alain Prost Jay Robinson Email: downshiftdata@gmail.com Twitter/Slack: @downshiftdata Blog: downshiftdata.arksoftware.net