HI,
>Because its value might change between planning and execution.
When in seqscan mode, stable function not be optimized to one-call .
But in index-scan mode, it's in one-call mode.
If its value might change between planning and execution. I think stable function also not allowed used in index scan mode.
--
公益是一辈子的事,I'm Digoal,Just Do It.
At 2014-05-02 03:37:16,"Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>digoal@126.com writes:
>> Why stable function in select clause cann't optimized to one time call?
>
>Because its value might change between planning and execution.
>
>There was some discussion awhile back of performing run-time caching of
>the result, but it isn't done yet, and would impose some costs of its own.
>
>BTW, this sort of question is not a bug.
>
> regards, tom lane