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 2008 Forums
 Transact-SQL (2008)
 Rebuild indexes and Update Statistics?

Author  Topic 

NguyenL71
Posting Yak Master

228 Posts

Posted - 2012-04-23 : 17:08:41
[code]I want to clarify something, I usually scheduled maintenance job on a daily basis #1 but recently one of the developer in a company said when
you rebuild indexes, you need to update statistics with FULLSCAN otherwise, the fragementation still exist and the script he got from MS Tech Support to
update statistics with FULLScan. I just want your opinions which one is the correct to use. I am not always 100% believe in MS Tech Support.
As I read through many articles before, they even said you don't need to run update statistics after you rebuild indexes. SQL2005/2008.


Definition of FULLSCAN:
FULLSCAN: option is used to specify all the rows in a table should be retrived to generate the key distribution statistics.

Ex:

--1 ( daily)

ALTER INDEX ALL ON T1 REBUILD;
UPDATE STATISTICS T1 WITH ALL;
go


--2 (Weekly)

UPDATE STATISTICS T1 WITH FULLSCAN;
go[/code]

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-04-23 : 17:39:32
read this up

http://www.sqlskills.com/BLOGS/KIMBERLY/post/Disk-space-is-cheap.aspx

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -