Re: retriving views name

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: retriving views name
Дата
Msg-id 9777.1003244372@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: retriving views name  (Alessio Bragadini <alessio@albourne.com>)
Список pgsql-general
Alessio Bragadini <alessio@albourne.com> writes:
> Tom Lane wrote:
>> One must wonder why you create views at all, if you don't intend them
>> to stick around for long.  Why not just write out the SELECTs in full?
>> (If you think there's some performance benefit to using a view, you are
>> quite mistaken.)

> There are no cached query plans in any way?

Certainly none associated with views.  Views would make a very poor
basis for caching plans, since they typically form only a part of
the eventual query.  Example: suppose you write

    create view v as select * from foo;

    select * from v where indexedcol = 42;

You'd be fairly unhappy if the system were unable to use an indexscan
over foo.indexedcol for this query, no?  But a plan associated with the
bare view definition couldn't exploit this possibility, because the
potential to use that index doesn't arise in the context of the view
itself, only in the context of the complete query.

            regards, tom lane

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

Предыдущее
От: "Nadeem Akhtar"
Дата:
Сообщение: Transaction not working.
Следующее
От: "Stefan Lindner"
Дата:
Сообщение: system maintained keys