compute statistics 在创建索引的同时,对表进行分析~
online 允许在创建索引的过程中对表进行操作的~
online 允许在创建索引的过程中对表进行操作的~
解决方案 »
- 只有fmx文件,没有对应的fmb文件,请问怎么运行fmx文件??
- 问: 热备的选择~~~
- 如何用Oracle存储过程实现返回多行记录
- 求一条sql语句
- 100分求一本数据库方面的书
- 如何启动ORACLE数据库啊
- 某世界500强企业招Oracle管理员考题,希望各位的帮助,小弟谢过了:)
- 建一nvarchar2字段,设置大小为2000,但在添加记录是却添加了6000个汉字也不会提示溢出,高手指教指教!
- exp imp
- PRO*C开发的基于ORACLE8.0.5的程序如何在ORACLE8.1.7下运行?寻求改动量最小的解决办法(NT环境,UNIX环境下已经有解决办法了)
- 请问这样的存储过程这么写?(关于一张表的数据插入到另一张表中)
- 如何保存对系统的配置修改
.....
我所知道的是:compress 4 是索引压缩存储的意思,一般用在组合索引和非唯一性索引上,压缩度必须小于索引中列的数量,也就是说这儿用了compress 4那么索引的列必须在5个以上,但这儿用在单字段上的唯一索引上,根本没空间压缩,比较奇怪,说不定是oracle9或者10g才支持这样的语法吧....compute statistics 应该是精确分析索引。online 我想应该就是联机的意思,这应该是默认值吧。很困惑,请懂的人指点一下!
------------------------------ ------------------------------ ----------
PK_DEPT DEPT
PK_EMP EMPSQL> select TABLE_NAME,LAST_ANALYZED from user_tables;TABLE_NAME LAST_ANALY
------------------------------ ----------
BONUS
DEPT
EMP
LIQ
SALGRADE 1 CREATE UNIQUE INDEX index_liq on liq (empno)
2 compute statistics
3* online
SQL> /索引已创建。SQL> select INDEX_NAME,TABLE_NAME,LAST_ANALYZED from user_indexes;INDEX_NAME TABLE_NAME LAST_ANALY
------------------------------ ------------------------------ ----------
INDEX_LIQ LIQ 17-7月 -05
PK_DEPT DEPT
PK_EMP EMPSQL> select TABLE_NAME,LAST_ANALYZED from user_tables;TABLE_NAME LAST_ANALY
------------------------------ ----------
BONUS
DEPT
EMP
LIQ 17-7月 -05
SALGRADESQL>
2 compute statistics online;索引已创建。
SQL> select INDEX_NAME,TABLE_NAME,LAST_ANALYZED from user_indexes;INDEX_NAME TABLE_NAME LAST_ANALY
------------------------------ ------------------------------ ----------
COMPRESS_UNIQUE_EMP LIQ 17-7月 -05
INDEX_LIQ LIQ 17-7月 -05
PK_DEPT DEPT
PK_EMP EMPSQL> CREATE UNIQUE INDEX COMPRESS_UNIQUE_EMP2 ON liq(ENAME, EMPNO,job) COMPRESS
2;索引已创建。
SQL> alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 1;索引已更改。
SQL> alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 3;
alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 3
*
ERROR 位于第 1 行:
ORA-25194: 无效的 COMPRESS 前缀长度值
SQL> alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 2;索引已更改。
How To Use Compress Indexes: ============================ Beginning with Oracle8i, there is a new index COMPRESS option to enable key compression which eliminates repeated occurence of key column values and may substantially reduce storage. You can use this COMPRESS option for btree indexes and IOT. The compression is realized by splitting the index key in two parts: the prefix and suffix part. Use integer to specify the prefix length (number of prefix columns to compress). If you indicate the COMPRESS option without range, Oracle will take all the columns minus the last one for compression. The maximum columns which may be choosen for prefix may be: - all the columns if the index is non unique. - all the columns minus one if the index is unique. The prefix part is choosen as a common part, whereas the suffix is considered as a unique key. Each prefix part will then shared between all the suffix parts. It offers the means to load more keys in each block, thus increases performance with access by index by limiting the number of accessed blocks. The key compression is made each block by each block, and only at the leaf level. On the contrary, the performance by index scan will decrease because Oracle must translate the <prefix, suffix> part in corresponding key. Oracle compresses only single-column indexes that are non unique or unique indexes of at least two columns. Restriction: You cannot specifiy COMPRESS for a bitmap index.
2 compute statistics online;索引已创建。
SQL> select INDEX_NAME,TABLE_NAME,LAST_ANALYZED from user_indexes;INDEX_NAME TABLE_NAME LAST_ANALY
------------------------------ ------------------------------ ----------
COMPRESS_UNIQUE_EMP LIQ 17-7月 -05
INDEX_LIQ LIQ 17-7月 -05
PK_DEPT DEPT
PK_EMP EMPSQL> CREATE UNIQUE INDEX COMPRESS_UNIQUE_EMP2 ON liq(ENAME, EMPNO,job) COMPRESS
2;索引已创建。
SQL> alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 1;索引已更改。
SQL> alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 3;
alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 3
*
ERROR 位于第 1 行:
ORA-25194: 无效的 COMPRESS 前缀长度值
SQL> alter INDEX COMPRESS_UNIQUE_EMP2 rebuild COMPRESS 2;索引已更改。
How To Use Compress Indexes: ============================ Beginning with Oracle8i, there is a new index COMPRESS option to enable key compression which eliminates repeated occurence of key column values and may substantially reduce storage. You can use this COMPRESS option for btree indexes and IOT. The compression is realized by splitting the index key in two parts: the prefix and suffix part. Use integer to specify the prefix length (number of prefix columns to compress). If you indicate the COMPRESS option without range, Oracle will take all the columns minus the last one for compression. The maximum columns which may be choosen for prefix may be: - all the columns if the index is non unique. - all the columns minus one if the index is unique. The prefix part is choosen as a common part, whereas the suffix is considered as a unique key. Each prefix part will then shared between all the suffix parts. It offers the means to load more keys in each block, thus increases performance with access by index by limiting the number of accessed blocks. The key compression is made each block by each block, and only at the leaf level. On the contrary, the performance by index scan will decrease because Oracle must translate the <prefix, suffix> part in corresponding key. Oracle compresses only single-column indexes that are non unique or unique indexes of at least two columns. Restriction: You cannot specifiy COMPRESS for a bitmap index.