This content has been marked as final. Show 2 replies
If you are truncating and doing the bulk load everyday then its a volatile table for sure. Let me paste here what oracle white paper says "A volatile table is one where the volume of data changes dramatically over time. For example, an orders queue table, which at the start of the day the table is empty. As the day progresses and orders are placed the table begins to fill up. Once each order is processed it is deleted from the tables, so by the end of the day the table is empty again.
If you relied on the automatic statistics gather job to maintain statistics on such tables then the statistics would always show the table was empty because it was empty over night when the job ran. However, during the course of the day the table may have hundreds of thousands of rows in it.
In such cases it is better to gather a representative set of statistics for the table during the day when the table is populated and then lock them. Locking the statistics will prevent the automatic statistics gathering job from over writing them. Alternatively, you could rely on dynamic sampling to gather statistics on these tables. The Optimizer uses dynamic sampling during the compilation of a SQL statement to gather basic statistics on the tables before optimizing the statement. Although the statistics gathered by dynamic sampling are not as high a quality or as complete as the statistics gathered using the DBMS_STATS package, they should be good enough in most cases."
My recommendation, if you know your data, is that you use DBMS_STATS.SET_TABLE_STATS and SET_INDEX_STATS.1 person found this helpful