Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: 900 distinct values, yet density yields 0.5??

Re: 900 distinct values, yet density yields 0.5??

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 4 Mar 2006 16:43:28 +0000 (UTC)
Message-ID: <ducg3g$ptq$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>

Re your other post. density != 1/num_distinct if there are histograms, but over time, the choice of which to use seems to have become a little arbitrary.

In your case, I would consider using dbms_stats.set_columns_stats to construct meaningful statistics for that column. Since you are familiar with how it is used and the problems it can produce, it is perfectly reasonable to write some code that generates reasonable statistics (for example setting the high_value to what it will probably be at the end of the today, rather than having gather_table_stats set it to the value that was correct last night).

-- 
Regards

Jonathan Lewis
http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html


<hansdegit_at_hotmail.com> wrote in message 
news:1141481851.764473.138980_at_t39g2000cwt.googlegroups.com...

> Just checked my SR on Metalink: I'm hitting a bug.
>
> Almost every query on the PS_JRNL_LN table is done using a value of
> PROCESS_INSTANCE with is beyond the 'known' range by the optimizer
> (most queries are run on the most recent batch number).
>
> What would be the best strategy for gathering statistics (or perhaps
> tweaking them) to best inform the optimizer?
>
> TIA,
> Hans
>
Received on Sat Mar 04 2006 - 10:43:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US