April 30, 2010 at 9:27 pm
This question may be purely academic. But take a large table that's collected years of data already, hundreds of thousands of rows. The law of large numbers dictates in that the data contained therin will follow a normal distribution.
Statistics keeps track of indexed and key columns, and assuming we don't have a bunch of varchar(255) index colums, we shouldn't see any surprizes.
Aside from keeping a count of the number of rows in the table is it very important to maintain statistics regularly on these types of tables, and if so why?
Keith Wiggans
April 30, 2010 at 11:06 pm
Have the best of both worlds... from Books Online...
In SQL Server 2005, sp_updatestats updates only those statistics that require updating based on the rowmodctr information in the sys.sysindexes compatibility view; therefore, preventing unnecessary updates of unchanged items.
I'm not sure if that means that you need a "0" in the rowmodctr column or if there's some percentage threshold. I do know that left to themselves, statistics update themselves when something like 20% of the data has changed. Not sure if that applies to sp_updatestats but it seems reasonable that it may.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 3, 2010 at 1:44 am
kwiggans (4/30/2010)
This question may be purely academic...
No, you raise a number of important points. Rather than try to summarise an entire White Paper here, forgive me for just providing a link:
Statistics and the Query Optimiser
It is a reasonably long document, but quite information-dense, and you will find all the details you seek there.
Prepare for some surprises 😉
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply