Re: Invalid optimization of VOLATILE function in WHERE clause? - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Invalid optimization of VOLATILE function in WHERE clause?
Date
Msg-id 5059EAA0020000250004A533@gw.wicourts.gov
Whole thread Raw
In response to Re: Invalid optimization of VOLATILE function in WHERE clause?  ("David Johnston" <polobo@yahoo.com>)
Responses Re: Invalid optimization of VOLATILE function in WHERE clause?  ("David Johnston" <polobo@yahoo.com>)
List pgsql-hackers
"David Johnston" <polobo@yahoo.com> wrote:
>> | VOLATILE indicates that the function value can change even
>> | within a single table scan, so no optimizations can be made.
>> | Relatively few database functions are volatile in this sense;
>> | some examples are random(), [...]
> What are the arguments against adding a 4th identifier - call it
> PER_ROW for this argument?  The main reason VOLATILE is broken is
> that it is the default and in order to minimize beginner's penalty
> it is not treated as such in some situations.  The new one could
> behave just like VOLATILE but would never be optimized away and
> would always evaluate once for each row in its context.  
So how would you document that?  It sounds like the proposed level
would behave exactly as the VOLATILE level is currently documented
to behave; so I guess we could shift the documentation of VOLATILE
to PER_ROW (or whatever).  How would you then describe the behavior
of VOLATILE?
-Kevin



pgsql-hackers by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Invalid optimization of VOLATILE function in WHERE clause?
Next
From: "David Johnston"
Date:
Subject: Re: Invalid optimization of VOLATILE function in WHERE clause?