Wednesday, March 7, 2012

dbcc dbreindex and update of statistics

I have to set up a nightly job on my database to drop and reindex indexes
on my tables. I am going to use dbcc dbreindex. Does the dbcc dbreindex
also update the statistics on the rebuilt index or do I have to then issue
an update statistics on the table?Index stats are updated automatically when you do a DBCC DBREINDEX.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"Dodo Lurker" <none@.noemailplease> wrote in message
news:s76dnQMf_dnbF4nYnZ2dnUVZ_rqdnZ2d@.comcast.com...
I have to set up a nightly job on my database to drop and reindex indexes
on my tables. I am going to use dbcc dbreindex. Does the dbcc dbreindex
also update the statistics on the rebuilt index or do I have to then issue
an update statistics on the table?|||Dodo Lurker wrote:
> I have to set up a nightly job on my database to drop and reindex indexes
> on my tables. I am going to use dbcc dbreindex. Does the dbcc dbreindex
> also update the statistics on the rebuilt index or do I have to then issue
> an update statistics on the table?
>
Consider using this script, it will rebuild only those indexes that are
badly fragmented, and you can control the method used...
http://realsqlguy.com/serendipity/archives/12-Humpty-Dumpty-Sat-On-A-Wall...html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||That looks like a great script..
I been trying to run dbcc show contig and then decide which ones need to
have dbcc redindex on them.
What the different from dbcc reindex and DBCC INDEXDEFRAG
is there a way to write this to a report so i can see which ones it does
during the process...thanks
"Tracy McKibben" wrote:
> Dodo Lurker wrote:
> > I have to set up a nightly job on my database to drop and reindex indexes
> > on my tables. I am going to use dbcc dbreindex. Does the dbcc dbreindex
> > also update the statistics on the rebuilt index or do I have to then issue
> > an update statistics on the table?
> >
> >
> Consider using this script, it will rebuild only those indexes that are
> badly fragmented, and you can control the method used...
> http://realsqlguy.com/serendipity/archives/12-Humpty-Dumpty-Sat-On-A-Wall...html
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>

No comments:

Post a Comment