Home All Groups Group Topic Archive Search About

views - necessary to index if underlying tables are indexed?

Author
3 Aug 2006 3:45 PM
KJ
Hello,

Just a general question:

If I access a view using the same kinds of queries as I would the
underlying tables, and the underlying tables are indexed, is it
necessary to index the view, or are the table indexes used?

TIA,
-KJ

Author
3 Aug 2006 4:00 PM
Tom Cooper
The table indexes will be used.

Tom

Show quote
"KJ" <n_o_s_p_a***@mail.com> wrote in message
news:1154619927.049396.144510@m79g2000cwm.googlegroups.com...
> Hello,
>
> Just a general question:
>
> If I access a view using the same kinds of queries as I would the
> underlying tables, and the underlying tables are indexed, is it
> necessary to index the view, or are the table indexes used?
>
> TIA,
> -KJ
>
Author
3 Aug 2006 5:24 PM
Tracy McKibben
KJ wrote:
> Hello,
>
> Just a general question:
>
> If I access a view using the same kinds of queries as I would the
> underlying tables, and the underlying tables are indexed, is it
> necessary to index the view, or are the table indexes used?
>
> TIA,
> -KJ
>

The underlying indexes should be used.  An example of when you would
index a view is if the view contains a computed value that you will be
filtering on.  You would (potentially) create an index on that computed
column.


--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

AddThis Social Bookmark Button