Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

What cause a negative index size?

I currently have a database that shows a number of tables with negative index sizes. When I run the following command in the query analyzer: exec sp_MSForEachTable 'EXEC sp_spaceused @objname=''?'' '
I get weird results like:
Table Rows Reserved    Data    Index Size  Unused
TableA 2542349 185024 KB    184552 KB    -8 KB   480 KB
TableB 7810227 2060632 KB  2022464 KB  -96 KB   38264 KB

A little history. TableB had grown to 15 times it's current size and had the same data it currently has. The index size was 4 times larger than the data even though the table had no indexes. It is a staging table and gets wiped and reloaded daily. It was causing a space crunch on the server. I shrunk the data and log files and the table size didn't change. I then ran a dbbc reindex and a dbbc indexdefrag on the table and then shrunk the files again. That's when I got the results above.
I have my space back but now I have these negative indexes. In my mind this is an impossibility.  Can anyone shed some light on what might have caused this, what it means, and how it can be fixed.
0
EVANFAGER
Asked:
EVANFAGER
  • 4
  • 3
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
May be your statistics are not uptodate


sp_spaceused @updateusage = 'TRUE'
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
sp_MSForEachTable 'sp_spaceused @objname=''?'',@updateusage = ''TRUE'' '
0
 
EVANFAGERAuthor Commented:
Thanks to both of you. That did it. I split the points because the answers came in almost at the same time and both were correct. I gave more points to the first answer to come in.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Aneesh RetnakaranDatabase AdministratorCommented:
hey.. Both came from me ...
0
 
EVANFAGERAuthor Commented:
oops, do you get all the points even though I split them?
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
yes , i got all the 1000 points.. Thanks
0
 
EVANFAGERAuthor Commented:
great, thanks a lot
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now