Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    6

    Unanswered: "DBCC DBReindex" VS "Update Statistics"

    Hi all,

    Is it neccessay to run the "Update Statistics" after run "DBCC DBReindex"? Does "Update Statistics" automatically update the stats?

    Thanks in advance
    Kim,

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    As you can see DBCC DBREINDEX updates statistics by itself - it is no need to update statistics after DBCC DBREINDEX.

    drop table test
    create table test(id int identity,code varchar(10))
    create index test_i on test(id)
    go
    insert test(code) values('a')
    insert test(code) values('b')
    insert test(code) values('c')
    insert test(code) values('d')
    insert test(code) values('e')
    go
    UPDATE STATISTICS test
    go
    SELECT STATS_DATE(i.id, i.indid)
    FROM sysobjects o, sysindexes i
    WHERE o.name = 'test' AND o.id = i.id and i.name='test_i'
    go
    DBCC DBREINDEX ('test')
    SELECT STATS_DATE(i.id, i.indid)
    FROM sysobjects o, sysindexes i
    WHERE o.name = 'test' AND o.id = i.id and i.name='test_i'
    go

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •