March 19, 2010 at 12:57 pm
I read Lynn's article and got a few ideas based on the article and discussions that were done. I like the partition idea, since it seems to be quicker and can be done Live. I'll have to research and familiarize myself with it. I also liked Lynn's suggestion with the 'waitfor delay'.
March 19, 2010 at 1:09 pm
Partitions are great, but you have to running the Enterprise Edition to use them. So, with that, are you running SQL Server 2005 Enterprise Edition?
March 19, 2010 at 1:44 pm
No, i am not running Enterprise edition......I am working on Standard edition 🙁
March 19, 2010 at 2:04 pm
ncodner (3/19/2010)
@WayneS - you're saying if I do the deletion in a loop there will be no locks on the table? Is this better than specifying 'no lock' in the query?
No, I'm saying that if you delete all 2 million rows at once, there will be one big table lock. Deletions still require locks, the looping is to minimize the duration and even possible the extent.
I had forgotten all about Lynn's article... purging the t-log is something you might definitely want to consider doing with deleting 2 million rows.
@paul-2 - what, do you have encyclopedic knowledge of all articles published here? You just keep pulling out all these great links! 😎
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 19, 2010 at 9:28 pm
Lynn Pettis (3/19/2010)
Partitions are great, but you have to running the Enterprise Edition to use them. So, with that, are you running SQL Server 2005 Enterprise Edition?
If think ncodner was referring to the idea of partitioning the deletes into batches, rather than table partitioning per se.
I may be wrong :unsure:
March 19, 2010 at 9:29 pm
WayneS (3/19/2010)
@Paul - what, do you have encyclopedic knowledge of all articles published here? You just keep pulling out all these great links! 😎
Well it is easier than doing the work myself 😛
March 19, 2010 at 9:31 pm
Lynn Pettis (3/19/2010)
First, I want to thank Paul for referencing my article and the nice comments regarding it as well.
You are welcome - it is a good article. Funny how this question seems to be coming up a lot again recently.
March 20, 2010 at 12:17 am
Paul White NZ (3/19/2010)
Lynn Pettis (3/19/2010)
Partitions are great, but you have to running the Enterprise Edition to use them. So, with that, are you running SQL Server 2005 Enterprise Edition?If think ncodner was referring to the idea of partitioning the deletes into batches, rather than table partitioning per se.
I may be wrong :unsure:
Hard to say, but I do recall in the discussion on my article that using partitions to switch out records to be deleted was brought up and ncodner did indicate that he had also read the discussion. Based on that, I made the assumation that he meant partitions as in partitioned tables.
I may have been mistaken, myself.
March 20, 2010 at 6:54 pm
Lynn Pettis (3/19/2010)
Partitions are great, but you have to running the Enterprise Edition to use them. So, with that, are you running SQL Server 2005 Enterprise Edition?
It turns out we aren't, so that idea is scrapped...
March 20, 2010 at 7:07 pm
Lynn Pettis (3/20/2010)
Paul White NZ (3/19/2010)
Lynn Pettis (3/19/2010)
Partitions are great, but you have to running the Enterprise Edition to use them. So, with that, are you running SQL Server 2005 Enterprise Edition?If think ncodner was referring to the idea of partitioning the deletes into batches, rather than table partitioning per se.
I may be wrong :unsure:
Hard to say, but I do recall in the discussion on my article that using partitions to switch out records to be deleted was brought up and ncodner did indicate that he had also read the discussion. Based on that, I made the assumation that he meant partitions as in partitioned tables.
I may have been mistaken, myself.
I did mean partitions in partitioned tables. But since we don't have enterprise edition I started doing the delete in batches based on Lynn's method posted in her article. So thanks again Paul for the reference to Lynn's article and thanks Lynn for your article 🙂
P.S. I'm female, guess I should change my display name/nick name lol
March 20, 2010 at 8:24 pm
Natalie C (3/20/2010)
Lynn Pettis (3/20/2010)
Paul White NZ (3/19/2010)
Lynn Pettis (3/19/2010)
Partitions are great, but you have to running the Enterprise Edition to use them. So, with that, are you running SQL Server 2005 Enterprise Edition?If think ncodner was referring to the idea of partitioning the deletes into batches, rather than table partitioning per se.
I may be wrong :unsure:
Hard to say, but I do recall in the discussion on my article that using partitions to switch out records to be deleted was brought up and ncodner did indicate that he had also read the discussion. Based on that, I made the assumation that he meant partitions as in partitioned tables.
I may have been mistaken, myself.
I did mean partitions in partitioned tables. But since we don't have enterprise edition I started doing the delete in batches based on Lynn's method posted in her article. So thanks again Paul for the reference to Lynn's article and thanks Lynn for your article 🙂
P.S. I'm female, guess I should change my display name/nick name lol
Doesn't always help, I'm a guy. Most of the time when we use the term "he", it should be taken gender neutral.
March 20, 2010 at 10:42 pm
Natalie C (3/20/2010)
I did mean partitions in partitioned tables. But since we don't have enterprise edition I started doing the delete in batches based on Lynn's method posted in her article. So thanks again Paul for the reference to Lynn's article and thanks Lynn for your article 🙂
I made that mistake originally too...Lynn is male. I had never come across anyone male called 'Lynn' (as opposed to Lynne) before visiting this site. Maybe the usage is unique to America?
P.S. ...guess I should change my display name/nick name lol
Thanks for explaining - I was confused there for a moment!
March 22, 2010 at 5:38 am
I have used simple while loop logic while inserting million records into a table. Its a data migration project to move the data from the old database to a newly designed database.
This batch insert really helped a lot while inserting records. I guess similar while loop logic can be written for this deletion too
March 22, 2010 at 6:05 am
Easiest way? There are several and these work in 2000, 2005, 2008. This has not been tested in 2008 r2.
Method 1:
Involves taking hammer to harddrive
Method 2:
harddrive + lighter fluid + match
method 3:
bucket + battery acid
Same speed of record deletion regardless of recordsize.
March 22, 2010 at 7:21 am
David-Leibowitz (3/22/2010)
Easiest way? There are several and these work in 2000, 2005, 2008. This has not been tested in 2008 r2.Method 1:
Involves taking hammer to harddrive
Method 2:
harddrive + lighter fluid + match
method 3:
bucket + battery acid
Same speed of record deletion regardless of recordsize.
Confirmed as effective on R2 :laugh:
Viewing 15 posts - 16 through 30 (of 30 total)
You must be logged in to reply to this topic. Login to reply