Re: creating variable views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: creating variable views
Date: 2001-07-08 03:49:36
Message-ID: 5832.994564176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Josh Berkus" <josh(at)agliodbs(dot)com> writes:
>> I don't understand the distinction you're trying to make here. In
>> general, a view column that is implemented as a function will give
>> the
>> optimizer headaches if you refer to it in WHERE --- the simplicity or
>> complexity of the function has got nothing to do with that AFAICS.

> OK. I thought that I noticed a difference between simple SQL functions
> and PL/pgSQL functions in this respect, but I could easily be mistaken.

AFAIR, the optimizer doesn't pay any attention at all to the
implementation language of a function. The only thing that comes to
mind here is that some care has been taken to mark all the built-in
functions as "iscachable" (or not, as appropriate); but user-created
functions may not be so marked when they should be, leading to loss of
performance in some cases.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sharmad Naik 2001-07-08 04:25:22 distributed database
Previous Message Josh Berkus 2001-07-07 23:12:49 Re: creating variable views