Showing posts with label shrinking. Show all posts
Showing posts with label shrinking. Show all posts

Wednesday, March 21, 2012

Database shrink operation

Hi,
I am confused whether database shrinking operation also does reindexing or
rebuilding of indexes in background when it runs because, shrink operation
affects the data page location on disk caused by their movement.
Thanks
ManuManu,
Shrinking a database does not redo the indexes, it just moves pages around.
One result is that the shrink can hurt performance since the data needed for
a search may no longer be contiguous, which increases disk activity.
If this is a concern (and normally it should be), shrink first, then rebuild
the indexes. Rebuilding the indexes will give up some of space savings, but
it will make your users happier with the performance.
RLF
"manu" <manu@.discussions.microsoft.com> wrote in message
news:8DD71F01-C93E-4533-B947-1A14A1BE891D@.microsoft.com...
> Hi,
> I am confused whether database shrinking operation also does reindexing or
> rebuilding of indexes in background when it runs because, shrink operation
> affects the data page location on disk caused by their movement.
> Thanks
> Manu|||manu
Start with
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
"manu" <manu@.discussions.microsoft.com> wrote in message
news:8DD71F01-C93E-4533-B947-1A14A1BE891D@.microsoft.com...
> Hi,
> I am confused whether database shrinking operation also does reindexing or
> rebuilding of indexes in background when it runs because, shrink operation
> affects the data page location on disk caused by their movement.
> Thanks
> Manu

Database shrink operation

Hi,
I am confused whether database shrinking operation also does reindexing or
rebuilding of indexes in background when it runs because, shrink operation
affects the data page location on disk caused by their movement.
Thanks
ManuManu,
Shrinking a database does not redo the indexes, it just moves pages around.
One result is that the shrink can hurt performance since the data needed for
a search may no longer be contiguous, which increases disk activity.
If this is a concern (and normally it should be), shrink first, then rebuild
the indexes. Rebuilding the indexes will give up some of space savings, but
it will make your users happier with the performance.
RLF
"manu" <manu@.discussions.microsoft.com> wrote in message
news:8DD71F01-C93E-4533-B947-1A14A1BE891D@.microsoft.com...
> Hi,
> I am confused whether database shrinking operation also does reindexing or
> rebuilding of indexes in background when it runs because, shrink operation
> affects the data page location on disk caused by their movement.
> Thanks
> Manu|||manu
Start with
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
"manu" <manu@.discussions.microsoft.com> wrote in message
news:8DD71F01-C93E-4533-B947-1A14A1BE891D@.microsoft.com...
> Hi,
> I am confused whether database shrinking operation also does reindexing or
> rebuilding of indexes in background when it runs because, shrink operation
> affects the data page location on disk caused by their movement.
> Thanks
> Manu

Database shrink operation

Hi,
I am confused whether database shrinking operation also does reindexing or
rebuilding of indexes in background when it runs because, shrink operation
affects the data page location on disk caused by their movement.
Thanks
Manu
Manu,
Shrinking a database does not redo the indexes, it just moves pages around.
One result is that the shrink can hurt performance since the data needed for
a search may no longer be contiguous, which increases disk activity.
If this is a concern (and normally it should be), shrink first, then rebuild
the indexes. Rebuilding the indexes will give up some of space savings, but
it will make your users happier with the performance.
RLF
"manu" <manu@.discussions.microsoft.com> wrote in message
news:8DD71F01-C93E-4533-B947-1A14A1BE891D@.microsoft.com...
> Hi,
> I am confused whether database shrinking operation also does reindexing or
> rebuilding of indexes in background when it runs because, shrink operation
> affects the data page location on disk caused by their movement.
> Thanks
> Manu
|||manu
Start with
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
"manu" <manu@.discussions.microsoft.com> wrote in message
news:8DD71F01-C93E-4533-B947-1A14A1BE891D@.microsoft.com...
> Hi,
> I am confused whether database shrinking operation also does reindexing or
> rebuilding of indexes in background when it runs because, shrink operation
> affects the data page location on disk caused by their movement.
> Thanks
> Manu
sql

Database Shrink

Hi,

Does database shrinking require all requisites that are necessary for compacting (like additional free space and closed database) ?
And is there any programmatic way to estimate optimized database size regarding current database size, like it was done by special tool in SQL Management Studio?
The various aspcects of SQL CE database maintenance are covered here: http://msdn2.microsoft.com/en-us/library/ms172411(SQL.90).aspx There is both Compact and Autoshrink features. No tools exists for estimating space to be recovered, but you can tune Autoshrink via your connection string. Autoshrink works "automatically", and does not require closed connections or additional free space.