How does the METHOD_OPT parameter work?
The METHOD_OPT parameter is probably the most misunderstood parameter in the DBMS_STATS.GATHER_*_STATS procedures. It’s most commonly known as the parameter that controls the creation of histograms but it actually does so much more than that. The METHOD_OPT parameter actually controls the following,
The METHOD_OPT parameter syntax is made up of multiple parts. The first two parts are mandatory and are broken down in the diagram below.
The leading part of the METHOD_OPT syntax controls which columns will have base column statistics (min, max, NDV, number of nulls, etc) gathered on them. The default, FOR ALL COLUMNS, will collects base column statistics for all of the columns (including hidden columns) in the table. The alternative values limit the collection of base column statistics as follows;
The SIZE part of the METHOD_OPT syntax controls the creation of histograms and can have the following settings;
AUTO, REPEAT, SKEWONLY, Size Must be in the range [1,254].
The second part of the parameter setting needs to specify that a histogram is needed on the CUST_ID column.
https://blogs.oracle.com/optimizer/post/how-does-the-method-opt-parameter-work