SQL Server Performance

Restoring Database and Rebuilding of indexes.

Discussion in 'Performance Tuning for DBAs' started by gregth, Dec 11, 2007.

  1. gregth New Member

    This may seem a simple question as such but does a full backup and restore of a database rebuild table indexes and update statistics? We were seeming some slow query response times for a copy of the database running on a production server compared to the test server. We ran profiler trace, looked at execution plans and dbcc showcontig between the two databases and everything is pretty much the same except the same query in production was over 10 times slower than the one ran in the test environment with the same hardware. So in a rather desperate measure we did a full backup and then restore of the production database and now the same query is running about the same time as the test server. Hence my question about table indexes and statistics?
    Thanks in advance
  2. martins New Member

    Table indexes are definitely not rebuilt during a backup/restore. I don't think index statistics are updated when you do a backup and restore (unless it is part of a maintenance job and you choose that option).
    What might have happened in your case (I could be wrong), is that you had some fragmentation that was sorted when restoring the database.

Share This Page