Is it more efficient to drop the index before loading large amout of data then re-create index? Is it more efficient to drop the index before loading large amout of data then re-create index? oracle oracle

Is it more efficient to drop the index before loading large amout of data then re-create index?


It depends. Only way to be sure is to try it out with your (test) data and in your (test) enviroment.


As others have said, "it depends". But it's worth explaining why such a seemingly simple question is so complicated.

Other than the percent of data added, there are many factors that must be considered:

  1. What kind of indexes? Bitmap, reverse key, compressed, domain?
  2. How many indexes, how many columns do they have, what is the size of the columns, what is the block size?
  3. How ordered is the inserted data?
  4. Can indexes be rebuilt in parallel?
  5. How much data can fit in the buffer cache (memory)?
  6. What is the statistics gathering strategy, can stats run with cascade => false?
  7. Explain plan can potentially answer half this question. It can be used to predict the time to build an index. But the time estimates are notoriously bad, and Oracle does not even attempt to estimate the cost of INSERT STATEMENT.

And there are likely other issues I haven't thought of.