density calculation when histograms are involved

  • From: "LS Cheng" <exriscer@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 13 Sep 2007 19:28:11 +0200

Hi

Does any one know in Oracle 9.2 when histograms are involved how is density
calculated? Without histograms is 1/NDV but I cant find a suitable way to
find the density when there are histograms.

This question is because I have a 10053 trace file with this:

SINGLE TABLE ACCESS PATH
Column: COD_C  Col#: 2      Table: EMP_CL   Alias: CL
    NDV: 3         NULLS: 0         DENS: 4.0526e-09
    FREQUENCY HISTOGRAM: #BKT: 37012907 #VAL: 3
Column: COD_A  Col#: 3      Table: EMP_CL   Alias: CL
    NDV: 2         NULLS: 0         DENS: 4.0526e-09
    FREQUENCY HISTOGRAM: #BKT: 37012907 #VAL: 2
  TABLE: EMP_CL     ORIG CDN: 123376357  ROUNDED CDN: 442543  CMPTD CDN:
442543
  Access path: tsc  Resc:  35875  Resp:  35875
  BEST_CST: 35875.00  PATH: 2  Degree:  1

The query should returns around 3 million rows but I dont understand how the
computed cardinality is 442543? I suspect it calculates that using density
which shows 4.0526e-09
!

Thanks

--
LSC

Other related posts: