Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Partitioning multiple tables of varying ranges


Partitioning multiple tables of varying ranges

Author
Message
darkhelmutis
darkhelmutis
SSC-Enthusiastic
SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)

Group: General Forum Members
Points: 181 Visits: 840
Everyone-

I am fixing a partitioning gone wrong implementation of a small number of large tables in a data warehouse. The overall setup is the same as any of the multitude of examples provided: partitioning is right ranged based on a date column specific to each table. The actual task of undoing and redoing the partitioning is relatively easy, but I have a question that I have not seen covered in any partitioning articles, blogs, forums, etc.

The current setup partitions every table by year ranging from 2004 to present, however the range covered in the date column for each of these tables varies:

Name Lower Bound Upper Bound
Table1 2009-01-01 00:00:00.000 2013-01-17 22:03:07.000
Table2 2008-02-10 20:00:00.000 2013-01-18 00:00:00.000
Table3 2008-05-01 00:02:37.000 2013-01-17 23:56:52.000
Table4 2008-05-01 00:19:16.000 2013-01-17 23:56:52.000
Table5 2004-03-04 10:19:33.000 2013-01-18 04:47:14.970
Table6 2005-10-05 06:38:54.380 2013-01-17 20:21:08.000
Table7 2005-04-21 09:51:45.000 2013-01-17 23:51:32.090
Table8 2009-08-06 17:30:00.000 2013-01-18 00:00:00.000
Table9 2006-05-15 14:29:05.423 2013-01-18 04:06:19.270
Table10 2004-02-19 15:17:08.000 2013-01-17 22:01:40.000
Table11 2006-08-07 11:36:00.000 2013-01-17 21:59:58.000

So the question I have: after I undo the work already done should I re-partition:

- every table consistently by year from 2004 to present thus creating multiple partitions with 0 records other than the left most partition as documented for use with the sliding window technique?

OR

- each table by year based upon each table's earliest date (i.e. Table1 starts at 2009-01-01, Table2 starts at 2008-01-01, etc) thus leaving only the left most partition with 0 records?

I tend to think sticking with the first one will be easier to create, manage, and maintain, but is there any performance advantage to doing the latter?

DH
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3093 Visits: 4639
In my opinion option #1 would be more elegant.
No performance advantages in going with option #2.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
darkhelmutis
darkhelmutis
SSC-Enthusiastic
SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)

Group: General Forum Members
Points: 181 Visits: 840
Thanks Pablo for your input. I was pretty certain it would be best to partition consistently across all tables. Thanks!
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