• RVSC48 (9/21/2016)


    Hi Mike,

    What Statistics option if any are you using in the Ola index command?

    ALL - Update index and column statistics.

    INDEX - Update index statistics.

    COLUMNS - Update column statistics.

    NULL - Do not perform statistics maintenance. This is the default.

    RVSC48,

    Do you happen to know--Let's say I'm using Ola's index optimize script with "ALL" for the @UpdateStatistics parameter:

    1) If it recognizes and rebuilds some indexes, will it skip over these when it goes to update "ALL" statistics because these indexes just got a fresh full set of statistics? So really, "ALL" would be ALL minus the recently-rebuilt index statistics?

    Another way of saying it is that I assume it would update the statistics for all of the columns and only the indexes that were re-organized, right?

    2) In scenario #1, I believe a default sampling is used for the statistics update. If so, I could include the @StatisticsSample parameter with a value of "100" and it would do a full scan on on the columns and re-organized indexes, right?

    Ultimately, I want to see how long it's going to take to intelligently re-organize/rebuild indexes (i.e., not take action if there are fewer than 1000 pages, etc.) and update all of the remaining index and column statistics with fullscan--all without doing additional unnecessary work, like updating statistics for indexes that were just rebuilt. Is Ola's script sophisticated enough to ensure that it doesn't duplicate efforts like this?

    Thanks,

    Mike

    Mike Scalise, PMP
    https://www.michaelscalise.com