Re: Creating index on a view?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Creating index on a view?
Дата
Msg-id 200411241114.37119.peter_e@gmx.net
обсуждение исходный текст
Ответ на Creating index on a view?  ("Net Virtual Mailing Lists" <mailinglists@net-virtual.com>)
Ответы Re: Creating index on a view?  ("Patrick Fiche" <patrick.fiche@aqsacom.com>)
Re: Creating index on a view?  ("Net Virtual Mailing Lists" <mailinglists@net-virtual.com>)
Список pgsql-general
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/

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Upcoming Changes to News Server ...
Следующее
От: "Najib Abi Fadel"
Дата:
Сообщение: Row creation time