• jitendra.padhiyar (1/8/2013)


    Thanks a lot Arjun !

    You explain me what exactly statisc is and what the sql server doing during update statics. Can you pls clear my more doubts?

    1. Is it using indexing and sorting for this process ?

    2. Is it using TempDB for data collection (for static purpose) ?

    Thnx in advance,

    Jitendra

    1. Statistics are a very small data set representing the selectivity/density and the histogram, or distribution, of the first column of the data defined by the statistic. This is true if it's on an index or just a set of statistics created automatically on a column referenced in a filtering clause in T-SQL code. It doesn't rearrange data, so no sorting is done. It does read the data, either in a sampled fashion, or by scanning the entire table for the column(s) defined by the statistic. Statistics are part of indexes, but they are separate from them.

    2. Just about every process hits tempdb to one degree or another. I wouldn't be surprised if this one does too. But, again, the statistics are a very small data set, 200 rows, so updating them usually is not a major process unless we're talking hundreds of millions of rows of data.

    "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