How do we know indexes are corrupted?

  • What can we see, how to detect corrupted indexes?

    Many thanks in advance.

  • When you run the DBCC CHECKDB or DBCC CHECKTABLE, you will the output if there is any corruption...

    MohammedU
    Microsoft SQL Server MVP

  • Before running DBCC commands, could we see anything? In short, could a user feel something wrong?

    Many thanks

  • could a user feel something wrong?

    If you put your right hand near the power supply, and you left hand over the CD drive door, similar to Vulcan mind-meld technique....

    Sorry, but just couldn't resist.



    Mark

  • you may query the data from the table which as corruption...it is hard find anything...

    Some times you know the table/index has corruption but you can query the data....you get the error only your query touch that particular corrupted page/extent/block...

    MohammedU
    Microsoft SQL Server MVP

  • I have found that corruption can become apparent if you interrogate each index in turn.

    eg. For TableA, with indexes 0 ..3

    select count(*) from tableA (nolock,INDEX(0))

    select count(*) from tableA (nolock,INDEX(1))

    select count(*) from tableA (nolock,INDEX(2))

    select count(*) from tableA (nolock,INDEX(3))

    The results of each query should be identical, unless there are updates to the table / corruption.

    DBCC checktable ('TableA') is more elegant though.

     

Viewing 6 posts - 1 through 5 (of 5 total)

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