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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top