Presentation is loading. Please wait.

Presentation is loading. Please wait.

Beginner Table Partitioning

Similar presentations


Presentation on theme: "Beginner Table Partitioning"— Presentation transcript:

1 Beginner Table Partitioning
Robert Smith

2 Sources: Partitioned Table and Index Strategies Using SQL Server 2008*** Partitioned Tables and Indexes (SQL 2012)

3 Table Partitioning What is this all about? How do I set it up?
How do I use it?

4 What is this all about? (benefits)
Transferring large subsets of data quickly Maintenance in parallel Improve query performance

5 How do I set it up (What do I need to know?)
What are the pieces I need? Partition function Partition scheme Partition key column What are aligned indexes and should I use them? Aligned indexes are built on the same partitioning scheme as the table they belong to

6 How do I set it up (partition functions)
Left vs. Right -∞ ∞ Left Right CREATE PARTITION FUNCTION [pf_MonthlyByDate](datetime) AS RANGE RIGHT FOR VALUES ( N' ', N' ', N' ', N' ' )

7 How do I set it up (partition scheme)
CREATE PARTITION SCHEME ps_MonthlyByDate AS PARTITION pf_MonthlyByDate ALL TO ([PRIMARY]) vs. CREATE PARTITION SCHEME ps_MonthlyByDate AS PARTITION pf_MonthlyByDate TO ([PRIMARY],[PRIMARY],[PRIMARY],n...) or CREATE PARTITION SCHEME ps_MonthlyByDate AS PARTITION pf_MonthlyByDate TO ([FG1],[FG2],[FG3],n...)

8 How do I set it up (apply to a table)
Create a table on the partition scheme that uses a partition function When should I use the Partitioning Wizard vs. hand coding it?

9 How do I use it (merge and spilt the function)
SWITCH data in and out SPLIT RANGE ALTER PARTITION SCHEME [ps_MonthlyByDate] NEXT USED [PRIMARY]; ALTER PARTITION FUNCTION [pf_MonthlyByDate]() SPLIT RANGE (' '); MERGE RANGE ALTER PARTITION FUNCTION [pf_MonthlyByDate]() MERGE RANGE (' ');

10 Thank You Sponsors Platinum Gold Silver Bronze Swag 4/2/2016


Download ppt "Beginner Table Partitioning"

Similar presentations


Ads by Google