January 18, 2013 at 9:40 am
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:
NameLower BoundUpper Bound
Table12009-01-01 00:00:00.0002013-01-17 22:03:07.000
Table22008-02-10 20:00:00.0002013-01-18 00:00:00.000
Table32008-05-01 00:02:37.0002013-01-17 23:56:52.000
Table42008-05-01 00:19:16.0002013-01-17 23:56:52.000
Table52004-03-04 10:19:33.0002013-01-18 04:47:14.970
Table62005-10-05 06:38:54.3802013-01-17 20:21:08.000
Table72005-04-21 09:51:45.0002013-01-17 23:51:32.090
Table82009-08-06 17:30:00.0002013-01-18 00:00:00.000
Table92006-05-15 14:29:05.4232013-01-18 04:06:19.270
Table102004-02-19 15:17:08.0002013-01-17 22:01:40.000
Table112006-08-07 11:36:00.0002013-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
January 18, 2013 at 1:39 pm
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.January 21, 2013 at 1:03 pm
Thanks Pablo for your input. I was pretty certain it would be best to partition consistently across all tables. Thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply