Re: creating variable views - Mailing list pgsql-sql

From Tom Lane
Subject Re: creating variable views
Date
Msg-id 5832.994564176@sss.pgh.pa.us
Whole thread Raw
In response to Re: creating variable views  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
"Josh Berkus" <josh@agliodbs.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


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: creating variable views
Next
From: "J.Fernando Moyano"
Date:
Subject: TOTALLY OFFTOPIC !!