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: Optimizing Queries Against UNIONed View

Re: Optimizing Queries Against UNIONed View

From: <artmt_at_hotmail.com>
Date: 23 Jan 2007 07:13:10 -0800
Message-ID: <1169565189.965104.235230@l53g2000cwa.googlegroups.com>

MTNorman wrote:
> artmt_at_hotmail.com wrote:
> > Is there a way (other than a meterialized view) to make sure it goes
> > directly to the CODE_TYPE2 table?
>
> Try adding a check constraint to each table that limits the value of
> code_type, then the optimizer will "see" only the table with the
> code_type you want...
>
> check (code_type = 'CODE_TYPE1') to the first table
> check (code_type = 'CODE_TYPE2') to the second table

I added CODE_TYPE column to each table with the check constraints. The optimizer still scans both tables.
BTW I am running Oracle 10.1.0.5.0 Received on Tue Jan 23 2007 - 09:13:10 CST

Original text of this message

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