0

The total database size is 500GB. In this database all most 250 GB is taking indexes and Inactive data.

Now I want to remove the Inactive Data? Is there any methods or architect to remove the inactive data?

Right now, I removed the data using below commands

delete TOP(1000) from TableName

After removed all the records, I applied the shrink file to release the space but I am facing to much slowness on Database side.

Any one have idea how can I remove the slowness on database?

  • 1
    What is your definition of 'Inactive data'? – Georgi Raychev Apr 13 '17 at 11:18
  • `delete TOP(1000) from TableName?`?? This deletes 1000 *arbitrarily chosen* records from the table. – Thorsten Kettner Apr 13 '17 at 11:19
  • @GeorgiRaychev: Inactive means soft delete records. –  Apr 13 '17 at 11:28
  • @ThorstenKettner : yes. actual query is delete top(10000) from tablename where isactive=1 –  Apr 13 '17 at 11:29
  • 1
    But why would you have the DBMS choose rows arbitrarily? Why not delete *all* inactive records or the *oldest* 10000 inactive records instead of 10000 *randomly chosen* inactive records? – Thorsten Kettner Apr 13 '17 at 11:31
  • @ThorstenKettner if I take all records then its increase the log file size that's why I have used the top. space is limited –  Apr 13 '17 at 11:43
  • Maybe this answer here helps: http://stackoverflow.com/questions/24213299/how-to-delete-large-data-of-table-in-sql-without-log – Thorsten Kettner Apr 13 '17 at 12:17
  • @nirav if you can provide us with the _schema_ of the table, people can help you out exactly. Just a headsup if there is any **date/identity** column you can use that to remove the older rows based on that. – DataWrangler Apr 13 '17 at 15:19

0 Answers0