Skip to main content

Are Statistics Affected When Partitions are Dropped?

  • November 4, 2016
  • 1 reply
  • 9 views

AndyO

After we drop a partition on a large table, are statistics affected in such a way that we should re-collect them (using ANALYZE_STATISTICS or ANALYZE_HISTOGRAM)?

1 reply

Forum|alt.badge.img+2
  • Participating Frequently
  • November 10, 2016

It will depend on  your data, the row count will change but that is a service that run in the background and will get updated without any problem. About the statistics, if what you are dropping is a big representation of your data like if will change the distribuition of the data, or will change the cardinality of the data; it should affect and you should run it again. If the statistics are not too representative of the data sometimes you will see a message in the explain plan that says "stale statistics" you can also see that in system table query_events, if you see this message in the explain or the query_events table you should run again analyze_statistics. 

 

Hope this helps to understand better. 

 

Eugenia