To continue reading for free, register below or login
To read more you must become a member of SearchOracle.com
');
// -->

Indexes are different than other segments like tables. Indexes (I'm assuming the most common index, the B-tree index here) has a root node to the tree and branch blocks before arriving at the leaf blocks which point to the rows containing the data. The root node and branch blocks may not be full, but are still required. For this reason, I look at the space used by an index differently than a table. The root node may reside in a 8KB block but only contain 1KB worth of actual data. Yet you cannot have half of a node, so while 7KB might be empty space, it is still used and required by your index.
To see the allocated space, simply query DBA_SEGMENTS for the index in question. The BYTES column will tell you how much space is allocated. This may be more space than is actually being used, so you might need to dump the index contents and count the number of used blocks. I have a white paper on my Web site titled "Dumping Oracle Blocks" which discusses this procedure. Alternatively, you can use the DBMS_SPACE supplied packaged to determine the used space as discussed here.
|