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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: re "CBO - A Configuration Roadmap" -- Histograms on Non-Indexed Columns

Re: re "CBO - A Configuration Roadmap" -- Histograms on Non-Indexed Columns

From: John Kanagaraj <john.kanagaraj_at_gmail.com>
Date: Fri, 29 Dec 2006 12:00:29 -0800
Message-ID: <2ead3a60612291200y5da0b75fse931690ea4fcdbd8@mail.gmail.com>


Hemant,
You should be able to use SYS.COL_USAGE$ to work out which Columns are being used in Join predicates using the following SQL:

select r.name owner, o.name table , c.name column, equality_preds, equijoin_preds, nonequijoin_preds, range_preds, like_preds, null_preds, timestamp
from sys.col_usage$ u, sys.obj$ o, sys.col$ c, sys.user$ r where o.obj# = u.obj# and c.obj# = u.obj# and c.col# = u.intcol# and o.owner# = r.user# and (u.equijoin_preds > 0 or u.nonequijoin_preds > 0);

A MINUS against DBA_IND_COLUMNS should show up which columns *might* need Histograms....

Titbit: As per Oracle kernel developers that I spoke to at OOW 06, the data in COL_USAGE is never "flushed". However, they stated that only rows with TIMESTAMP > 6 months are considered.

--

John Kanagaraj <><
DB Soft Inc
Phone: 408-970-7002 (W)

Received on Fri Dec 29 2006 - 14:00:29 CST

Original text of this message

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