RE: sample size NDV scaleup

  • From: "Poddar, Amit" <amit.poddar@xxxxxxxx>
  • To: "joshuasingham@xxxxxxxxx" <joshuasingham@xxxxxxxxx>, "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Sun, 20 Dec 2009 09:41:38 -0500

I presented a paper in Hotsos 2009 on a related subject with an explanation to 
your question. Look at the paper at

http://www.oraclegeek.net/downloads/OnePassDistinctSampling.pdf

amit


________________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [oracle-l-bounce@xxxxxxxxxxxxx] On Behalf 
Of joshuasingham [joshuasingham@xxxxxxxxx]
Sent: Sunday, December 20, 2009 1:29 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: sample size NDV scaleup

Hi all,

I have been trying to get an idea of how oracle scale NDV(number of
distinct value ) from the sample percent in dbms_stats example if i
have a table named ok and I have traced the gather stats with sample
1% and from the trace that it does this

select count(*),count("NAME"),count(distinct "NAME"),sum(sys_op_opnsize("NAME"))
 ,substrb(dump(min("NAME"),16,0,32),1,120),substrb(dump(max("NAME"),16,0,32),
 1,120)
from
 "SYS"."OK" sample (  1.0000000000) t

which output is
count(*)     count("NAME")  count(distinct "NAME"),
4920          4920                  4536

My question would be how does oracle scale the distinct sample 4536 to
the value that is store as NUM_DISTINCT in dba_tab_cols


Thanks in advance for the answer

joshua
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: