Re: Index on View ?

From: Ian Harding <iharding(at)pakrat(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index on View ?
Date: 2001-04-05 23:19:02
Message-ID: 3ACCFD66.22D0240A@pakrat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The Brand-X DBMS have 'indexed views' but in all their explanations I can't
see where they would be useful. SQL Server 2000 creates a 'clustered index'
on the view, then lets you create other unclustered indexes in addition to
it. Any time one of the source tables is updated, the clustered index needs
to be updated, which to me means instantiating the view, which means tons of
overhead. They talk about it being handy if there are aggregates in the
view, but why not create a table to hold the aggregated data and updated
with a trigger/rule?

Richard Huxton wrote:

> From: "Keith Gray" <keith(at)heart(dot)com(dot)au>
>
> > Is it possible (feasible) to create an index on a view.
> >
> > We have a large table and a defined sub-set (view)
> > from this table, would it be possible to keep an index
> > of the sub-set.
>
> I don't think so - the view is basically just a select rule that rewrites
> queries based on it.
>
> Indexes on underlying tables should be used though. Difficult to suggest
> what indices you might need without knowing the view/tables/queries
> involved.
>
> - Richard Huxton
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message J.Fernando Moyano 2001-04-06 00:36:26 Re: very very slow .....
Previous Message Keith Gray 2001-04-05 23:14:59 Re: Index on View ?