Sql-server – performance benefits of shrinking a database

sql server

I have a database of 1.5 TB, which had only 200 GB free space before.Due to performance issues, business decided to reduce 1 month data retention policy to 1 week.Due to this 3 weeks data was deleted and now it has 700 GB free space.

The 500 GB free space increased due to data delete is no more required, and there no chance to grow data again to occupy this 500 GB space.

I am planning to shrink the database(using shrink file command ) and run index optimization process to rebuild indexes, if fragmentation is greater than 30%.
The released space wont be used by other systems, however can be used for log file and temp db growth efficiently in near future.

Is there any benefits on performance by reducing the size of database, other than space release ?

Previous questions related to shrinking(in stack exchange) does not properly answer to my queries.

Thanks in advance for your kind reply !!!

Best Answer

If you are maintaining your indexes as you say, there will be no performance benefit.

Performance will actually get worse from shrinking, and your next index rebuild job will likely have significantly more work to do than usual.

The most common reason people think that the shrinking of a database works to increase performance is because the engine has to read fewer pages for queries, however by shrinking you're not actually freeing up any pages, you're just shifting them around in the database, leading to fragmentation and degraded performance. You do reduce the overall number of pages for the database, but not the number of used pages holding data.

Another point is it's likely to take an extremely long time to shrink that database, due to the shrink process being a single-threaded process. It will likely also cause performance issues during the shrink, and potentially blocking.

Check out When is it OK to shrink a database DBA SE question

I would highly recommend against shrinking.

One option for you might be to transfer the data into a fresh, empty copy of the same database, then delete the old one - this is likely to be quicker and tidier.