August 16, 2011 at 1:13 am
HI All
The question is what happens to the statistics information , when a database is restored from an environment to the other without the stats related configuration in the Restore command.
Also where are these statistics stored in the db?
The reason for this question is , recently we restored a production db to test environment and found that the stats are all outdated.Should they have not come over with the DB itself?
August 16, 2011 at 1:27 am
August 16, 2011 at 1:36 am
Sometimes i have seen the restoration happened from lower version to higher version has this problem.
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
August 16, 2011 at 1:51 am
Production stats are pretty much uptodate.
August 16, 2011 at 3:38 am
koustav_1982 (8/16/2011)
HI AllThe question is what happens to the statistics information , when a database is restored from an environment to the other without the stats related configuration in the Restore command.
Also where are these statistics stored in the db?
The reason for this question is , recently we restored a production db to test environment and found that the stats are all outdated.Should they have not come over with the DB itself?
The backup / restore stats command only keeps you posted about the progress of the command (10% done). Nothing to do with real stats.
The restore is a perfect copy of the db at the end of the backup. Index, stats & all.
August 17, 2011 at 5:27 am
Statistics are stored with the database. They will be the same on the restored database as they were on the backed up database. This is true even between versions, except, if you restore to a new version the stats will be rebuilt as they get accessed because they are stored differently in newer versions of SQL Server. But the restore operation doesn't affect statistics, ever.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply