Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Find Specific Index Size

Author  Topic 

AmrineA
Starting Member

4 Posts

Posted - 2008-03-27 : 14:11:58
We're looking at optimizing some of our tables because we have indexes on columns that are not used. So for example we might have a table that has 6GB of data and 4GB in indexes (according to sp_spaceused). We need to know how much of the 4GB of indexes is consumed by each of the indexes individually. I've tried dbcc showcontig, but that doesn't tell me the amount of space used by the index that I run it for.

Second (and by far not as important), is there a way to determine how much space is being consumed by data in a specific column. The original creator of some of the tables added an incrementing identity column that is used no where in the system. I'd like to be able to say..."If we drop this column we'll save XXX in space."

Knowing the index space is more critical, the column space would be nice but not necessary.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-03-27 : 14:38:16
You may have to do this the old fasion way. This topic (Estimating the size of a database) has several subtopics specific to estimating the size of: Clustered and non-clusterd indexes and heaps
http://msdn2.microsoft.com/en-us/library/ms187445.aspx

EDIT:
I guess that is for estimating the size when it doesn't exist yet.
Here is something from script library that may be helpfull:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=10932


Be One with the Optimizer
TG
Go to Top of Page

AmrineA
Starting Member

4 Posts

Posted - 2008-03-27 : 14:49:05
I found this stored proc which appears to give me the information that I'm looking for: sp_MSindexspace. When I add up all the amounts, it adds up to what sp_spaceused returns.
Go to Top of Page
   

- Advertisement -