일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- 일산실내운전연습장
- 달광
- homeschooling,
- 그림책
- 내 인생에 봄다방
- VMware
- 메리 크리스마스 늑대아저씨
- 감정날씨
- Compression
- php
- 실내운전연습실
- 일산실내운전연습실
- 아파치
- adr
- Linux
- 사랑해
- grid
- 도로주행
- 낙서봉사단
- partition
- 선유도
- 영문면허증
- 죠리퐁 라떼
- 11g
- oracle
- MariaDB
- apache
- 중문색달해수욕장
- RAC
- 실내운전연습
- Today
- Total
소소한 일상에서 책읽기 중
Improve Oracle indexes – Build faster, smaller and better-balanced indexes 본문
Improve Oracle indexes – Build faster, smaller and better-balanced indexes
다솜여우 2011. 5. 26. 17:58Note: For complete details on index create performance, see my book "Oracle Tuning: The Definitive Reference".
When using the create index syntax to build an Oracle index, there are many options that can dramatically improve the speed of the creation, the space used by the index, and the height of the resulting index. Let’s review a few of these factors:
Index create speed: performance factors
Parallel option – This option allows for parallel processes to scan the table. When an index is created, Oracle must first collect the symbolic key/ROWID pairs with a full-table scan. By making the full-table scan run in parallel, the index creation will run many times faster, depending on the number of CPUs, table partitioning and disk configuration. I recommend a n-1 for the degree option, where n is the number of CPUs on your Oracle server. In this example we create an index on a 36 CPU server and the index create twenty times faster:
CREATE INDEX cust_dup_idx ON customer(sex, hair_color, customer_id) PARALLEL 35;
Nologging option – The nologging option bypasses the writing of the redo log, significantly improving performance. The only danger with using nologging is that you must re-run the create index syntax if you perform a roll-forward database recovery. Using nologging with create index can speed index creation by up to 30%
CREATE INDEX cust_dup_idx ON customer(sex, hair_color, customer_id) PARALLEL 35 NOLOGGING;
The nologging option is quite convoluted and dependent on several factors.
- Database noarchivelog mode - If your database is in "noarchivelog" mode and you are no using the APPEND hint for inserts, you WILL STILL generate redo logs!
- Database archivelog mode - If you are in archivelog mode, the table must be altered to nologging mode AND the SQL must be using the APPEND hint. Else, redo WILL be generated.
Create index: Space & structure Factors
Compress option – The compress option is used to repress duplication of keys in non-unique indexes. For concatenated indexes (indexes with multiple columns), the compress option can reduce the size of the index by more than half. The compress option allows you to specify the prefix length for multiple column indexes. In this example we have a non-unique index on several low cardinality columns (sex and hair_color), and a high cardinality column (customer_id):
CREATE INDEX cust_dup_idx ON customer(sex, hair_color, customer_id) PARALLEL 35 NOLOGGING COMPRESS 2;
Tablespace blocksize option – The blocksize of the index tablespace will have a huge impact on the structure of the index. For details, read Proof that large indexes reduce IO. Here is an example of an index created in a 32k tablespace:
create tablespace 23k_ts datafile ‘/u01/app/oracle/prod/oradata/32k_file.dbf’ blocksize 32k; CREATE INDEX cust_dup_idx ON customer(sex, hair_color, customer_id) PARALLEL 35 NOLOGGING COMPRESS 2 TABLESPACE 32k_ts;
In sum, there are many parameters that you can use to improve the performance of Oracle index creation, the size of the index tree and the height of the tree structure.
출처 : http://www.dba-oracle.com/oracle_tips_index_speed.htm
'DB까다롭다' 카테고리의 다른 글
프로파일을 통한 비밀번호 관리 (0) | 2011.06.03 |
---|---|
Partition Table의 Index Compress 하기 (0) | 2011.06.01 |
PARTITIONED INDEX의 종류 및 IU(INDEX UNUSABLE) 상태 정리 (0) | 2011.05.23 |
Enq: RO - contention (1) | 2011.04.20 |
Updating tables with Oracle 11g compression (1) | 2011.04.19 |