Extract(Read) > Transform(Test&Apply) > Load(Learn) Blog

January 16, 2007

There are more than one INDEX Type Part 2

Filed under: Oracle How To,Oracle Performance — H.Tonguç Yılmaz @ 8:02 am

In Part 1 after a brief introduction on default indexing feature B*Tree Indexes in Oracle I mentioned Virtual / NoSegment Indexes.

2- Reverse Key Index and Index Range Scan Problem

Using a reverse index on a column fed by a sequence spreads the location of sequential numbers across a wider range of leaf blocks and the problem of a single hot block is removed because the index entries are stored in reverse order.

These indexes are designed to eliminate index hot spots on insert applications and are excellent for insert performance, but they are limited in that they cannot be used for index range scans. Here is a demostration of this problem;

Code listing 59-a : Reverse Key Index and Index Range Scan

3- How to disable an index

Especially before a bulk operation on your tables you might prefer to disable triggers, indexes and constraints for performance;

SELECT table_name, index_name,
'ALTER INDEX ' || index_name || ' UNUSABLE;' disable,
'ALTER INDEX ' || index_name || ' REBUILD NOLOGGING;' enable
FROM user_indexes
WHERE ...

SELECT table_name, trigger_name,
'ALTER TRIGGER ' || trigger_name || ' DISABLE;' disable,
'ALTER TRIGGER ' || trigger_name || ' ENABLE;' enable
FROM user_triggers
WHERE ...

SELECT table_name, constraint_name,
'ALTER TRIGGER ' || constraint_name || ' DISABLE;' disable,
'ALTER TRIGGER ' || constraint_name || ' ENABLE;' enable
FROM user_constraints
WHERE ...

But after migration you may experience some side impacts like dirty data and can not be able to enable some of your constraints. Here is a demostration of how to disable an index;

Code listing 59-b : How to Disable an Index

Continue reading with Part 3

Testing Information : the scripts mentioned are tested on Oracle Database 10g Enterprise Edition Release 10.2.0.2.0

Refences Used :
“Reverse Key” thread on askTom
Oracle® Database Performance Tuning Guide 10g Release 2 (10.2) Chapter 2 Designing and Developing for Performance
The Oracle ™ Users’ Co-Operative FAQ : “Why would a reverse index be useful when the leading column of the index is generated from a sequence?”

1 Comment »

  1. […] Continue reading with Part 2 […]

    Pingback by There are more than one INDEX Type Part 1 « H.Tonguç YILMAZ Oracle Blog — September 4, 2007 @ 10:35 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: