Re: Creating index on a view?

From: "Patrick Fiche" <patrick(dot)fiche(at)aqsacom(dot)com>
To: "'Net Virtual Mailing Lists'" <mailinglists(at)net-virtual(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Creating index on a view?
Date: 2004-11-24 10:34:41
Message-ID: 034701c4d211$362cd000$2e01a8c0@pc3648pfi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Some time ago, an excellent tutorial on materialized views with PostgreSQL
was pointed at this address....
http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html

Patrick

> --------------------------------------------------------------------------
-----------------
> Patrick Fiche
> email : patrick(dot)fiche(at)aqsacom(dot)com
> tél : 01 69 29 36 18
> --------------------------------------------------------------------------
-----------------
>
>
>

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Peter Eisentraut
Sent: mercredi 24 novembre 2004 11:15
To: Net Virtual Mailing Lists
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Creating index on a view?

Net Virtual Mailing Lists wrote:
> My question is regarding creating an index on a view, or perhaps
> another way to accomplish this.

Views are just macro expansions of queries (in a manner of speaking).
To make queries on views use indexes, you create the indexes on the
underlying tables in the same way as if you had typed in the expanded
view query yourself. (In your example, you'd just need the usual
indexes on the primary keys.)

If what you want is that the creation of an index on a view
automatically materializes that view (don't other database systems do
that?), then you will have to implement that manually in PostgreSQL,
with triggers and a bunch of code.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

Protected by Polesoft Lockspam
http://www.polesoft.com/refer.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Net Virtual Mailing Lists 2004-11-24 10:36:57 Re: Creating index on a view?
Previous Message Peter Eisentraut 2004-11-24 10:19:44 Re: Copying into Unicode - Correcting Errors