Re: retriving views name

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alessio Bragadini <alessio(at)albourne(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: retriving views name
Date: 2001-10-16 14:59:32
Message-ID: 9777.1003244372@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alessio Bragadini <alessio(at)albourne(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Henshall, Stuart - WCP 2001-10-16 15:09:01 Re: VACUUM, 24/7 availability and 7.2
Previous Message gravity 2001-10-16 14:54:17 Re: WWW interface for postgres