ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How Indexes Grow and Pctfree

How Indexes Grow and Pctfree

原创 Linux操作系统 作者:tolywang 时间:2005-01-26 00:00:00 0 删除 编辑

       Indexes are always balanced and they grow from the bottom up. As rows are added, the leaf block fills. When the leaf block is full, the Oracle server splits it into two blocks and puts 50% of the block’s contents into the original leaf block and 50% into a new leaf block. 



            If another block is added to the index, this newly added block must be added to the directory entry in the parent branch block. If this parent branch block is full, the parent branch block is split in a similar way to the leaf block, with 50% of the existing contents being divided between the existing and new branch blocks. If required, this pattern is repeated until the place where the root block becomes a branch block and a new root block is added.


              索引从下往上增长的时候总是会被平衡,当一个行增加时,leaf block被填充,当leaf block被填满后,oracle server 把该block一分为二并各放50%的数据。当有新的块被增加到索引时,这个新增的块必须在父的branch block中增加一条directory entry,当父的branch block被填满后,branch block就像leaf block一样,分成两个branch block并各有50%的数据,如果需要的话,这样模式会一直被重复,直到root block成为一个branch block并有一个新的root block被增加。

              The more levels an index has, the less efficient it may be. Additionally, an index with many rows deleted might not be efficient. Typically, if 15% of the index data is deleted, then you should consider rebuilding the index.


               如果索引的层次较多,那么它的效率就不那么好了,另外一个被删除很多列的索引也不会那么有效,如果一个索引的15%的数据被删除,那么就需要考虑重建索引了。重建索引比先删除索引再建立索引效率要高的多。

http://www.itpub.net/showthread.php?s=&postid=2135062#post2135062

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-84268/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13131694