Re: Indexing Views

Lists: pgsql-general
From: "sid(at)questions(dot)com" <sbhatt(at)installs(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Indexing Views
Date: 2002-07-02 19:19:50
Message-ID: afsucn$1oaj$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

hi,

I am storing intermediate results in a view and then using this view for
further processing, is it possible to index views in Postgres, if so how?
Any help will be much appreciated.

Sid


From: Jeff Davis <list-pgsql-general(at)empires(dot)org>
To: "sid(at)questions(dot)com" <sbhatt(at)installs(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Indexing Views
Date: 2002-07-04 09:10:01
Message-ID: 200207040210.01223.list-pgsql-general@empires.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> I am storing intermediate results in a view and then using this view for
> further processing, is it possible to index views in Postgres, if so how?
> Any help will be much appreciated.

I don't think it's possible to store anything at all in a view. A view is just
a query-rewriting rule that can report data from existing tables, as if the
view was a table itself (but a view isn't a table).

Put proper indexes on the tables that are involved in the view and it should
work fine. If you're getting poor performance, report the output of EXPLAIN
for your query and maybe someone can help you optimize the query (or maybe
even make the planner better).

Regards,
Jeff


From: frbn <frbn(at)efbs-seafrigo(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Indexing Views
Date: 2002-07-04 12:38:00
Message-ID: 3D2441A8.2060802@efbs-seafrigo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

sid(at)questions(dot)com wrote:
> hi,
>
> I am storing intermediate results in a view and then using this view for
> further processing, is it possible to index views in Postgres, if so how?
> Any help will be much appreciated.

you can use a temporary table which can be indexed.