Re: View index question - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: View index question
Date
Msg-id Pine.LNX.4.56.0307291212110.1370@krusty.credativ.de
Whole thread Raw
In response to View index question  (u15074 <u15074@hs-harz.de>)
Responses Re: View index question
List pgsql-general
u15074 writes:

> Each of the tables in each scheme will store a lot rows. That is also why I
> decided to split the tables over the schemes.

This is absolutely pointless.  Splitting a table over several schemas will
have no effect on performance or storage (except possibly making
everything slower because the planner gets confused).

> My first question is, if there exists a possibility to add an index on
> the views new field, representing the name of the scheme?

No, you cannot index a view.

> Now, if I execute queries on this view, none of my indexes seem to be
> used.  Queries on the other two views, use my indexes though. Are
> indexes not used on view queries, if a view is based on other views?

Queries on views may make use of indexes like any other query.  To examine
index usage, please read the following:

http://www.postgresql.org/docs/7.3/static/indexes-examine.html

--
Peter Eisentraut   peter_e@gmx.net

pgsql-general by date:

Previous
From: u15074
Date:
Subject: View index question
Next
From: u15074
Date:
Subject: Re: View index question