Re: Index on View ?

Поиск
Список
Период
Сортировка
От Ian Harding
Тема Re: Index on View ?
Дата
Msg-id 3ACCFD66.22D0240A@pakrat.com
обсуждение исходный текст
Ответ на Re: Index on View ?  ("Richard Huxton" <dev@archonet.com>)
Список 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@heart.com.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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Richard
Дата:
Сообщение: pg_dump and oid
Следующее
От: "Gordon A. Runkle"
Дата:
Сообщение: Re: UNION in a VIEW?