If I have a column of a table with data and create an index in this column, will the index take up as much disk space as the column itself?
I'm interested because I'm trying to figure out if the b-trees really store copies of these columns in leaf nodes or do they somehow point to this?
Sorry if this is: "Will Java replace XML?" good question.
UPDATE:
created a table without an index with one GUID column, added 1M rows - 26MB
same table with primary key (cluster index) - 25 MB (even smaller!), index size - 176 KB
the same table with a unique key (non-clustered index) - 26 MB , index size - 27 MB
Thus, only non-clustered indexes take up as much space as the data itself.
All measurements were performed in SQL Server 2005.
database sql-server indexing b-tree
Valentin
source share