Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Optimizing Queries Against UNIONed View
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