exec dbms_stats.delete_table_stats('SYS','T1');


exec dbms_stats.gather_table_stats(user,'T1', method_opt=>'for columns size 20 col1');

exec dbms_stats.gather_table_stats(user,'T1', method_opt=>'for all columns size 1');




set pages 50 lines 256

alter system flush shared_pool;

drop table Q purge;

create table Q as
   select /*+ GATHER_PLAN_STATISTICS */
       a.COL1    COL1
   from
       T1 a,
       T1 b
   where
     a.COL1=9999 and
     a.COL1=b.COL1
   /

select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST  +PEEKED_BINDS +PARALLEL +PARTITION +COST +BYTES'));



density = (nr_of_lines/_distinct_values)/100 = frequency_of_column / 100



frequency_of_non_popular_values = (nr_of_lines-sum(endpoint repeat count)) / (number_of_distinct_values - number_of_endpoints)



 32 LINES ---- 17 NON POP
 ?               


 Test: val popuaire
 val non populaire
 val non populaire out of range

 