SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Automate Sliding Window Partition Management: Part I


Automate Sliding Window Partition Management: Part I

Author
Message
Hugh Scott
Hugh Scott
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 Visits: 190
Comments posted to this topic are about the item Automate Sliding Window Partition Management: Part I



johan.klovstedt
johan.klovstedt
SSC Journeyman
SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)

Group: General Forum Members
Points: 90 Visits: 20
How about the case when new data starts to fill your topmost partition? How do you avoid unnecessary data movement?

When I implemented partitioning I had 2 topmost partitions and a SQL Agent Job running a SSIS package to react on the fullness of the second topmost partition. If it were getting full then we split the topmost partition. Only to avoid any kind of data movement.


/Johan Klövstedt
Hugh Scott
Hugh Scott
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 Visits: 190
This article is actually in three parts. The next two parts describe automation of partition maintenance (adding partitions at the "top" and removing partitions from the "bottom").

My understanding is that they will be published next week and the week after.

Regards,

Hugh Scott



bpportman 52825
bpportman 52825
Mr or Mrs. 500
Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)Mr or Mrs. 500 (540 reputation)

Group: General Forum Members
Points: 540 Visits: 400
Awesome. This is really timely. I just got Enterprise approved so I can implement partitioning and this series is going to be a huge help. Is the Powershell script coming in one of the next articles. I didn't see it with this article.
alen teplitsky
alen teplitsky
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19843 Visits: 4848
can you partition a table where you keep say 30-45 days of data. have it partition by day or week to make deletes and inserts faster?
Victor Alcazar-Vihho...
Victor Alcazar-Vihho Technology
Valued Member
Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)Valued Member (73 reputation)

Group: General Forum Members
Points: 73 Visits: 114
Excellent overview of Partitioning and Sliding-Window by Kimberly Tripp that provides background into why, how and technical implementation details.


http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx

peter-757102
peter-757102
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4299 Visits: 2559
The article states the following:

First off, you need SQL Server Enterprise Edition or Developer Edition. None of the other editions of SQL Server 2005 or 2008 support partitioning. SQL Server 2000 and earlier do not support partitioning at all.

This is not entirely correct, the devil is in the details!

Partitioning is supported, I believe all the way back to SQL Server 2000, but it works in an entirely different way then the more advanced method of partitioning functions. Which are indeed only available in Developer and Enterprise versions.

Here is an old script that I posted once on SQL ServerCentral.com to demonstrate partitioning at work using noting but several partition tables and a view to unify them as if they were one large table. And yes, you can insert in such views without writing any instead-of trigger on your part.

Some not so obvious restrictions (there always are those, sigh):

* When inserting records, you need to specify all columns, even those that accept NULL values.
* You cannot do a modification trough the view when the query also uses a "select" that references the unified view or one of its patritions.

The script is attached as a file for ease of use and contains some comments to help people on their way.
Attachments
simple_partitioning.zip (69 views, 1.00 KB)
amenjonathan
amenjonathan
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1572 Visits: 434
Are there any performance concerns when partitioning with a single filegroup apart from the restrictions on I/O increases from not using multiple disks? We're about to implement a partitioned table, and it looks like we're using just one filegroup. Every document I read talks on and on using 1 filegroup per 1 file, but I can't find much if any info on single filegroup solutions.

Secondly, I've read if you add an index to a partitioned table and you do not add the partitioned column to the index, SQL will add the partitioned column anyway in the background, thereby making any index added to a partitioned table aligned by default. Need some clarity on this point as well, because it has been suggested we do not need to add the partitioned column because of this. I would like to add it regardless just to be sure. Can't do that unless there's a reason.

-------------------------------------------------------------------------------------------------
My SQL Server Blog
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (175K reputation)SSC Guru (175K reputation)SSC Guru (175K reputation)SSC Guru (175K reputation)SSC Guru (175K reputation)SSC Guru (175K reputation)SSC Guru (175K reputation)SSC Guru (175K reputation)

Group: General Forum Members
Points: 175601 Visits: 18671
Thanks for the article. I have a use for it already.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

Lamprey13
Lamprey13
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3938 Visits: 1657
peter-757102 (12/14/2010)
The article states the following:

First off, you need SQL Server Enterprise Edition or Developer Edition. None of the other editions of SQL Server 2005 or 2008 support partitioning. SQL Server 2000 and earlier do not support partitioning at all.

This is not entirely correct, the devil is in the details!

Partitioning is supported, I believe all the way back to SQL Server 2000, but it works in an entirely different way then the more advanced method of partitioning functions. Which are indeed only available in Developer and Enterprise versions.
<snip>
That is called a Partitioned View. Although it looks similar, it is different from Partitioned Tables.

@Hugh, does the other parts of your article disucss what happens to the data and you move partions around? Or more importantly, how to avoid data movement? I think this is one area of Partioned Tables that really bites people who don't understand how/why Microsoft setup partioned tables like they did.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search