views:

47

answers:

1

I am trying to do some basic maintenance on a sql server 2005 database. It's fairly small (10gb in size, 50 tables or so).

I am first doing the following on all tables:

update statistics [table name] with fullscan

followed by reindexing all tables.

DBCC REINDEX ([table name], ...)

Is this correct? Is the sequence right? Do I need to do both or is one enough?

+1  A: 

You can do these steps in your database, but it depends whether they are needed or not.

For example if your database is configured to automatically update statistics, the first step usually will not be needed. (This first step can also be done easier by running the sp_updatestats stored procedure.)

The second step (recreating the indexes) is an expensive step, and I would only consider doing it, if there are performance problems with the database.

treaschf