The data set

      SKEW   COUNT(*)
---------- ----------
         1          1
         2          2
         3          3
         4          4
         5          5
         6          6
         7          7
         8          8
         9          9
        10         10
        11         11
        12         12
        13         13
        14         14
        15         15
        16         16
        17         17
        18         18
        19         19
        20         20
        21         21

      SKEW   COUNT(*)
---------- ----------
        22         22
        23         23
        24         24
        25         25
        26         26
        27         27
        28         28
        29         29
        30         30
        31         31
        32         32
        33         33
        34         34
        35         35
        36         36
        37         37
        38         38
        39         39
        40         40
        41         41
        42         42

      SKEW   COUNT(*)
---------- ----------
        43         43
        44         44
        45         45
        46         46
        47         47
        48         48
        49         49
        50         50
        51         51
        52         52
        53         53
        54         54
        55         55
        56         56
        57         57
        58         58
        59         59
        60         60
        61         61
        62         62
        63         63

      SKEW   COUNT(*)
---------- ----------
        64         64
        65         65
        66         66
        67         67
        68         68
        69         69
        70         70
        71         71
        72         72
        73         73
        74         74
        75         75
        76         76
        77         77
        78         78
        79         79
        80         80

80 rows selected.


PL/SQL procedure successfully completed.


Without a histogram, the plan will be a tablescan
First report: density with no histogram


NUM_DISTINCT    DENSITY NUM_BUCKETS
------------ ---------- -----------
          80      .0125           1

1 row selected.


Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=31 Card=41 Bytes=16564)
   1    0   TABLE ACCESS (FULL) OF 'T1' (TABLE) (Cost=31 Card=41 Bytes=16564)




PL/SQL procedure successfully completed.


First output: the density with the histogram
Second output: The histogram
Density = 1/(2 * num_rows).

NUM_DISTINCT    DENSITY NUM_BUCKETS
------------ ---------- -----------
          80 .000154321          80

1 row selected.


ENDPOINT_NUMBER ENDPOINT_VALUE
--------------- --------------
              1              1
              3              2
              6              3
             10              4
             15              5
             21              6
             28              7
             36              8
             45              9
             55             10
             66             11
             78             12
             91             13
            105             14
            120             15
            136             16
            153             17
            171             18
            190             19
            210             20
            231             21

ENDPOINT_NUMBER ENDPOINT_VALUE
--------------- --------------
            253             22
            276             23
            300             24
            325             25
            351             26
            378             27
            406             28
            435             29
            465             30
            496             31
            528             32
            561             33
            595             34
            630             35
            666             36
            703             37
            741             38
            780             39
            820             40
            861             41
            903             42

ENDPOINT_NUMBER ENDPOINT_VALUE
--------------- --------------
            946             43
            990             44
           1035             45
           1081             46
           1128             47
           1176             48
           1225             49
           1275             50
           1326             51
           1378             52
           1431             53
           1485             54
           1540             55
           1596             56
           1653             57
           1711             58
           1770             59
           1830             60
           1891             61
           1953             62
           2016             63

ENDPOINT_NUMBER ENDPOINT_VALUE
--------------- --------------
           2080             64
           2145             65
           2211             66
           2278             67
           2346             68
           2415             69
           2485             70
           2556             71
           2628             72
           2701             73
           2775             74
           2850             75
           2926             76
           3003             77
           3081             78
           3160             79
           3240             80

80 rows selected.


With column histograms the plan usually will be a range on the
less frequently used values for skew, and a full scan on the higher

execution path for skew = 5 with histogram

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=6 Card=5 Bytes=2020)
   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'T1' (TABLE) (Cost=6 Card=5 Bytes=2020)
   2    1     INDEX (RANGE SCAN) OF 'T1_I1' (INDEX) (Cost=1 Card=5)



execution path for skew = 70 with histogram

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=31 Card=70 Bytes=28280)
   1    0   TABLE ACCESS (FULL) OF 'T1' (TABLE) (Cost=31 Card=70 Bytes=28280)



