create table hybrid_histogram(id number, the_column number)
insert into hybrid_histogram values(1,1);
insert into hybrid_histogram values(1,2);
insert into hybrid_histogram values(1,2);
insert into hybrid_histogram values(1,2);
insert into hybrid_histogram values(1,51);
insert into hybrid_histogram values(1,51);
insert into hybrid_histogram values(1,71);
insert into hybrid_histogram values(1,81);
insert into hybrid_histogram values(1,81);
insert into hybrid_histogram values(1,82);
insert into hybrid_histogram values(1,83);
insert into hybrid_histogram values(1,83);
commit;
exec dbms_stats.gather_table_stats(null, 'HYBRID_HISTOGRAM', method_opt => 'for columns the_column size 3');
select table_name, column_name, num_distinct, histogram
from user_tab_col_statistics
where table_name = 'HYBRID_HISTOGRAM';
TABLE_NAME COLUMN_NAM NUM_DISTINCT HISTOGRAM
------------------------------ ---------- ------------ ---------------
HYBRID_HISTOGRAM THE_COLUMN 7 HYBRID
select owner, table_name, column_name, endpoint_value, endpoint_repeat_count
from dba_histograms
where owner = 'GHLEE' and table_name = 'HYBRID_HISTOGRAM'
order by 1, 2, 3, 4;
OWNER TABLE_NAME COLUMN_NAM ENDPOINT_VALUE ENDPOINT_REPEAT_COUNT
---------- ------------------------------ ---------- -------------- ---------------------
GHLEE HYBRID_HISTOGRAM THE_COLUMN 1 1
GHLEE HYBRID_HISTOGRAM THE_COLUMN 51 2
GHLEE HYBRID_HISTOGRAM THE_COLUMN 83 2
- 강좌 URL : http://www.gurubee.net/lecture/4270
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.