Help - Histogram [message #257947] |
Thu, 09 August 2007 12:04 |
orasaket
Messages: 70 Registered: November 2006
|
Member |
|
|
Hi,
i am using Otacle 9i R2 on Linux
I have a table, tab1(c1 number,c2 number,c3 number,c4 number)
tab1 has 1000000 rows
c1 has primary index on it which is used for queries 'select xx from tab1 where c1=..'
Now, i have a query on c2 column which has skewed data, as following
select count(1),C2 from tab1 group by C2;
COUNT(1) C2
11 -23
6 -1
4613 2
3 3
21993451 4
45 5
10 13
17 99
403295 null
If i create index on C2 and compute statistics on it with 'size 254', i am getting good execution plan.
However, i am computing stats and histogram as
exec dbms_stats.gather_table_stats('HSASYS','TAB1',METHOD_OPT=>'FOR COLUMNS C2 SIZE=254',CASCADE=>TRUE);
My Question is that, Will this command, compute histogram for column C1 as well?
If answer is 'yes', will be problematic since C1 has unique values in it?
In that case is there any option with which i can compute histograms only for selected Index
Please suggest.
Thanks and Regards,
OraSaket
|
|
|
|
Re: Help - Histogram [message #257979 is a reply to message #257947] |
Thu, 09 August 2007 13:17 |
orasaket
Messages: 70 Registered: November 2006
|
Member |
|
|
Thanks Michel !!
However,
suppose if i haven't name the column in gather_table_stats and i want to compute stats on table with histogram for both columns i will not be able to mention SIZE parameter.
Since Unique key column needs SIZE 1
and skewed will need 254 something.
Thanks and Regards,
OraSaket
|
|
|
|
|