Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Performance issue
Peter McKenzie wrote:
>
> Oracle 7.3.....
>
> I have two tables - 'A' and 'B' with identical structures. Both are indexed
> on column X.
>
> I have a view 'C' = select * from A union all select * from B.
>
> If I select * from 'C' where X='a value'
> the index on column X is not used (no index is used)
>
> I have tried using hints and various other tricks but Oracle refuses to use
> the index.
>
> Any ideas welcome
>
> Thanks,
> Peter
Try this:
select * from A where X = 'a value'
union all
select * from B where X = 'a value';
This should use both indexes.
-- Allen Kirby AT&T Information Technology Services Alpharetta, GA. The views expressed here are mine, not my employers.Received on Mon Jan 12 1998 - 00:00:00 CST