Sql-server – Is it better to shrink a database or defragment to improve performance

performanceshrinksql server

I'm no DBA hence me visiting here. I do however manage an application which writes to a SQL database. We are experiencing poor performance with the application now. Pages taking forever to load up and unexpected odd behaviour such as pages loading that shouldn't etc.

To improve performance would I be better off defragmenting the database or shrinking it? Why is shrinking so bad? Is it possible to explain that in a couple of lines?

Best Answer

To improve performance would I be better off defragmenting the database or shrinking it?

Shrinking will not improve performance de-fragmenting the indexes should increase the performance, if that is really the reson behind the slowness. Shrinking is going to cause massive logical fragmentation so always bear in mind to avoid it. ONLY shrink when you have freed up large amount of space in SQL Server and you need that space at all cost. For all other reasons avoid shrinking

PS: Before going to shrinking at all I would first suggest you to find the cause of problem and Analyzing SQL Server Performance should get you started.