`

ALTER INDEX COALESCE: 10g Improvements

 
阅读更多

I thought it might be worth mentioning some interesting changes in the manner in which the ALTER INDEX … COALESCE command works since Oracle 10g.

Basically the purpose of the COALESCE option is to reduce free space within the Leaf Blocks of an index. This is achieved by effectively performing a Full Index Scan of the leaf blocks, comparing the free space available in neighbouring blocks. In 9i, the basic method was to logically start with the left most leaf block and see if it could be coalesced or merged with the 2nd left most block. This required the sum of used space within these 2 blocks to be less than 100% of a block less the PCTFREE value. If so, the contents were merged with the contents of one block placed in the other and with the now empty leaf block removed from the index structure and placed on the index freelist.

It then looked at the 2nd leaf block  (which might now be the first block if previously coalesced) and 3rd leaf blocks to see if these could be coalesced. If so they were merged and the empty block placed on the freelist.

And so on and so on until all leaf blocks had been traversed and all possible leaf blocks coalesced.

Note branch blocks are not directly merged during this process, except to be updated with modified pointer information if a leaf block coalesce had taken place. However, if enough leaf blocks are removed such that the branch block contains no more pointers to leaf blocks (or other intermediate branch blocks), it’s also removed from the index structure. However, there must always be at least one branch block from each level remaining hence the height of an index always remains the same during a coalesce operation.

Note if no leaf block had 50% or more free space, nothing would be coalesced as no two consecutive leaf blocks would have sufficient free space in which to be coalesced.

In 10g, the Coalesce operation has been modified somewhat.

An index no longer requires the sum of used space plus PCTFREE in adjacent blocks to be less than 100% of a block be effectively coalesced. For example, the free space in a block can be 25% in one leaf block and just 25% in the adjacent block (hence the combined used space alone being 150% of a block) and 10g can effectively coalesce these leaf blocks together.

This demo show how Coalesce differs between a 9i (9.2.0.7) and a 10g (10.2.0.3) database.

10g introduced the concept of being able to SHRINK an index and the Coalesce option can be viewed as now being very similar to an index Shrink command. Similar but not quite the same.

I’ll cover the similarities and differences between a Coalesce and a Shrink in the next day or two …

 

参考至:http://richardfoote.wordpress.com/2008/02/05/alter-index-coalesce-10g-improvements-jump-they-say/

如有错误,欢迎指正

邮箱:czmcj@163.com

分享到:
评论

相关推荐

    alter-nlu:用于聊天机器人的自然语言理解库,具有意图识别和实体提取功能

    AlterNLU-开源NLU引擎 AlterNLU是用于构建聊天机器人和AI助手的开源工具。 它为开发人员提供了在生产环境中构建助手或机器人的最小方法。 它将自然语言转换为结构化数据。 例如: 输入: {"text": "i want few ...

    mysql alter table修改表命令整理

    MYSQL ALTER TABLE命令用于修改表结构,例如添加/修改/删除字段、索引、主键等等,本文章通过实例向大家介绍MYSQL ALTER TABLE语句的使用方法, ...or ADD INDEX [index_name] (index_col_name,...) or ADD

    mysql alter table 修改表命令详细介绍

    MySQL ALTER语法如下: ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...] alter_specification: ADD [COLUMN] create_definition [FIRST | AFTER column_name ] or ADD INDEX [index_name] (index_col...

    MySQL ALTER语法的运用方法

    MySQL ALTER语法中ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec …] 代码如下: alter_specification: ADD [COLUMN] create_definition [FIRST | AFTER column_name ] or ADD INDEX [index_name] (index...

    ORACLE重建索引总结

    1.3 、 使用 alter index index_name coalesce 命令重建索引。 (2)、下面讨论一下这三种方法的优缺点: 2.1、删除并从头开始建索引:方法是最慢的,最耗时的。一般不建议。 2.2、Alter index index_...

    MySQL数据库系统及应用综合练习.doc

    A: 数据控制功能 B: 数据操纵功能 C: 数据管理功能 D: 数据定义功能 答案: B 【10】 1999年10月1日在mysql中表示方法错误的是: A: "1999-10-01" B: "1999%10%01" C: "1999\10\01" D: "1999/10/01" 答案: D 【11】 ...

    alter sql 语句实例

    收藏资料: alter sql

    Serilog.Sinks.OrientDB:Serilog.Sinks.OrientDB

    您通过databaseName提供的数据库应该已经存在,并且需要运行两个ALTER DATABASE命令: ALTER DATABASE DATETIMEFORMAT yyyy - MM - dd ' T ' HH:mm: ss . SSSALTER DATABASE TIMEZONE UTC` ` `The sink will ...

    alter 的使用方法

    alter 的使用方法,很新手使用。例如:增加字段 alter table A add(AK Varchar2(20))

    AlterID(认证工具)

    TeamViewer14认证工具AlterID,修改windows下的TeamViewer。

    TVTools+AlterID+2.0.rar

    TVTools AlterID 是一款解决TeamViewer被检测为商业用途的无限换ID工具,使用TeamViewer远程控制软件的朋友都知道,TeamViewer不管是什么所谓的破解版还是TeamViewer免费版使用过程都会出现一些TeamViewer被检测为...

    alter 编程 线手册

    alter 编程线 手册 FPGA CPLD

    sql语句大全(详细).pdf

    ALTER TABLE:修改表结构 DROP TABLE:删除表 CREATE INDEX:创建索引 DROP INDEX:删除索引 数据操纵语言 (DML) INSERT INTO:插入数据 UPDATE:更新数据 DELETE FROM:删除数据 SELECT:查询数据 数据查询语言 ...

    alter2:改变

    alter2 改变

    Android代码-RhinoDroid

    First modify local.properties to point to your Android SDK, alter this line: sdk.dir=/Users/miki/android/android-sdk-mac Then compile and upload to emulator/device. Either use the command line: ant ...

    alter table test rename test1; --修改表名alter table test add colum

    --删除表列alter table test modify address char(10) --修改表列类型||alter table test change

    AlterID.zip

    AlterID.exe 密码123456

    AlterID2.zip

    AlterID2 zip

    alter语句关于sql数据库

    alter语句 帮助了解和解决问题

    详解MySQL中ALTER命令的使用

    MySQL的ALTER命令是非常有用的,当想改变表的名称,表的字段,或者如果要添加或删除一个现有的表中的列。 让我们开始创建一个表名为testalter_tbl的用例: root@host# mysql -u root -p password; Enter password:*...

Global site tag (gtag.js) - Google Analytics