一、创建索引注意事项
1、预估索引大小
2、查看索引表空间可用空间大小
3、查看临时表空间大小
4、业务空闲期创建
5、可以考虑在线、并行、nologging模式
二、预估索引方法
操作步骤如下:
SQL> explain plan for create index idx_object_id on tt(object_id) ;
Explained.
SQL> set lines 200 pages 1000
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3757763116
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | CREATE INDEX STATEMENT | | 2762K| 13M| 22958 (1)| 00:04:36 |
| 1 | INDEX BUILD NON UNIQUE| IDX_OBJECT_ID | | | | |
| 2 | SORT CREATE INDEX | | 2762K| 13M| | |
| 3 | TABLE ACCESS FULL | TT | 2762K| 13M| 21560 (1)| 00:04:19 |
----------------------------------------------------------------------------------------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note
-----
- estimated index size: 67M bytes
14 rows selected.
Elapsed: 00:00:00.01
SQL>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。