Skip to main content

Posts

Showing posts with the label Oracle Gather Schema | Table Statistics | Extended Statistics | method_opt

Oracle Gather Schema | Table Statistics | Extended Statistics | method_opt

Select Histograms for tables:- SELECT column_name, num_distinct, histogram FROM   user_tab_col_statistics WHERE  table_name = '<table_name>'; Gather tables stats using DBMS_STATS for schema exec dbms_stats.gather_schema_stats ( ownname => '<owner_name>', options => 'GATHER AUTO', estimate_percent => dbms_stats.auto_sample_size, method_opt  => 'FOR ALL COLUMNS SIZE 1', cascade => true, degree => 10, granularity => 'ALL' ); exec dbms_stats.gather_schema_stats ( ownname=> 'SAMAPPL', estimate_percent => dbms_stats.auto_sample_size, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=> true, granularity=>'ALL', degree => 10 ); Extended statistics R ef.: https://blogs.oracle.com/optimizer/extended-statistics http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r1/prod/perform/multistats/multicolstats.htm        method_opt options FOR ALL COLUMNS SIZE 1 FOR COLUMNS SIZE ...