-1

Inherited the following audit table:

Table UserActions

AppID int
ActionTime datetime
Action varchar(25)
UserID int
Description text

Clustering key is on AppID, ActionTime, Action columns. RowCount = appx 1 billion

How do I view the size of this particular clustered index in total and per row?

user2368632
  • 1,133
  • 1
  • 15
  • 33

1 Answers1

0

You can use the system stored procedure sp_spaceused to get the size of the Table which is going to be the size of your clustered index since the clustered index is the logical storage of the Table itself.

Example syntax: EXEC sp_spaceused 'UserActions';

Specifically you'd want to look at the data column of the result set since that will tell you the total size of the Table itself which is the clustered index size. (The index_size column is the total space consumed by all indexes, so could give different results depending on if you're using other indexes such as nonclustered indexes too.)

The clustered index size per row is going to vary on each row (dependent on if you have varying sized data types or nullable columns), but you can get an average per row by dividing that data column by the rows column that the above procedure returns.

J.D.
  • 40,776
  • 12
  • 62
  • 141