Stats on a partitioned table [message #592452] |
Thu, 08 August 2013 09:06 |
|
johnp12
Messages: 5 Registered: February 2012
|
Junior Member |
|
|
Hello,
Is it possible for the DBMS_STATS "LIST STALE" command to show a stale partition but NOT have its table show as stale?
I had a scenario where the table itself AND 1 partition showed as stale. I ran a fnd_stats gather table stats just on that 1 partition. Once it was completed it showed the partition to no longer be stale. it also showed that the table was no longer stale. so I guess I do not need to run stats on the whole table as well?
so if this is the case, when would I need to run stats on the full partitioned table if running it on the partitions themselves removes the staleness of the table?
thanks
John
|
|
|
|
|
Re: Stats on a partitioned table [message #593909 is a reply to message #592497] |
Wed, 21 August 2013 21:47 |
|
Kevin Meade
Messages: 2103 Registered: December 1999 Location: Connecticut USA
|
Senior Member |
|
|
I should add also that 11gR2 has a new method of statistics calculation that is a game changer for how we do it and alone seems to me reason enough to migrate to at least this version of the database.
Johnathan Lewis provides this detailed explanation of the new feature (man this guy is just so far ahead of me).
Here too is the showing of how much simpler it is to collect stats well on 11gR2. This also can be found in Johnathan's document.
exec dbms_stats.set_param('APPROXIMATE_NDV','TRUE')
exec dbms_stats.set_param('ESTIMATE_PERCENT', 'DBMS_STATS.AUTO_SAMPLE_SIZE')
exec dbms_stats.set_table_prefs(ownname=>user, tabname=>'LINEITEM', pname => 'INCREMENTAL', pvalue => 'TRUE' )
exec dbms_stats.gather_table_stats(ownname=>user, tabname=>'LINEITEM', estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE, granularity => 'GLOBAL' )
In the above we set some global statistics collection parameters and then a parameter for a partitioned table. Seems to me we also would be setting additional global parameter to cover granularity and other table preferences like method_opt for specific problem cases. At this point I really begin to believe it is possible to define a statistics collection strategy that will allow Oracle to do it automatically. Boy I see the possibility of more sleep in my life.
Good luck. Kevin
[Updated on: Wed, 21 August 2013 22:40] Report message to a moderator
|
|
|