Using DBMS_STATS we can gather histogram statistics for table columns that has skewed data
Syntax:
DBMS_STATS.GATHER_TABLE_STATS(ownername=>'owner',tabname=>'tablename',
estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE,degree=>DBMS_STATS.AUTO,method_opt=>'FOR ALL COLUMNS SIZE SKEWONLY FOR COLUMNS <<column_name>>');
Here we should replace <<column_name>> with the name of the column or the expression used in the sql query taking that column.
Syntax:
DBMS_STATS.GATHER_TABLE_STATS(ownername=>'owner',tabname=>'tablename',
estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE,degree=>DBMS_STATS.AUTO,method_opt=>'FOR ALL COLUMNS SIZE SKEWONLY FOR COLUMNS <<column_name>>');
Here we should replace <<column_name>> with the name of the column or the expression used in the sql query taking that column.
No comments:
Post a Comment