Currently it is done through
dbms_stats.gather_table_stats('COREADMIN','GACC_DTL_V1',cascade => true)
Every week end.
Just to repeat that question: Have you disabled the default statistics gathering job?
To run your custom job as it is but remove the histogram on BATCH_ID (this assumes you haven't changed the default METHOD_OPT parameter of "FOR ALL COLUMNS SIZE AUTO" using DBMS_STATS.SET_PARAM):
exec dbms_stats.gather_table_stats('COREADMIN','GACC_DTL_V1',method_opt=>'FOR ALL COLUMNS SIZE AUTO FOR COLUMNS SIZE 1 BATCH_ID', cascade => true)
You might want to try a different sample size to reduce the run time. What is the SAMPLE_SIZE shown for the table GACC_DTL_V1 in DBA/ALL/USER_TAB_STATISTICS?
Depending on the result, you can explicitly specify a sample size using the "estimate_percent" parameter:
exec dbms_stats.gather_table_stats('COREADMIN','GACC_DTL_V1',method_opt=>'FOR ALL COLUMNS SIZE AUTO FOR COLUMNS SIZE 1 BATCH_ID', estimate_percent=><your_sample_percentage_goes_here>, cascade => true)
Since these seem to be large objects another option to reduce the run time of the statistics job is to use the parallel option (if you have a suitable hardware and license);
exec dbms_stats.gather_table_stats('COREADMIN','GACC_DTL_V1',method_opt=>'FOR ALL COLUMNS SIZE AUTO FOR COLUMNS SIZE 1 BATCH_ID', degree=>DBMS_STATS.DEFAULT_DEGREE, cascade => true)
The parallel execution can be combined with the "estimate_percent" option to reduce the sample size.
Footnote: Have you considered partitioning these objects, e.g. by BATCH_ID? This would allow you to take advantage of all sorts of options, like loading by partition exchange, partition pruning at query time and gather statistics only on the newly loaded data.
It introduces a further layer of complexity though, and can make your queries even slower depending on your queries, the statistics management for the partitions and the optimizations of the query optimizer. So it's nothing you can easily implement but I think it might well worth a thought in your particular case.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/
Edited by: Randolf Geist on Jun 16, 2009 4:45 PM
Added parallel option
Added partitioning suggestion