统计信息管理-动态采样
某些情况下,需要进行动态采样,比如已有的统计信息过旧,不能反应真实的情况,或者某些表和索引缺乏统计信息等动态采样的特性是受OPTIMIZER_DYNAMIC_SAMPLING 参数控制,为了实现动态采样,该参数需要设置为2或更...
直方图测试
首先看test表上deptno列的数据分布情况:SQL> select count(*) from test; COUNT(*)---------- 1000000SQL> select distinct deptno from test; DEPTNO---------...
PGA使用大小与pga_aggregate_target参数的无关性测试
PGA的使用到底受什么限制,是pga_aggregate_target吗?答案是否定的,根据TOM的说法,做了如下测试:SQL> create or replace package demo_pkgas type array is table o...
学习v$librarycache视图
通过查看v$librarycache视图,可以监控library cache的活动情况,进一步衡量share pool设置是否合理。其中 RELOADS 列,表示对象被重新加载的次数,在一个设置合理的系统里,这个数...
索引学习五--物理组织对索引访问的影响
1. 创建2个测试表,一个表的数据按照顺序存放,另一个随机存放。sys@TEST>create table colocated(x int,y varchar2(80)); Table created. sys@TEST>begin 2 for i in 1 .. 100000 3&n...
索引学习四--降序索引
1. 建测试表s_table,并在empno和ename列上创建唯一索引scott@TEST>create table s_table as select * from test where empno<10; Table created. scott@TEST>create unique index idx_s on s_table(empn...
索引学习三-测试CBO与RBO对于索引使用的一个例子
1. 测试表test,执行一个查询,在empno列上创建了唯一索引,在没有做分析时,使用RBO生成执行计划:scott@TEST>select empno from test where empno>100 and empno<200 order by empno desc; Execution Plan--...
索引学习二—blevel
1. 在一个大表上创建唯一索引scott@TEST>create unique index idx_test on test(empno) nologging; Index created.2.分析该索引Elapsed: 00:00:58.58scott@TEST>exec dbms_stats.gather_index_stats(user,'I...
读书笔记之-索引压缩
1. 创建一个索引组织表,但不压缩sys@TEST>create table iot  ...
学习索引-1
1.测试表demo;SQL> desc demo; Name  ...