Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Missing Sataistics

Author  Topic 

miranwar
Posting Yak Master

125 Posts

Posted - 2003-04-08 : 14:01:09
Can anyone tell me how Missing statistics come about in SQL 7?

How can i do a mass update to recreate or drop these missing stats ?

Thanks for your help in Advance

Regards,




samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2003-04-09 : 02:53:52
Are you looking for ?
UPDATE STATISTICS
SP_UPDATESTATS

Sekar
~~~~
Success is not a destination that you ever reach. Success is the quality of your journey.
Go to Top of Page

miranwar
Posting Yak Master

125 Posts

Posted - 2003-04-09 : 04:29:48
Thanks..But you see all the stats have gomne missig for some reason..I need to know 1st how do they go missing and how can i recreate these.
Cheers

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-04-09 : 06:14:36

sp_updatestats will recreate all statistics in the database (just the indexes if you have lost all statistics).
It runs update statistics against all tables.

As to how you have lost all the statistics?????
That's weird. They are held in sysindexes with name _WA_.... - have you looked to see if there are any there?


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

miranwar
Posting Yak Master

125 Posts

Posted - 2003-04-10 : 05:51:58
I have read that the Create Auto Statistics property creates stats on the fly for queries. And they are deleted by SQL SERVER when no longer needed.
However I am still unclear about one thing. Am I right to believe that running sp_updatestats will remove unwanted stats that the query optimiser thinks are no longer needed. Do u know the criteria as to when stats will be removed?. And also will there be an overhead on SQL server when it has to recreate them again?



Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-04-10 : 07:45:04
If you need to maintain statistics on tables/columns, just create them manually with CREATE STATISTICS. They will remain available until you DROP STATISTICS on them. Don't rely on SQL Server to maintain auto-created stats if you really need them; create them yourself.

Go to Top of Page
   

- Advertisement -