Search Postgresql Archives

Re: right way of using case-expressions in plpgsql functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday, October 15, 2023, Victor Dobrovolsky <booby.stager@xxxxxxxxx> wrote:

select (case when px is not null then pf = px
        else pf is not distinct from py
end);


Every single time this function is called “px is not null” will be evaluated and then one of the two branches will be evaluated.  Nothing the optimizer does will change that.  The planner for the function internals does not know whether px will or will not be null on any given invocation.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux