首页 > 数据库 > 数据库开发技术 > 索引为什么比其所对应的表大


原创 数据库开发技术 作者:tsinglee 时间:2007-11-06 16:09:08 0 删除 编辑


Index growth could be due to the manner in which Oracle splits the blocks as the index is populated. Indexes are created as b*trees. The only balancing occurs as a 50:50 block splits. Each leaf block is allocated a range of key values. When a value is deleted the space is not immediately available for any new key values - only for ones that fall in the existing range for the block. A block is only placed back on the free list when all the index entries for that block are deleted. "deleted" means that the space is available for reuse but the data is not zeroed out. When a new value is inserted, if the key "fits" into an existing leaf block then it will attempt to place it in that block. This algorithm is not particularly aggressive. When a block split is required it will split the data in the first block 50-50. Half of the data will be kept in the original block and the other half placed in the new (split) block. This algorithm causes the index growth observed and can double the size of the index overtime.

索引保存了 : 键值 + rowid + 树结构
删除后的数据不会立即可用 , 如果新插入的数据跟以前的数据的索引键值一样的话,则会使用原来的空间 .


来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

下一篇: 一分钟脉搏70次
请登录后发表评论 登录
  • 博文量
  • 访问量