Statistics

Statistics in SQL Server are very important.  They help the query optimizer decide on the best way to resolve a query.  If they're out-of-date then the query optimizer does not even consider them.  This is very , very bad for performance.

Heres a small T-SQL snippet to update all statistics on a server.  Be careful because although this is less intensive than SQL Server 2000, it can destroy your server performance.  Test it out first.

As a production DBA, I have to run this sometimes when the server has a holiday.  I will also check which are the largest databases and maybe start with the smaller ones first.  If I kick off a profiler trace I can see which database is being particularly naughty.


select 'exec ' + name + '..sp_updatestats' from sys.sysdatabases

...simply cut and paste the output from the bottom pane into the top pane and execute, always, be selective.

After you've run it depnding on the server, you may be able to run...

dbcc freeproccache

this drops the stored procedure plans.  I'd be careful though as you have to know your server and what this does before you execute it.

Being a DBA can be difficult at times, you have to make critical decisions at key moments.  Try and always miniminse risk or put another way, how can I keep my job?