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: indexes and views

Re: indexes and views

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 10 Mar 2005 09:10:46 +0100
Message-ID: <o50031p28v2u0d35je5mhm59t7empv03qv@4ax.com>


On 9 Mar 2005 23:20:31 -0800, "steph" <stephan0h_at_gmx.net> wrote:

>suppose the following:
>
>I have a table like
>
>create table t1
>(c1 number
>,c2 number
>,primary key (c1)
>)
>/
>
>>From this table I create a view like
>
>create view v1 as
>select to_char(c1)||'.'||to_char(c2) c3
> from t1
>/
>
>Now of course, when I query v1 no index can be used. To create an index
>on c3 I would have to create a materlialized view. Or is there a way to
>utilize indexes defined on t1 for queries on v1? Can I create an index
>on t1 which supports queries on v1?
>
>Thanks for all the input,
>stephan

Your assertion the indexes on a table are ignored in views is incorrect. Also, if you need an index on c3, a function-based index on t1 would do. A materialized view is unnecessary.

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Mar 10 2005 - 02:10:46 CST

Original text of this message

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