一、B-Tree索引的分裂
1. 创建测试表
SQL> create table split_tab (id number, name varchar2(100));
表已创建。
SQL> alter table split_tab add constraint pk_split_tab primary key (id) using index;
表已更改。
SQL> create sequence seq_alex_tab
2 minvalue 1
3 maxvalue 99999999
4 start with 1
5 increment by 1
6 cache 200;
序列已创建。 2. 插入1万条数据
SQL> declare
begin
for i in 1..10000 loop
insert into split_tab values (i, 'split');
end loop;
commit;
end; 2 3 4 5 6 7
8 / 3.搜集下统计信息:
BEGIN
DBMS_STATS.GATHER_TABLE_STATS(ownname => 'SCOTT',
tabname => 'SPLIT_TAB',
estimate_percent => 30,
method_opt => 'for all columns size repeat',
no_invalidate => FALSE,
degree => 8,
cascade => TRUE);
END; 3. 分析一下索引结构
SQL> col ratio for a20
SQL> col segment_name for a30
SQL> analyze index PK_ALEX_TAB validate structure;
索引已分析
SQL> select height,round((del_lf_rows_len/lf_rows_len)*100,2)||'%' ratio,pct_used from index_stats where name= 'PK_ALEX_TAB';
HEIGHT RATIO PCT_USED
---------- -------------------- ----------
2 0% 93
SQL> select segment_name,bytes from user_segments where segment_name='PK_ALEX_TAB';
SEGMENT_NAME BYTES
------------------------------ ----------
PK_ALEX_TAB 196608
SQL> select pct_free from user_indexes where index_name='PK_ALEX_TAB';
PCT_FREE
----------
10 4. DUMP出主键索引的索引树结构
SQL> select data_object_id,object_id from dba_objects where owner='SCOTT' and object_name='PK_SPLIT_TAB'; DATA_OBJECT_ID OBJECT_ID
-------------- ----------
75152 75152 SQL> alter session set events 'immediate trace name treedump level 75152';
会话已更改。 5. DUMP日志分析
----- begin tree dump
branch: 0x10206c3 16910019 (0: nrow: 18, level: 1)
leaf: 0x10206c5 16910021 (-1: nrow: 578 rrow: 578)
leaf: 0x10206c6 16910022 (0: nrow: 571 rrow: 571)
leaf: 0x10206c7 16910023 (1: nrow: 571 rrow: 571)
leaf: 0x10206c4 16910020 (2: nrow: 571 rrow: 571)
leaf: 0x10206cd 16910029 (3: nrow: 571 rrow: 571)
leaf: 0x10206ce 16910030 (4: nrow: 571 rrow: 571)
leaf: 0x10206cf 16910031 (5: nrow: 571 rrow: 571)
leaf: 0x10206c8 16910024 (6: nrow: 571 rrow: 571)
leaf: 0x10206c9 16910025 (7: nrow: 571 rrow: 571)
leaf: 0x10206ca 16910026 (8: nrow: 571 rrow: 571)
leaf: 0x10206cb 16910027 (9: nrow: 571 rrow: 571)
leaf: 0x10206cc 16910028 (10: nrow: 571 rrow: 571)
leaf: 0x10206e1 16910049 (11: nrow: 571 rrow: 571)
leaf: 0x10206e2 16910050 (12: nrow: 571 rrow: 571)
leaf: 0x10206e5 16910053 (13: nrow: 571 rrow: 571)
leaf: 0x10206e6 16910054 (14: nrow: 571 rrow: 571)
leaf: 0x10206e7 16910055 (15: nrow: 571 rrow: 571)
leaf: 0x10206e3 16910051 (16: nrow: 286 rrow: 286)
----- end tree dump 6. 小结
(1)可以看到主键索引只在以下叶块上进行分裂,即最右侧的叶块上进行分裂:
leaf: 0x10206e3 16910051 (16: nrow: 286 rrow: 286)

B树叶子节点split的更多相关文章

  1. 获取所有树叶子节点 注册添加事件 if ($(node).tree('isLeaf', node.target)) 是否叶子节点

    //获取所有树叶子节点 注册添加事件 if ($(node).tree('isLeaf', node.target)) 是否叶子节点 $(function () { $('.easyui-tree') ...

  2. ztree树 叶子节点路径的集合

    1.Question Description: ztree树各个节点都带有路径,如“/根节点”,"/根节点/一级节点",“根节点/一级节点/二级节点‘; 现在想获取所选的最末级节点 ...

  3. B+树叶子节点数据如何存储,以及如何查找某一条数据

    MySQL索引背后的数据结构及算法原理 https://www.kancloud.cn/kancloud/theory-of-mysql-index  非常好 根据一条sql  如何查看索引结构等信息 ...

  4. GEF中TreeViewer的叶子节点展开

    /** * GEF树叶子节点的展开 * @param items */ private void expand(TreeItem[] items) { for (int i = 0; i < i ...

  5. POJ 3277 City Horizon(叶子节点为[a,a+1)的线段树+离散化)

    网上还有用unique函数和lowerbound函数离散的方法,可以百度搜下题解就有. 这里给出介绍unique函数的链接:http://www.cnblogs.com/zhangshu/archiv ...

  6. 树 List Leaves 【用数组模拟了树状结构建树+搜索叶子节点+按照特殊规律输出每个叶子节点】

    Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. I ...

  7. 先序遍历创建二叉树,对二叉树统计叶子节点个数和统计深度(创建二叉树时#代表空树,序列不能有误)c语言

    #include "stdio.h" #include "string.h" #include "malloc.h" #define NUL ...

  8. [二叉树算法]让树所有叶子节点连成一个单链表,让rchild作为 next指针

    //让树所有叶子节点连成一个单链表,让rchild作为 next指针 LNode *head=null,*pre=null;//全局变量 LNode *InOrder(BTNode *T){ if(T ...

  9. HDU 4267 线段树 离散点区间更新, 自叶子节点至根单点查询

    题意: n个数字 下面n个数字表示数列 2个操作 1 [u, v]  k  add [u,v ]区间 (u点要计算)每隔k个位置,该数字+add 2 pos 询问 pos下标的值(下标从1开始) 思路 ...

随机推荐

  1. HDU_2056——相交矩形的面积

    Problem Description Given two rectangles and the coordinates of two points on the diagonals of each ...

  2. 记一次pending请求问题查找过程

    情景再现 近期发现网站访问变慢,经常会出现请求无法响应的问题,一个请求长时间没有返回,导致页面出现504(Gateway Timeout),我们使用的nodejs+ngnix(反向代理). 猜测原因 ...

  3. ik分词

    Ik中文分词的引入 ik版本号:IK Analyzer 2012FF_hf1 下载地址: http://code.google.com/p/ik-analyzer/downloads/list 解压 ...

  4. 【转】Eclipse中创建并运行Servlet项目

    最近看了写http协议的学习资料,因此想要实现下andriod平台和服务器通信,那就servlet吧,哎哟,还不错哦!顺便说下,我这个servlet服务是想获得用户名和密码进行校验,然后反给客户端状态 ...

  5. Android应用开发-小巫CSDN博客client之嵌入有米广告

    Android应用开发-小巫CSDN博客client之嵌入有米广告 上一篇博客给大家介绍怎样集成友盟社会化组件,本篇继续带来干货,教大家怎样嵌入广告到应用中去.小巫自称专业对接30年,熟悉各大渠道SD ...

  6. Linux下基于源代码方式安装MySQL 5.6

    MySQL为开源数据库,因此能够基于源代码实现安装.基于源代码安装有很多其它的灵活性. 也就是说我们能够针对自己的硬件平台选用合适的编译器来优化编译后的二进制代码.依据不同的软件平台环境调整相关的编译 ...

  7. [Angular 2] Interpolation: check object exists

    In Angular2, sometime we use @Output to pass data to parent component, then parent may pass the data ...

  8. [Javascript] Intro to Recursion - Detecting an Infinite Loop

    When using recursion, you must be mindful of the dreaded infinite loop. Using the recursive function ...

  9. UIView层次管理bringSubviewToFront,sendSubviewToBack

    将一个UIView显示在最前面只需要调用其父视图的 bringSubviewToFront()方法. 将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法. ...

  10. 【IOS】IOS高速入门之OC语法

    Objective-C 是 C 语言的超集 您还能够訪问标准 C 库例程,比如在stdlib.h和stdio.h中声明的那些例程. Objective-C 还是一种很动态的程序设计语言,并且这样的动态 ...