Pergunta

I have a big db in Oracle and I just deleted all the data from the database and I am going to re-insert a big amount of new data.

Should I run update stats on empty database? Is there a good source to read about when should I update the statistics on the tables and indexes?

Foi útil?

Solução

It seems that at least in Oracle 10 Truncate does not update stats. Oracle will plan its queries using the same plan as if the tables were full of data so it could try some inefficient execution plans.

I will recommend to update stats after bigs changes in the amount of data like migrations, ETL, etc.

In Oracle 11 has improved the gathering of stats so things could be different.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top