• sqlfriends (9/23/2012)


    Also for above statement, do you mean when first time import data to a new table, the index is not fragmented, and the statistics is up to date?

    The index won't be fragmented and the stats will be updated on the first access of the table

    But when I second time insert more data into this table, then the index is fragmented and the statistics is out of date?

    Fragmented, maybe. Stats out of date, probably, depending how much of the table has been affected, the stats might be updated the next time the table is queried, or they might not.

    It is often a good idea to do a stats update with fullscan after a large data load, especially if the table is read-heavy the rest of the time.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass