SlideShare a Scribd company logo
1 of 58
Download to read offline
Table Partitioning in SQL Server
A Magic Solution for Better Performance?
Cathrine Wilhelmsen
@cathrinew
cathrinewilhelmsen.net
Data Warehouse Architect
Business Intelligence Developer
You?
New to table partitioning
"Everything is slow"
Today?
Basic Introduction
What, Why & How
A Magic Solution for Better Performance?
Spoiler Alert!
A Magic Solution for Better Performance?
Implementing table partitioning is not a trivial task
and can actually cause worse performance...
A Magic Solution for Better Performance?
...but don't worry, I made plenty of mistakes
so you can avoid them 
Enterprise Edition only
What?
Partition Key
Partition Function
Partition Scheme
Why?
Backup & Restore
Maintenance
Load & Archive
How?
Partition Elimination
Switch, Split & Merge
Sliding Windows
Table Partitioning Basics
What is a partitioned table?
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Data is physically stored in groups
of rows called partitions
Each partition can be accessed
and maintained separately
Partitioning is not visible to users,
it behaves like one logical table
Partition Key
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Data is partitioned based on a
single column, the Partition Key
The Partition Key should always be
used as a filter in queries
This ensures Partition Elimination:
only relevant partitions are accessed
Partition Function
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
The Partition Function defines how to
partition the data
It specifies boundary values, the points
between two partitions
It specifies if the boundary value
belongs to its left (upper) partition or
its right (lower) partition
Partition Function: Range Left and Range Right
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Partition Function: Range Left and Range Right
Range Left means the boundary value is
the last value in the left partition
CREATE PARTITION FUNCTION
pfLeft (INT) AS RANGE LEFT
FOR VALUES (20,30,40);
Range Right means the boundary value
is the first value in the right partition
CREATE PARTITION FUNCTION
pfRight (INT) AS RANGE RIGHT
FOR VALUES (20,30,40);
...20 21-30 41...31-40 ...19 20-39 40...30-39
20 30 40 20 30 40
Partition Scheme
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
The Partition Scheme maps logical
partitions to physical filegroups
Filegroups?
Data files on one or more disks
Backed up and restored individually
Can be Read-Only
Map all partitions to one filegroup
FILEGROUP
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Map partitions to separate filegroups
FILEGROUP1
(Read-Only)
FILEGROUP2
(Read-Only)
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
FILEGROUP3
FILEGROUP4
How are partitions mapped to filegroups?
...20 21-30 41...31-40 ...19 20-39 40...30-39
20 30 40 20 30 40
The partition function specified the boundary values and partitions:
How are partitions mapped to filegroups?
CREATE PARTITION SCHEME
psLeft AS PARTITION pfLeft
TO (FG1, FG2, FG3, FG4);
CREATE PARTITION SCHEME
psRight AS PARTITION pfRight
TO (FG1, FG2, FG3, FG4);
...20 21-30 41...31-40 ...19 20-39 40...30-39
20 30 40 20 30 40
The partition scheme uses the partition function...
How are partitions mapped to filegroups?
CREATE PARTITION SCHEME
psLeft AS PARTITION pfLeft
TO (FG1, FG2, FG3, FG4);
CREATE PARTITION SCHEME
psRight AS PARTITION pfRight
TO (FG1, FG2, FG3, FG4);
...20 21-30 41...31-40 ...19 20-39 40...30-39
20 30 40 20 30 40
FG1 FG2 FG4FG3 FG1 FG2 FG4FG3
...to map each partition to filegroups:
Filegroups
Partition Scheme
Partitioned Table
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
A partitioned table is created on
a partition scheme instead of
directly on a filegroup
The partition scheme uses the
partition key to store rows in the
correct partition and filegroup
based on the definition specified
in the partition function
Table Partitioning Basics
Why Table Partitioning?
Partition Elimination
SELECT COUNT(*) FROM Table
WHERE Year = 2012;
SELECT COUNT(*) FROM Table;
Partition Elimination
SELECT COUNT(*) FROM Table
WHERE Year = 2012;
SELECT COUNT(*) FROM Table;
Backup & Restore Partitions
Filegroups can be backed up
and restored individually
If each partition is mapped to
a separate filegroup, partitions
with the most critical data can
be restored first
Backup & Restore Partitions
Filegroups can be read-only
If each partition is mapped
to a separate filegroup,
partitions with historical,
unchanging data can be
excluded from regular
backups
Index Maintenance per Partition
Rebuild and reorganize indexes per
partition
Rebuild indexes online per partition
was introduced in SQL Server 2014
Set data compression per
partition
ALTER INDEX IndexName
ON TableName
REBUILD PARTITION = 2
WITH (ONLINE = ON);
Statistics Maintenance per Partition
Update statistics on specific
partitions instead of scanning
and updating the whole table
UPDATE STATISTICS
TableName (StatisticsName)
WITH RESAMPLE
ON PARTITIONS (3,5);
CREATE STATISTICS
StatisticsName ON
TableName (ColumnName)
WITH INCREMENTAL = ON;
Incremental Statistics was
introduced in SQL Server 2014
Load & Archive: Partition Switching
Partitions can be switched between tables,
called switching in or switching out
Partition switching is a metadata operation
that updates the location of the data, no
data is physically moved
Extremely fast compared to inserting
into or deleting from a large table
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
2012-01-01 ... ...
2012-12-31 ... ...
ALTER TABLE Table1
SWITCH PARTITION 5
TO Table2 PARTITION 5;
SELECT
$PARTITION.pf(2014);
Load & Archive: Switch out
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Called switch out when you move data out of a table (archive)
Load & Archive: Switch out
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
2012-01-01 ... ...
2012-12-31 ... ...
Called switch out when you move data out of a table (archive)
Load & Archive: Switch in
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
2016-01-01 ... ...
2016-12-31 ... ...
Called switch in when you move data into a table (load)
Load & Archive: Switch in
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
2016-01-01 ... ...
2016-12-31 ... ...
Called switch in when you move data into a table (load)
Sliding Windows
The Sliding Windows technique automates data loading, data archiving
and partition management
It keeps a certain number of partitions by continuously switching out
the oldest data and switching in new data
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2012-01-01 ... ...
2012-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Sliding Windows: Split & Merge
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Partitions are not actually added or
removed, they are split or merged
Be careful!
Splitting and merging partitions
can cause data movement!!
Sliding Windows: Split & Merge
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Split one partition in two by
adding a new boundary value
ALTER PARTITION FUNCTION pf ()
SPLIT RANGE ('2013-06-01');
Data movement will occur if there is data
on both sides of the new boundary value!
Sliding Windows: Split & Merge
2012-01-01 ... ...
2012-12-31 ... ...
2013-01-01 ... ...
2013-12-31 ... ...
2014-01-01 ... ...
2014-12-31 ... ...
2015-01-01 ... ...
2015-12-31 ... ...
Merge two partitions to one by
removing a boundary value
ALTER PARTITION FUNCTION pf ()
MERGE RANGE ('2014-01-01');
Data movement will occur if there is data
on both sides of the old boundary value!
Sliding Windows Steps
1. Add new filegroup and file
2. Create switch out (archive) table
3. Create switch in (load) table and load it with new data
4. Split to add new partition
5. Switch in new partition
6. Switch out old partition
7. Merge to remove old partition
8. Delete switch out and switch in tables
9. Delete old file and filegroup
Sliding Windows Demo
Alternative Sliding Windows Steps
1. Add new filegroup and file
2. Create switch out (archive) table
3. Switch out old partition
4. Merge to remove old partition
5. Create switch in (load) table and load it with new data
6. Split to add new partition
7. Switch in new partition
8. Delete switch out and switch in tables
9. Delete old file and filegroup
Why Table Partitioning?
Case Study: What Went Wrong?
Background: Financial Data Warehouse
Periodic Snapshot Fact Tables
Daily, Weekly and Monthly Balances
SQL Server, DB2, Oracle, .csv, .txt
Loaded at different times during the day
1 2 3 4 5 6 7
Pension Insurance Bank Fund
First version
Daily fact table:
Keep 1 day per source
1 2
Pension
6 7
Bank Fund
Monthly fact table:
Keep 36 months per source
3 4 5
Insurance
Second version
Daily fact table:
Keep 1 day per source
1 2
Pension
Monthly / Weekly fact table:
Keep 36 months for some sources
Keep 106 weeks for some sources
3 4 5
Insurance
!
6 7
Bank Fund
Third version
Daily fact table:
Keep 1 day per source
1 2
Pension
Monthly / Weekly / Daily fact table:
Keep 36 months for some sources
Keep 106 weeks for some sources
Keep 7 days for some sources
3 4 5 6 7
Insurance Bank Fund
!!
"Everything is slow"
"Let's try partitioning"
Daily fact table partitioning
1 ... ...
2 ... ...
3 ... ...
4 ... ...
5 ... ...
6 ... ...
7 ... ...
Partition Key: source number
One partition per source
Helped with deadlock issues
Easy to switch data in and out
Monthly / Weekly / Daily fact table partitioning
12011 ... ...
12012 ... ...
12013 ... ...
12014 ... ...
19990 ... ...
19991 ... ...
19992 ... ...
Partition Key: Source number + Period type
Period type:
YYYY for monthly data
9991 for weekly data
9992 for daily data
Helped with deadlock issues, but…
Monthly / Weekly / Daily fact table partitioning
12011 ... ...
12012 ... ...
12013 ... ...
12014 ... ...
19990 ... ...
19991 ... ...
19992 ... ...
Partition key was difficult to remember
and was not used in queries
Data had to be inserted into and
deleted from partitions with existing
data, instead of switching partitions in
and out
What went wrong?
"The usual suspects": Conflicting priorities, changing
requirements and high pressure to deliver on time
Fact tables were expanded, not changed, when new
sources and requirements were implemented
Partitioning was implemented on fact tables with
multiple grains, instead of correcting the fact tables first
What did we learn?
test, test, test, test
References and Resources: Table Partitioning
Brent Ozar Unlimited: SQL Server Table Partitioning Resources
brentozar.com/sql/table-partitioning-resources/
Bradley Ball: Partitioning in SQL Server 2012
pragmaticworks.com/Training/FreeTraining/ViewWebinar/WebinarID/541
References and Resources: Further Reading
Partial Backups in SQL Server 2014
msdn.microsoft.com/en-us/library/ms191539.aspx
Piecemeal Restores in SQL Server 2014
msdn.microsoft.com/en-us/library/ms177425.aspx
Benjamin Nevarez: SQL Server 2014 Incremental Statistics
benjaminnevarez.com/2015/02/2014-incremental-statistics/
Thank you!
@cathrinew
cathrinewilhelmsen.net
no.linkedin.com/in/cathrinewilhelmsen
contact@cathrinewilhelmsen.net

More Related Content

What's hot

SQL Server Index and Partition Strategy
SQL Server Index and Partition StrategySQL Server Index and Partition Strategy
SQL Server Index and Partition StrategyHamid J. Fard
 
Parquet and AVRO
Parquet and AVROParquet and AVRO
Parquet and AVROairisData
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkDatabricks
 
Azure data factory
Azure data factoryAzure data factory
Azure data factoryDavid Giard
 
Dimensional modelling-mod-3
Dimensional modelling-mod-3Dimensional modelling-mod-3
Dimensional modelling-mod-3Malik Alig
 
Introduction to Apache Hive
Introduction to Apache HiveIntroduction to Apache Hive
Introduction to Apache HiveAvkash Chauhan
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergWalaa Eldin Moustafa
 
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | Edureka
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | EdurekaData Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | Edureka
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | EdurekaEdureka!
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...Andrew Lamb
 
PostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performancePostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performanceVladimir Sitnikov
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례I Goo Lee
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architectureAjeet Singh
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache icebergAlluxio, Inc.
 
Difference between all topics in oracle
Difference between all topics in oracleDifference between all topics in oracle
Difference between all topics in oraclePraveenRaj280263
 
Azure data factory
Azure data factoryAzure data factory
Azure data factoryBizTalk360
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMicrosoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMark Kromer
 

What's hot (20)

SQL Server Index and Partition Strategy
SQL Server Index and Partition StrategySQL Server Index and Partition Strategy
SQL Server Index and Partition Strategy
 
Parquet and AVRO
Parquet and AVROParquet and AVRO
Parquet and AVRO
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Azure data factory
Azure data factoryAzure data factory
Azure data factory
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
Dimensional modelling-mod-3
Dimensional modelling-mod-3Dimensional modelling-mod-3
Dimensional modelling-mod-3
 
Introduction to Apache Hive
Introduction to Apache HiveIntroduction to Apache Hive
Introduction to Apache Hive
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and Iceberg
 
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | Edureka
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | EdurekaData Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | Edureka
Data Warehouse Concepts | Data Warehouse Tutorial | Data Warehousing | Edureka
 
Internals of Presto Service
Internals of Presto ServiceInternals of Presto Service
Internals of Presto Service
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
 
PostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performancePostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performance
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례
 
SQLServer Database Structures
SQLServer Database Structures SQLServer Database Structures
SQLServer Database Structures
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache iceberg
 
Difference between all topics in oracle
Difference between all topics in oracleDifference between all topics in oracle
Difference between all topics in oracle
 
Aggregate fact tables
Aggregate fact tablesAggregate fact tables
Aggregate fact tables
 
Azure data factory
Azure data factoryAzure data factory
Azure data factory
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMicrosoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
 

Viewers also liked

Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...Cathrine Wilhelmsen
 
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)Cathrine Wilhelmsen
 
Biml Academy 2 - Lesson 5: Importing source metadata into Biml
Biml Academy 2 - Lesson 5: Importing source metadata into BimlBiml Academy 2 - Lesson 5: Importing source metadata into Biml
Biml Academy 2 - Lesson 5: Importing source metadata into BimlCathrine Wilhelmsen
 
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)Cathrine Wilhelmsen
 
Microsoft SQL Server - Files and Filegroups
Microsoft SQL Server - Files and FilegroupsMicrosoft SQL Server - Files and Filegroups
Microsoft SQL Server - Files and FilegroupsNaji El Kotob
 
Ssis partitioning and best practices
Ssis partitioning and best practicesSsis partitioning and best practices
Ssis partitioning and best practicesVinod Kumar
 
Partitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- ArticlePartitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- ArticleHemant K Chitale
 
Responding to extended events in near real time
Responding to extended events in near real timeResponding to extended events in near real time
Responding to extended events in near real timeGianluca Sartori
 
Table partitioning in Oracle Database
Table partitioning in Oracle DatabaseTable partitioning in Oracle Database
Table partitioning in Oracle DatabaseAakash Mehndiratta
 
Partitioning on Oracle 12c - What changed on the most important Oracle feature
Partitioning on Oracle 12c - What changed on the most important Oracle featurePartitioning on Oracle 12c - What changed on the most important Oracle feature
Partitioning on Oracle 12c - What changed on the most important Oracle featureLuis Marques
 
TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...
TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...
TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...Charley Hanania
 
Implementing Auditing in SQL Server
Implementing Auditing in SQL ServerImplementing Auditing in SQL Server
Implementing Auditing in SQL ServerDavid Dye
 
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...Cathrine Wilhelmsen
 
whitepaper_advanced_analytics_with_tableau_eng
whitepaper_advanced_analytics_with_tableau_engwhitepaper_advanced_analytics_with_tableau_eng
whitepaper_advanced_analytics_with_tableau_engS. Hanau
 
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)Cathrine Wilhelmsen
 
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...Cathrine Wilhelmsen
 
PMO OBjectives - a quick guide
PMO OBjectives - a quick guidePMO OBjectives - a quick guide
PMO OBjectives - a quick guidePM Majik
 
SQL Server Reporting Services 2008
SQL Server Reporting Services 2008SQL Server Reporting Services 2008
SQL Server Reporting Services 2008VishalJharwade
 
Agile Data Warehouse Modeling: Introduction to Data Vault Data Modeling
Agile Data Warehouse Modeling: Introduction to Data Vault Data ModelingAgile Data Warehouse Modeling: Introduction to Data Vault Data Modeling
Agile Data Warehouse Modeling: Introduction to Data Vault Data ModelingKent Graziano
 

Viewers also liked (20)

Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
 
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
 
Biml Academy 2 - Lesson 5: Importing source metadata into Biml
Biml Academy 2 - Lesson 5: Importing source metadata into BimlBiml Academy 2 - Lesson 5: Importing source metadata into Biml
Biml Academy 2 - Lesson 5: Importing source metadata into Biml
 
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
 
Microsoft SQL Server - Files and Filegroups
Microsoft SQL Server - Files and FilegroupsMicrosoft SQL Server - Files and Filegroups
Microsoft SQL Server - Files and Filegroups
 
Ssis partitioning and best practices
Ssis partitioning and best practicesSsis partitioning and best practices
Ssis partitioning and best practices
 
Partitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- ArticlePartitioning Tables and Indexing Them --- Article
Partitioning Tables and Indexing Them --- Article
 
Responding to extended events in near real time
Responding to extended events in near real timeResponding to extended events in near real time
Responding to extended events in near real time
 
Table partitioning in Oracle Database
Table partitioning in Oracle DatabaseTable partitioning in Oracle Database
Table partitioning in Oracle Database
 
Partitioning on Oracle 12c - What changed on the most important Oracle feature
Partitioning on Oracle 12c - What changed on the most important Oracle featurePartitioning on Oracle 12c - What changed on the most important Oracle feature
Partitioning on Oracle 12c - What changed on the most important Oracle feature
 
TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...
TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...
TehDays Basel - Auditing in sql server 2012 - charley hanania - tech days bas...
 
Implementing Auditing in SQL Server
Implementing Auditing in SQL ServerImplementing Auditing in SQL Server
Implementing Auditing in SQL Server
 
SQL Server: Security
SQL Server: SecuritySQL Server: Security
SQL Server: Security
 
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
 
whitepaper_advanced_analytics_with_tableau_eng
whitepaper_advanced_analytics_with_tableau_engwhitepaper_advanced_analytics_with_tableau_eng
whitepaper_advanced_analytics_with_tableau_eng
 
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
 
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
 
PMO OBjectives - a quick guide
PMO OBjectives - a quick guidePMO OBjectives - a quick guide
PMO OBjectives - a quick guide
 
SQL Server Reporting Services 2008
SQL Server Reporting Services 2008SQL Server Reporting Services 2008
SQL Server Reporting Services 2008
 
Agile Data Warehouse Modeling: Introduction to Data Vault Data Modeling
Agile Data Warehouse Modeling: Introduction to Data Vault Data ModelingAgile Data Warehouse Modeling: Introduction to Data Vault Data Modeling
Agile Data Warehouse Modeling: Introduction to Data Vault Data Modeling
 

Similar to Table Partitioning in SQL Server: A Magic Solution for Better Performance? (Pragmatic Works)

pdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdf
pdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdfpdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdf
pdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdfJalal Neshat
 
Datacolor match textile 1.0 user guide
Datacolor match textile 1.0 user guideDatacolor match textile 1.0 user guide
Datacolor match textile 1.0 user guidepinelope
 
Trading volume mapping R in recent environment
Trading volume mapping R in recent environment Trading volume mapping R in recent environment
Trading volume mapping R in recent environment Nagi Teramo
 
Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...
Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...
Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...Flink Forward
 
Backtrack tutorial
Backtrack tutorialBacktrack tutorial
Backtrack tutorialkhadikhadi
 
Getting started with power map preview september refresh
Getting started with power map preview september refreshGetting started with power map preview september refresh
Getting started with power map preview september refreshMing Gu
 
A practical guide to implementing tivoli storage manager on as 400 sg245472
A practical guide to implementing tivoli storage manager on as 400 sg245472A practical guide to implementing tivoli storage manager on as 400 sg245472
A practical guide to implementing tivoli storage manager on as 400 sg245472Banking at Ho Chi Minh city
 
Why PostgreSQL for Analytics Infrastructure (DW)?
Why PostgreSQL for Analytics Infrastructure (DW)?Why PostgreSQL for Analytics Infrastructure (DW)?
Why PostgreSQL for Analytics Infrastructure (DW)?Huy Nguyen
 
Jaspersoft and Clarity PPM - Advanced Reporting with Data Warehouse
Jaspersoft and Clarity PPM - Advanced Reporting with Data WarehouseJaspersoft and Clarity PPM - Advanced Reporting with Data Warehouse
Jaspersoft and Clarity PPM - Advanced Reporting with Data WarehouseThiago Bottoni
 
SQL tips and techniques April 2014
SQL tips and techniques April 2014SQL tips and techniques April 2014
SQL tips and techniques April 2014Nick Ivanov
 
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OSPractical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OSCuneyt Goksu
 
Really using Oracle analytic SQL functions
Really using Oracle analytic SQL functionsReally using Oracle analytic SQL functions
Really using Oracle analytic SQL functionsKim Berg Hansen
 
AutoCAD - 3D Notes
AutoCAD - 3D NotesAutoCAD - 3D Notes
AutoCAD - 3D NotesVj NiroSh
 

Similar to Table Partitioning in SQL Server: A Magic Solution for Better Performance? (Pragmatic Works) (20)

MBA
MBAMBA
MBA
 
pdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdf
pdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdfpdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdf
pdfcoffee.com_i-openwells-basics-training-3-pdf-free.pdf
 
From SQL to Pandas
From SQL to PandasFrom SQL to Pandas
From SQL to Pandas
 
Datacolor match textile 1.0 user guide
Datacolor match textile 1.0 user guideDatacolor match textile 1.0 user guide
Datacolor match textile 1.0 user guide
 
Rtips123
Rtips123     Rtips123
Rtips123
 
Trading volume mapping R in recent environment
Trading volume mapping R in recent environment Trading volume mapping R in recent environment
Trading volume mapping R in recent environment
 
Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...
Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...
Flink Forward SF 2017: Shaoxuan Wang_Xiaowei Jiang - Blinks Improvements to F...
 
Backtrack tutorial
Backtrack tutorialBacktrack tutorial
Backtrack tutorial
 
Getting started with power map preview september refresh
Getting started with power map preview september refreshGetting started with power map preview september refresh
Getting started with power map preview september refresh
 
A practical guide to implementing tivoli storage manager on as 400 sg245472
A practical guide to implementing tivoli storage manager on as 400 sg245472A practical guide to implementing tivoli storage manager on as 400 sg245472
A practical guide to implementing tivoli storage manager on as 400 sg245472
 
Why PostgreSQL for Analytics Infrastructure (DW)?
Why PostgreSQL for Analytics Infrastructure (DW)?Why PostgreSQL for Analytics Infrastructure (DW)?
Why PostgreSQL for Analytics Infrastructure (DW)?
 
Jaspersoft and Clarity PPM - Advanced Reporting with Data Warehouse
Jaspersoft and Clarity PPM - Advanced Reporting with Data WarehouseJaspersoft and Clarity PPM - Advanced Reporting with Data Warehouse
Jaspersoft and Clarity PPM - Advanced Reporting with Data Warehouse
 
lum_117_whatsnew_en
lum_117_whatsnew_enlum_117_whatsnew_en
lum_117_whatsnew_en
 
lum_117_whatsnew_en
lum_117_whatsnew_enlum_117_whatsnew_en
lum_117_whatsnew_en
 
SQL tips and techniques April 2014
SQL tips and techniques April 2014SQL tips and techniques April 2014
SQL tips and techniques April 2014
 
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OSPractical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
 
Gdce 2010 dx11
Gdce 2010 dx11Gdce 2010 dx11
Gdce 2010 dx11
 
Really using Oracle analytic SQL functions
Really using Oracle analytic SQL functionsReally using Oracle analytic SQL functions
Really using Oracle analytic SQL functions
 
3 d autocad
3 d autocad3 d autocad
3 d autocad
 
AutoCAD - 3D Notes
AutoCAD - 3D NotesAutoCAD - 3D Notes
AutoCAD - 3D Notes
 

More from Cathrine Wilhelmsen

Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...Cathrine Wilhelmsen
 
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Cathrine Wilhelmsen
 
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)Cathrine Wilhelmsen
 
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...Cathrine Wilhelmsen
 
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)Cathrine Wilhelmsen
 
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)Cathrine Wilhelmsen
 
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)Cathrine Wilhelmsen
 
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...Cathrine Wilhelmsen
 
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...Cathrine Wilhelmsen
 
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)Cathrine Wilhelmsen
 
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Cathrine Wilhelmsen
 
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...Cathrine Wilhelmsen
 
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...Cathrine Wilhelmsen
 
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ..."I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...Cathrine Wilhelmsen
 
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...Cathrine Wilhelmsen
 
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)Cathrine Wilhelmsen
 
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...Cathrine Wilhelmsen
 
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Cathrine Wilhelmsen
 
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Cathrine Wilhelmsen
 

More from Cathrine Wilhelmsen (20)

Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
 
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
 
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
 
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
 
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
 
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
 
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
 
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
 
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
 
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
 
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
 
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
 
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
 
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ..."I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
 
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
 
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
 
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
 
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
 
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
Pipelines and Data Flows: Introduction to Data Integration in Azure Synapse A...
 

Recently uploaded

Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........EfruzAsilolu
 
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling ManjurJual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjurptikerjasaptiker
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...nirzagarg
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制vexqp
 
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制vexqp
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Klinik kandungan
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样wsppdmt
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraGovindSinghDasila
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 

Recently uploaded (20)

Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........
 
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling ManjurJual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
 
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 

Table Partitioning in SQL Server: A Magic Solution for Better Performance? (Pragmatic Works)

  • 1. Table Partitioning in SQL Server A Magic Solution for Better Performance?
  • 3. You? New to table partitioning "Everything is slow" Today? Basic Introduction What, Why & How
  • 4. A Magic Solution for Better Performance? Spoiler Alert!
  • 5. A Magic Solution for Better Performance? Implementing table partitioning is not a trivial task and can actually cause worse performance...
  • 6. A Magic Solution for Better Performance? ...but don't worry, I made plenty of mistakes so you can avoid them 
  • 8. What? Partition Key Partition Function Partition Scheme Why? Backup & Restore Maintenance Load & Archive How? Partition Elimination Switch, Split & Merge Sliding Windows
  • 10. What is a partitioned table? 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... Data is physically stored in groups of rows called partitions Each partition can be accessed and maintained separately Partitioning is not visible to users, it behaves like one logical table
  • 11. Partition Key 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... Data is partitioned based on a single column, the Partition Key The Partition Key should always be used as a filter in queries This ensures Partition Elimination: only relevant partitions are accessed
  • 12. Partition Function 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... The Partition Function defines how to partition the data It specifies boundary values, the points between two partitions It specifies if the boundary value belongs to its left (upper) partition or its right (lower) partition
  • 13. Partition Function: Range Left and Range Right 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ...
  • 14. Partition Function: Range Left and Range Right Range Left means the boundary value is the last value in the left partition CREATE PARTITION FUNCTION pfLeft (INT) AS RANGE LEFT FOR VALUES (20,30,40); Range Right means the boundary value is the first value in the right partition CREATE PARTITION FUNCTION pfRight (INT) AS RANGE RIGHT FOR VALUES (20,30,40); ...20 21-30 41...31-40 ...19 20-39 40...30-39 20 30 40 20 30 40
  • 15. Partition Scheme 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... The Partition Scheme maps logical partitions to physical filegroups Filegroups? Data files on one or more disks Backed up and restored individually Can be Read-Only
  • 16. Map all partitions to one filegroup FILEGROUP 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ...
  • 17. Map partitions to separate filegroups FILEGROUP1 (Read-Only) FILEGROUP2 (Read-Only) 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... FILEGROUP3 FILEGROUP4
  • 18. How are partitions mapped to filegroups? ...20 21-30 41...31-40 ...19 20-39 40...30-39 20 30 40 20 30 40 The partition function specified the boundary values and partitions:
  • 19. How are partitions mapped to filegroups? CREATE PARTITION SCHEME psLeft AS PARTITION pfLeft TO (FG1, FG2, FG3, FG4); CREATE PARTITION SCHEME psRight AS PARTITION pfRight TO (FG1, FG2, FG3, FG4); ...20 21-30 41...31-40 ...19 20-39 40...30-39 20 30 40 20 30 40 The partition scheme uses the partition function...
  • 20. How are partitions mapped to filegroups? CREATE PARTITION SCHEME psLeft AS PARTITION pfLeft TO (FG1, FG2, FG3, FG4); CREATE PARTITION SCHEME psRight AS PARTITION pfRight TO (FG1, FG2, FG3, FG4); ...20 21-30 41...31-40 ...19 20-39 40...30-39 20 30 40 20 30 40 FG1 FG2 FG4FG3 FG1 FG2 FG4FG3 ...to map each partition to filegroups:
  • 21. Filegroups Partition Scheme Partitioned Table 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... A partitioned table is created on a partition scheme instead of directly on a filegroup The partition scheme uses the partition key to store rows in the correct partition and filegroup based on the definition specified in the partition function
  • 24. Partition Elimination SELECT COUNT(*) FROM Table WHERE Year = 2012; SELECT COUNT(*) FROM Table;
  • 25. Partition Elimination SELECT COUNT(*) FROM Table WHERE Year = 2012; SELECT COUNT(*) FROM Table;
  • 26. Backup & Restore Partitions Filegroups can be backed up and restored individually If each partition is mapped to a separate filegroup, partitions with the most critical data can be restored first
  • 27. Backup & Restore Partitions Filegroups can be read-only If each partition is mapped to a separate filegroup, partitions with historical, unchanging data can be excluded from regular backups
  • 28. Index Maintenance per Partition Rebuild and reorganize indexes per partition Rebuild indexes online per partition was introduced in SQL Server 2014 Set data compression per partition ALTER INDEX IndexName ON TableName REBUILD PARTITION = 2 WITH (ONLINE = ON);
  • 29. Statistics Maintenance per Partition Update statistics on specific partitions instead of scanning and updating the whole table UPDATE STATISTICS TableName (StatisticsName) WITH RESAMPLE ON PARTITIONS (3,5); CREATE STATISTICS StatisticsName ON TableName (ColumnName) WITH INCREMENTAL = ON; Incremental Statistics was introduced in SQL Server 2014
  • 30. Load & Archive: Partition Switching Partitions can be switched between tables, called switching in or switching out Partition switching is a metadata operation that updates the location of the data, no data is physically moved Extremely fast compared to inserting into or deleting from a large table 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... 2012-01-01 ... ... 2012-12-31 ... ... ALTER TABLE Table1 SWITCH PARTITION 5 TO Table2 PARTITION 5; SELECT $PARTITION.pf(2014);
  • 31. Load & Archive: Switch out 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... Called switch out when you move data out of a table (archive)
  • 32. Load & Archive: Switch out 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... 2012-01-01 ... ... 2012-12-31 ... ... Called switch out when you move data out of a table (archive)
  • 33. Load & Archive: Switch in 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... 2016-01-01 ... ... 2016-12-31 ... ... Called switch in when you move data into a table (load)
  • 34. Load & Archive: Switch in 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... 2016-01-01 ... ... 2016-12-31 ... ... Called switch in when you move data into a table (load)
  • 35. Sliding Windows The Sliding Windows technique automates data loading, data archiving and partition management It keeps a certain number of partitions by continuously switching out the oldest data and switching in new data 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2012-01-01 ... ... 2012-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ...
  • 36. Sliding Windows: Split & Merge 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... Partitions are not actually added or removed, they are split or merged Be careful! Splitting and merging partitions can cause data movement!!
  • 37. Sliding Windows: Split & Merge 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... Split one partition in two by adding a new boundary value ALTER PARTITION FUNCTION pf () SPLIT RANGE ('2013-06-01'); Data movement will occur if there is data on both sides of the new boundary value!
  • 38. Sliding Windows: Split & Merge 2012-01-01 ... ... 2012-12-31 ... ... 2013-01-01 ... ... 2013-12-31 ... ... 2014-01-01 ... ... 2014-12-31 ... ... 2015-01-01 ... ... 2015-12-31 ... ... Merge two partitions to one by removing a boundary value ALTER PARTITION FUNCTION pf () MERGE RANGE ('2014-01-01'); Data movement will occur if there is data on both sides of the old boundary value!
  • 39. Sliding Windows Steps 1. Add new filegroup and file 2. Create switch out (archive) table 3. Create switch in (load) table and load it with new data 4. Split to add new partition 5. Switch in new partition 6. Switch out old partition 7. Merge to remove old partition 8. Delete switch out and switch in tables 9. Delete old file and filegroup
  • 41. Alternative Sliding Windows Steps 1. Add new filegroup and file 2. Create switch out (archive) table 3. Switch out old partition 4. Merge to remove old partition 5. Create switch in (load) table and load it with new data 6. Split to add new partition 7. Switch in new partition 8. Delete switch out and switch in tables 9. Delete old file and filegroup
  • 43. Case Study: What Went Wrong?
  • 44. Background: Financial Data Warehouse Periodic Snapshot Fact Tables Daily, Weekly and Monthly Balances SQL Server, DB2, Oracle, .csv, .txt Loaded at different times during the day 1 2 3 4 5 6 7 Pension Insurance Bank Fund
  • 45. First version Daily fact table: Keep 1 day per source 1 2 Pension 6 7 Bank Fund Monthly fact table: Keep 36 months per source 3 4 5 Insurance
  • 46. Second version Daily fact table: Keep 1 day per source 1 2 Pension Monthly / Weekly fact table: Keep 36 months for some sources Keep 106 weeks for some sources 3 4 5 Insurance ! 6 7 Bank Fund
  • 47. Third version Daily fact table: Keep 1 day per source 1 2 Pension Monthly / Weekly / Daily fact table: Keep 36 months for some sources Keep 106 weeks for some sources Keep 7 days for some sources 3 4 5 6 7 Insurance Bank Fund !!
  • 50. Daily fact table partitioning 1 ... ... 2 ... ... 3 ... ... 4 ... ... 5 ... ... 6 ... ... 7 ... ... Partition Key: source number One partition per source Helped with deadlock issues Easy to switch data in and out
  • 51. Monthly / Weekly / Daily fact table partitioning 12011 ... ... 12012 ... ... 12013 ... ... 12014 ... ... 19990 ... ... 19991 ... ... 19992 ... ... Partition Key: Source number + Period type Period type: YYYY for monthly data 9991 for weekly data 9992 for daily data Helped with deadlock issues, but…
  • 52. Monthly / Weekly / Daily fact table partitioning 12011 ... ... 12012 ... ... 12013 ... ... 12014 ... ... 19990 ... ... 19991 ... ... 19992 ... ... Partition key was difficult to remember and was not used in queries Data had to be inserted into and deleted from partitions with existing data, instead of switching partitions in and out
  • 53. What went wrong? "The usual suspects": Conflicting priorities, changing requirements and high pressure to deliver on time Fact tables were expanded, not changed, when new sources and requirements were implemented Partitioning was implemented on fact tables with multiple grains, instead of correcting the fact tables first
  • 54. What did we learn?
  • 56. References and Resources: Table Partitioning Brent Ozar Unlimited: SQL Server Table Partitioning Resources brentozar.com/sql/table-partitioning-resources/ Bradley Ball: Partitioning in SQL Server 2012 pragmaticworks.com/Training/FreeTraining/ViewWebinar/WebinarID/541
  • 57. References and Resources: Further Reading Partial Backups in SQL Server 2014 msdn.microsoft.com/en-us/library/ms191539.aspx Piecemeal Restores in SQL Server 2014 msdn.microsoft.com/en-us/library/ms177425.aspx Benjamin Nevarez: SQL Server 2014 Incremental Statistics benjaminnevarez.com/2015/02/2014-incremental-statistics/