C1 | C2 | |
---|---|---|
Distinct Count | 5 | 300 |
1/NDV | 1/5(0.2) | 1/300(0.0033) |
Density(책) | 0.000045 | 0.4063 |
Density(실측치) | 0.000045 | 0.00036 |
SQL> exec dbms_stats.gather_table_stats(user, 't1', -
method_opt=>'for all columns size skewonly');
SQL> @tab_stat t1
-----------------
01. table stats
-----------------
TABLE_NAME : T1
NUM_ROWS : 11111
BLOCKS : 20
SAMPLE_SIZE : 11111
LAST_ANAL : 2009/04/17 00:31:00
-----------------
------------------
02. column stats
-----------------
TABLE_NAME : T1
COLUMN_NAME : C1
NUM_DISTINCT : 5
NUM_NULLS : 0
DENSITY : .0000450004500045
LOW_VALUE : C102
HIGH_VALUE : C106
HISTOGRAM : FREQUENCY
-----------------
TABLE_NAME : T1
COLUMN_NAME : C2
NUM_DISTINCT : 300
NUM_NULLS : 0
DENSITY : .00036320911154317
LOW_VALUE : C102
HIGH_VALUE : C204
HISTOGRAM : HEIGHT BALANCED
-----------------
{code:SQL} C1 CNT -- -- 1 10000 2 1000 3 100 4 10 5 1 {code} | {code:SQL} TABLE_NAME COLUMN_NAME ENDPOINT_NUMBER ENDPOINT_VALUE --- T1 C1 10000 1() T1 C1 11000 2() T1 C1 11100 3() T1 C1 11110 4() T1 C1 11111 5() {code} |
=>1번값은 10000건, 2번 값은 1000건(11000-10000), 3번 값은 100건(11100-11000).. 이라는 말씀
{code:SQL} C2 CNT -- -- 1 5008 2 5008 3 8 4 8 5 8 6 6 7 6 8 6 9 6 10 6 11 6 . . . {code} | {code:SQL} TABLE_NAME COLUMN_NAME ENDPOINT_NUMBER ENDPOINT_VALUE --- T1 C2 113 1() T1 C2 228 2() T1 C2 229 3() T1 C2 230 10() T1 C2 231 17() T1 C2 232 24() T1 C2 233 32() T1 C2 234 39() T1 C2 235 46() T1 C2 236 55() T1 C2 237 66() T1 C2 238 77() T1 C2 239 88() T1 C2 240 98() T1 C2 241 112() T1 C2 242 126() T1 C2 243 141() T1 C2 244 155() T1 C2 245 170() T1 C2 246 184() T1 C2 247 199() T1 C2 248 213() T1 C2 249 228() T1 C2 250 242() T1 C2 251 257() T1 C2 252 271() T1 C2 253 286() T1 C2 254 300() {code} |
=> 하나의 Bucket에 담는 수는 약 43.7(11111/254), 1번 값이 1~113번까지의 Bucket을 차지하고 있으므로, 113*43= 4943이다.