Index Size Question

  • Hello,

    I have a question about space used by a table index.

    The result returned by sp_spaceused is twice the value of that computed from the sysindexes table using the (used column).

    Why this discrepancy? And how can it be synchronized?

    Thanks

  • Spaceused can get out of sync with reality, especially on SQL 2000. I've had it reporting negative space used on a table.

    Run DBCC updateusage on that index and see if it fixes the problem.

    Syntax

    DBCC UPDATEUSAGE

    ( { 'database_name' | 0 }

    [ , { 'table_name' | 'view_name' }

    [ , { index_id | 'index_name' } ] ]

    )

    [ WITH [ COUNT_ROWS ] [ , NO_INFOMSGS ]

    ]

    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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply