Oracle Articles, Oracle Tools, Oracle Tips, Database Articles and DBA Tips  

The Largest Online Resource for Oracle Articles, Oracle Tips, Oracle Scripts & Oracle Tools!!


Enter your Email:
 
Navigate at FreeMegaZone Home      Articles      Tools      Jobs      Games      Support      Submit Content      Advertise
Advertise at www.articles.freemegazone.com

Advertise at FreeMegaZone

Give tremendous boost to your business by advertising at FreeMegaZone. Contact webmaster@freemegazone.com

 

Rating: ****                                               Rate this article:    

Author: Don Burleson

Indexes play an important role in a database performance. On one hand proper indexing can give a significant performance boost to your database and on the other hand improper indexing has severe effects on the performance of your databases. Faster, smaller and better-balanced indexes are critical for improved database performance.

A number of options can be used during the index creation (create index syntax) which can dramatically improve the oracle indexes. These options can improve

  • The speed of the index creation

  • The space used by the index

  • The height of the resulting index

In this article I will discuss a few of these factors that give significant performance boost to your database.

Table Scanning by Parallel processes:

  • Parallel option allows for parallel processes to scan the table. 

  • Oracle must first collect the symbolic key/ROWID pairs with a full-table scan when an index is created. 

  • The index creation runs many times faster by making the full-table scan run in parallel, depending on the number of CPUs, table partitioning and disk configuration. 

  • n-1 for the degree option is recommended where n is the number of CPUs on your Oracle server. 

  • Consider the below example where we create an index on a 36 CPU server and the index create twenty times faster:

CREATE INDEX cust_dup_idx ON customer(gender, hair_color, customer_id) PARALLEL 35;

Nologging:

  • The nologging option significantly improves performance by bypassing the writing of the redo log. 

  • The only drawback of nologging is that you must re-run the create index syntax if you performance 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(gender, hair_color, customer_id) PARALLEL 35 NOLOGGING;

Repressing duplication:

  • The compress option is used to repress duplication of keys in non-unique indexes. 

  • For 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. 

  • Below example uses a non-unique index on several low cardinality columns ( gender and hair_color ), and a high cardinality column (customer_id)                         

CREATE INDEX cust_dup_idx   
ON customer(gender, hair_color, customer_id) PARALLEL 35 NOLOGGING COMPRESS 2;

Tablespace blocksize option:

  • The blocksize of the index tablespace has huge impact on the structure of the index. 

  • Below example creates an index in a 32k tablespace 

create tablespace 23k_ts
datafile ‘/u01/app/oracle/prod/oradata/32k_file.dbf’
bocksize 32k;
CREATE INDEX cust_dup_idx
ON customer(gender, hair_color, customer_id)
PARALLEL 35
NOLOGGING
COMPRESS 2
TABLESPACE 32k_ts;

 Conclusion:

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.

 More Oracle Articles, Database Articles and DBA Tips
   Database Security: Step by step guideline
   DBA Tips when Oracle Account is Locked!!
   Great Tips on Tuning Database Materialized Views
   SQL - Best Practices to improve Performance
   Saving and Restoring Old Statistics in Oracle!!


 

 
HOME      ABOUT US      SUPPORT      SITE MAP      PRIVACY POLICY      TERMS OF USE      SUBMIT CONTENT      ADVERTISE
Copyright © 2007 - 2012 Oriole Intellect Inc. All rights reserved.

The name Oracle is a trademark of Oracle Corporation. Any other names used on this website may be trademarks of their respective owners