Insert into self, pause new indexing, then reindex. Oracle 9i

I would like to know if the following is possible.  I can thing of ways around this, using multiple tables, but I would like to avoid it...

1.  Create Table X
2.  Bulk insert into table X from table Y
3.  Index table X
4.  Pause the indexing of newly inserted rows to table x
5.  Insert into table X from table X
6.  Reindex Table X  (either all or newly added rows, don't care)

The point of #4 is to pause the indexing of the rows being inserted, but not drop the index as it will be useful when reading rows in #5.
CalDudeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sdstuberCommented:
you can't "pause" indexing.

You can drop the index before loading, then recreate the index afterward
For bulk loads, this is recommended practice.


Howerver "bulk" is somewhat subjective.
0
schwertnerCommented:
We use dropping the index(s) and after that we rebuild it. Indexes work on the whole table, not on part of them. Index either exist or do not exist.
So you can create index when you need it and drop you to avoid the delay.

The only thing you missed is that only creating index is not enough to use it appropriatelly. It will be ignored by the Optimizer until you collect the statistics over the table and the index (espececially because you are speaking about bulk insert that changes the number of the rows, histograms and depth of the index tree).
0
awking00Commented:
You can alter the index to unusable -
alter index <index_name> unusable;
Then, when inserting new records -
alter session set skip_unusable_indexes=true;
Then, before the self inserts -
alter index <index_name> rebuild [compute statistics];
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.