sample size NDV scaleup
From: joshuasingham <joshuasingham_at_gmail.com>
Date: Sun, 20 Dec 2009 14:29:54 +0800
Message-ID: <74e7b3b00912192229v37e712f8l86be1a99f1674dce_at_mail.gmail.com>
Hi all,
Date: Sun, 20 Dec 2009 14:29:54 +0800
Message-ID: <74e7b3b00912192229v37e712f8l86be1a99f1674dce_at_mail.gmail.com>
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
-- http://www.freelists.org/webpage/oracle-lReceived on Sun Dec 20 2009 - 00:29:54 CST