播布客视频第48-51讲:Chapter 12--Managing Indexes

一、index type

1. logical

single column & concatenated(符合index)

unique or nonunique

function-based

domain index(外部数据,oracle提供接口)

2. physical

partitioned or nonpartitoned

B-tree:Normal or reverse key

Bitmap

二、 B-tree index(Balance-tree index)平衡树index(1:1)

树形结构,平衡树会导致树的高度不会太高

root:the store info of data,一个范围值

branch:the store info of data一个范围值

leaf:block true data。双向链表

如:当select * from t where id>23 and id < 45

根据index最小值,从root节点找到leaf block,然后在leaf链表,做一次index range scan。即不再查找root节点,当找到第一个叶子节点时,进行index range scan

B-tree特点:index entry与data 一一对应。

leaf 级:index entry = index entry header + key column length + key column value + rowid

= 控制信息,多事物槽位控制 + index长度 + index值 + 指针(数据文件,数据块)

对表进行insert , delete时,oracle自动维护index,

index目的为了查询快,但是会导致insert,delete,update很慢。所以在保证查询性能达到一定级别的时候,尽可能的少用index。

三、 Bitmap index(distinct value very 少)

每一个叶子节点代表一个键值(distinct vale)

Bitmap index = key + start rowid + end rowid + bitmap

= distinct value + blockid.xx.fileid + blockid.xx.fileid + 二进制数值

四、 B-tree PK Bitmap

B-tree                                                   Bitmap

----------                                               ------------

high-cardinality                                  low-cardinality

update on keys inexpensive           update to key columns very expensive

inefficitet for OR queries                 efficitet for OR queries

useful for OLTP                                useful for data warehousing or OLAP

五、 PCTFREE 30

block中的剩余空间<30时候,不可以再插入了,pctfree为了预留空间为了update语句

pctused在index中是没有用的。因为index是排序的。

六、 创建index的指导方针

1.需要根据具体业务逻辑,平衡查询和dml操作的需要

2.表和表的index需要放到不同的tablespace,因为table和index几乎是同时查询同时维护的。

3.最好使用一致性的extent size,e.g 5个块的整数倍 一次IO

4.考虑NOLOGGING for large indexes when create index.

5.INITRANS,允许对一个块中最多的并发事务个数,index的initrans>table的initrans值

七、 REBUILD INDEX

delete recode in table -> index标记已删除,但是不真实删除,除非100%的index entry都标记为删除,block才可用。

update recode in table -> index标记已删除,insert new index entry

所以会导致空间浪费,影响效率,需要rebuild,重新建立新的index。

offline index rebuild原理

1. lock the table(不能增删改)

2. create new temp index by reading old index

3. drop the old index

4. rename the temp index to original index

5. remove the table lock.

online index rebuild原理

1. lock the table

2. create new temp and empty index and an IOT to stroe on-going DML

3. Release the table lock;

4. create new temp index by reading old index

5. Merge contents of the IOT in with the new index

6. lock the table

7. final merge from IOT and drop the old index

8. rename the temp index to original index

9. remove the table lock.

rebuild index 情况

1. move to diff tablespace

2. index contains many deleted entries.

3. an existing normal index must be converted into a reverse key index.

4. the table has been moved to another tablespace,need rebuild index

八、 COALESCING INDEX

ALTER INDEX XXX COALESCE;

合并空余空间

1. Scan alone the base(leaf) of the index.

2. where adjacent nodes(相邻的节点) can be combined into a single node.

通常来说COALESCING INDEX比REBUILD INDEX 要快,但是他们的场合还需要具体问题具体分析。

1. 如果index中90%的好的,只有10%是碎片,所以可以考虑用COALESCING INDEX

2. 如果index已经支离破碎了,几乎每个叶节点的block都有碎片的话,那么就需要用REBUILD INDEX

九、 CHECKING INDEX VALIDITY

AYALYZE INDEX XXX VALIDATE STRUCTURE;

分析index的有效性,然后把结果放到INDEX_STATS表中

select height, name , lf_rows, lf_blks, del_lf_rows from index_stats

如果DEL_LF_ROWS/LF_ROWS>=15%,可能需要重建index

十、 DROP INDEXES

DROP INDEX XXX

删除index的情况:

1. 往表里面批量imp数据前,需要先删除index,然后imp,然后create index

2. drop 不经常使用的index

3. drop and re-create invalid index

index rebulid 的速度快于 drop and re-create index ,因为前者是读old index,后者是从数据表中读取数据。

十一、 Identifying Unused index

ALTER INDEX XXX   MONITORING USAGE;--v$object_usage

ALTER INDEX XXX NOMONITORING USAGE;

select * from v$object_usage;

十二、Getting index information            1. DBA_INDEXES

2. DBA_IND_COLUMNS

3. v$object_usage

参考链接:

播布客视频第48-51讲:Chapter 12--Managing Indexes

一、index type

1. logical

single column & concatenated(符合index)

unique or nonunique

function-based

domain index(外部数据,oracle提供接口)

2. physical

partitioned or nonpartitoned

B-tree:Normal or reverse key

Bitmap

二、 B-tree index(Balance-tree index)平衡树index(1:1)

树形结构,平衡树会导致树的高度不会太高

root:the store info of data,一个范围值

branch:the store info of data一个范围值

leaf:block true data。双向链表

如:当select * from t where id>23 and id < 45

根据index最小值,从root节点找到leaf block,然后在leaf链表,做一次index range scan。即不再查找root节点,当找到第一个叶子节点时,进行index range scan

B-tree特点:index entry与data 一一对应。

leaf 级:index entry = index entry header + key column length + key column value + rowid

= 控制信息,多事物槽位控制 + index长度 + index值 + 指针(数据文件,数据块)

对表进行insert , delete时,oracle自动维护index,

index目的为了查询快,但是会导致insert,delete,update很慢。所以在保证查询性能达到一定级别的时候,尽可能的少用index。

三、 Bitmap index(distinct value very 少)

每一个叶子节点代表一个键值(distinct vale)

Bitmap index = key + start rowid + end rowid + bitmap

= distinct value + blockid.xx.fileid + blockid.xx.fileid + 二进制数值

四、 B-tree PK Bitmap

B-tree                                                   Bitmap

----------                                               ------------

high-cardinality                                  low-cardinality

update on keys inexpensive           update to key columns very expensive

inefficitet for OR queries                 efficitet for OR queries

useful for OLTP                                useful for data warehousing or OLAP

五、 PCTFREE 30

block中的剩余空间<30时候,不可以再插入了,pctfree为了预留空间为了update语句

pctused在index中是没有用的。因为index是排序的。

六、 创建index的指导方针

1.需要根据具体业务逻辑,平衡查询和dml操作的需要

2.表和表的index需要放到不同的tablespace,因为table和index几乎是同时查询同时维护的。

3.最好使用一致性的extent size,e.g 5个块的整数倍 一次IO

4.考虑NOLOGGING for large indexes when create index.

5.INITRANS,允许对一个块中最多的并发事务个数,index的initrans>table的initrans值

七、 REBUILD INDEX

delete recode in table -> index标记已删除,但是不真实删除,除非100%的index entry都标记为删除,block才可用。

update recode in table -> index标记已删除,insert new index entry

所以会导致空间浪费,影响效率,需要rebuild,重新建立新的index。

offline index rebuild原理

1. lock the table(不能增删改)

2. create new temp index by reading old index

3. drop the old index

4. rename the temp index to original index

5. remove the table lock.

online index rebuild原理

1. lock the table

2. create new temp and empty index and an IOT to stroe on-going DML

3. Release the table lock;

4. create new temp index by reading old index

5. Merge contents of the IOT in with the new index

6. lock the table

7. final merge from IOT and drop the old index

8. rename the temp index to original index

9. remove the table lock.

rebuild index 情况

1. move to diff tablespace

2. index contains many deleted entries.

3. an existing normal index must be converted into a reverse key index.

4. the table has been moved to another tablespace,need rebuild index

八、 COALESCING INDEX

ALTER INDEX XXX COALESCE;

合并空余空间

1. Scan alone the base(leaf) of the index.

2. where adjacent nodes(相邻的节点) can be combined into a single node.

通常来说COALESCING INDEX比REBUILD INDEX 要快,但是他们的场合还需要具体问题具体分析。

1. 如果index中90%的好的,只有10%是碎片,所以可以考虑用COALESCING INDEX

2. 如果index已经支离破碎了,几乎每个叶节点的block都有碎片的话,那么就需要用REBUILD INDEX

九、 CHECKING INDEX VALIDITY

AYALYZE INDEX XXX VALIDATE STRUCTURE;

分析index的有效性,然后把结果放到INDEX_STATS表中

select height, name , lf_rows, lf_blks, del_lf_rows from index_stats

如果DEL_LF_ROWS/LF_ROWS>=15%,可能需要重建index

十、 DROP INDEXES

DROP INDEX XXX

删除index的情况:

1. 往表里面批量imp数据前,需要先删除index,然后imp,然后create index

2. drop 不经常使用的index

3. drop and re-create invalid index

index rebulid 的速度快于 drop and re-create index ,因为前者是读old index,后者是从数据表中读取数据。

十一、 Identifying Unused index

ALTER INDEX XXX   MONITORING USAGE;--v$object_usage

ALTER INDEX XXX NOMONITORING USAGE;

select * from v$object_usage;

十二、Getting index information            1. DBA_INDEXES

2. DBA_IND_COLUMNS

3. v$object_usage

参考链接:

oracle 播布客 视频,播布客视频-Managing Indexes笔记相关推荐

  1. 基于HDPHP的视频播客开发视频

    基于HDPHP的视频播客开发视频 讲师介绍:  向军,项目总监,从事IT行业10年以上,服务过acer.fluke.中国石油.光大银行.丰田汽车.三星电子.保洁公司等企业.精PHP/MySQL.C/C ...

  2. 3Com发布新MSR路由器 为企业提供视频播客支持

    3 Com公司日前表示,其合作伙伴vbrick系统已开发了数字视频门户功能3Com MSR系列多业务路由器. 据悉,vbrick视频接入(ViP)是为MRS路由器运行的一个开放式服务处理器模块.它提供 ...

  3. java io 视频 下载_Java下载映客主播视频回放到电脑硬盘

    Java下载映客主播视频回放到电脑硬盘 使用Java下载映客回放到电脑硬盘 使用方法:在映客app播放回放视频时,分享到QQ,就可以得到url,其中的liveid属性就是视频ID. 源代码由 [**海 ...

  4. Downcast for Mac(视频播客软件)

    是一款Podcast视频订阅下载工具,它可以播放和同步您喜欢的播客,同时也是一款音乐播放器,Downcast Mac版的界面直观,很多功能都直指原版Podcast的弱点,无需iTunes商店限制,Do ...

  5. Downcast for Mac(视频播客软件)教程

    是一款Podcast视频订阅下载工具,它可以播放和同步您喜欢的播客,同时也是一款音乐播放器,Downcast Mac破解版的界面直观,很多功能都直指原版Podcast的弱点,无需iTunes商店限制, ...

  6. php传智视频,PHP视频教学之Mysql视频教学下载传智播客-韩忠康

    PHP视频教学之Mysql视频教学下载传智播客-韩忠康课程简介: PHP视频教学之Mysql视频教学下载传智播客-韩忠康MySQL是一个关系型数据库管理系统,关联数据库将数据保存在不同的表中,而不是将 ...

  7. ps 入门 传智播客_播客快速入门指南

    ps 入门 传智播客 大概使我有权力进行播客的唯一一件事就是,我运行自己的播客已经快三年了. Sysadministrivia播客通常使用不安全的工作语言-实际上,它会让人联想到那些在中年危机中挣扎, ...

  8. 如何启动播客以及播客需要准备什么

    关于如何开始使用播客以及为什么需要的问题,有很多错误的信息.开启播客是否需要虚拟主机?制作播客需要什么设备和软件?请继续阅读以了解: 为什么需要播客 不是每个人都会阅读.十年来,我们已经从iPod N ...

  9. 数据如何指导决策:优酷主客APP播转率的C端优化

    一.背景介绍 1. 了解「播转率」及相关业务 优酷是一个综合视频平台,用户到访优酷是为了观看视频.对于平台来说,希望到访的用户都能找到自己想看的内容,收获满意的用户体验,达成后续的留存与持续活跃. & ...

  10. 网络”X客”大集合:博客、维客、奇客、播客、闪客、摩客、威克…

    网络"X客"大集合:博客.维客.奇客.播客.闪客.摩客.威克- 此文由风言疯语整理制作,转载请注明出处:http://www.kuangfeng.cn/blog/?p=234 随着 ...

最新文章

  1. centos7配置bind重启后错误解决
  2. C# 值类型与引用类型
  3. 做正确的事情和把事情做正确
  4. LeetCode 111. Minimum Depth of Binary Tree--Java, Python解法--二叉树最小高度--迭代,递归
  5. Cissp-【第6章 安全评估与测试】-2021-3-15(661页-706页)
  6. 喜报!第四范式助推百胜中国斩获2020 IDC数字化转型重磅大奖
  7. VMware Workstation
  8. getElementById()方法取值
  9. 【theano-windows】学习笔记十五——受限玻尔兹曼机
  10. grafana实现java后端登录_grafana使用gitLab 的OAuth2认证服务登陆
  11. 如何在小数点前补0,new DecimalFormat(##0.00);
  12. java 存储多叉树_JAVA多叉树森林的构造、内存存储与遍历
  13. Caffe神经网络结构汇总
  14. Duilib控件拖动改变大小
  15. 声卡是HDA Intel,芯片为IDT 92HD81B1C5的ubuntu12.04下声音很小的解决方法
  16. Canvas 画直线
  17. java初级项目 小说_webmagic项目实战(爬小说网站)
  18. 移动硬盘 RAW修复
  19. 【K-近邻】K-NN 实战分析 Facebook V Results: Predicting Check Ins
  20. linux media v4l2,Overview of the V4L2 driver framework (v4l2_subdev)

热门文章

  1. 夏雨老师告诉您学习平面设计到底好不好呢?
  2. 20140124孤独者之旅23
  3. 你真的打算凑合过完这一生吗(转)
  4. vault安装及springboot,springcloud整合vault
  5. PMP项目管理知识体系思维导图全集,收藏系列
  6. sticky android,Sticky Warriors
  7. L1-009 N个数求和 (20 分)
  8. 1004 成绩排名 (20 分)
  9. JSON的生成和解析
  10. (一)5G网络超低延迟背后的黑科技