Why DBMS_STATS with METHOD_OPT=>'FOR ALL COLUMNS SIZE SKEWONLY' Gathers Histograms on Unique Key Columns
(Doc ID 1473023.1)
Last updated on MARCH 03, 2022
Applies to:Oracle Database - Enterprise Edition - Version 220.127.116.11 and later
Oracle Database - Personal Edition - Version 18.104.22.168 and later
Oracle Database - Standard Edition - Version 22.214.171.124 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.
Why are column statistics gathered for a Unique or Primary Key column?
How can a Unique column's data be non-uniformly distributed?
Gathering stats with METHOD_OPT=>'FOR ALL COLUMNS SIZE SKEWONLY' generates histogram for unique key/Primary key columns.
This may appear to contradict with what is mentioned in documentation, as per documentation SKEWONLY--Oracle determines the columns to collect histograms based on the data distribution of the columns.
Gather stats for a table using the below commands
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document