February 11, 2012 at 3:51 am
Hi,
My Table contains nearlly Billion records with identity column. while delete records with where clause it's takes several time(more than 10Mins) to delete.
I want to delete the particular records in table quickly.
Is there is any different logic to delete the records more fastly in SQL server.
Regrads,
Sathish.S
February 11, 2012 at 4:27 am
Do you want to delete these records or want to archive to some other tables? For second scenario, Partitioning (SWITCH) will help you. It’s instant operation (metadata only).
If you want to purge the tables (delete all rows) this would be a fast operation as well. You can use TRUNCATE table command.
If you are deleting more than 80% of rows form the billion rows table, insert the remaining data into a temporary table, truncate the table & reinsert the rows back.
Can you please provide the DDL for the table and execution plans for the select statement with the WHERE clause that you are going to use in DELETE statement.
February 11, 2012 at 5:54 am
Is the WHERE clause only based on the identity column only?
What does the WHERE clause look like?
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply