Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 Strategies
»
Dual Column Partitioning
Dual Column Partitioning
Rate Topic
Display Mode
Topic Options
Author
Message
bhushanvinay
bhushanvinay
Posted Friday, January 08, 2010 3:50 AM
Old Hand
Group: General Forum Members
Last Login: Wednesday, July 11, 2012 6:35 AM
Points: 329,
Visits: 194
Need Help With Partitioning.
I have a Table
Create Table OrdersFromSystemsFeedTable
(
InternalOrderID,
SystemOrderID,
ExternalSystemName,
OrderDate,
IsProcessed,
)
Need to remove data which is 3 months old, Huh!! Dodle, easy to do this, Catch !! how to make sure that the data which is not processed which is older than 3 months is not archived via Paritioning.
Is there a way this can be done or I am barking the wrong tree.
Kind regards
Vinay
Feed Table is huge 30M Records and 5M Each month growth Stats.
Regards
Vinay
Post #844190
ALZDBA
ALZDBA
Posted Friday, January 08, 2010 4:43 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 2:13 PM
Points: 6,866,
Visits: 8,071
the query will provide the same results. partitioned or not.
If you are refering to the sliding window technique, off course, you should first check it the partition only contains data to be removed before doing it to a full partition.
Johan
Jul 13
Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere
-
How to post Performance Problems
-
How to post data/code to get the best help
-
How to prevent a sore throat after hours of presenting ppt ?
"press F1 for solution", "press
shift
+F1 for urgent solution"
Need a bit of Powershell? How about
this
Who am I ?
Sometimes this is me
but
most of the time this is me
Post #844206
bhushanvinay
bhushanvinay
Posted Friday, January 08, 2010 5:10 AM
Old Hand
Group: General Forum Members
Last Login: Wednesday, July 11, 2012 6:35 AM
Points: 329,
Visits: 194
Let me Re - query the same,
The idea is to have 3 paritions for each month when we hit the limit then remove the last partition, Issue here is when we do that we dont want the Isprocessed Flag rows to be gone they should be still in the DB and available online.
Sliding window is what i am looking for But the Partition function can be done only on one column AFAIK.
Is there any Stratergy? which you guys are already using.
I can write a proc for purge, This table is a aggregation of different Orders from different vendors.
That gives a lot more control but its not fast as Sliding window Archiving process. How to do a Sliding window with conditional data? is there a way to do this.
Regards
Vinay
Post #844213
ALZDBA
ALZDBA
Posted Friday, January 08, 2010 5:35 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 2:13 PM
Points: 6,866,
Visits: 8,071
Don't shoot me if it doesn't perform as expected.
You could add a persisted derived column and partition on the combination of the flagprocessed and the stringconverted datetime combined..
Keep min mind this will shift rows from one partition to another whenever the flagprocessed is modified !
Johan
Jul 13
Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere
-
How to post Performance Problems
-
How to post data/code to get the best help
-
How to prevent a sore throat after hours of presenting ppt ?
"press F1 for solution", "press
shift
+F1 for urgent solution"
Need a bit of Powershell? How about
this
Who am I ?
Sometimes this is me
but
most of the time this is me
Post #844215
Paul White
Paul White
Posted Saturday, January 09, 2010 8:25 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 2:43 PM
Points: 10,990,
Visits: 10,576
1. Using a (persisted) computed column would be my preference also. If the date portion is placed first in the compound field, you could arrange the partition function so that changing the processed status only results in a change of partition for rows older than 3 months. You would then just not archive partitions in the pre-3-month range which hold unprocessed rows. To minimize data movement when crossing the 3-month boundary, ensure that processed rows stay in the same partition as they age.
2. Assuming that there are relatively few unprocessed rows older than 3 months, another strategy might be to temporarily move the unprocessed rows older than 3 months to a temporary table or variable just before the partition is archived, and then re-insert them afterward.
Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #844893
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.