Re: [HACKERS] Suboptimal evaluation of CASE expressions

2006-04-11 Thread Andreas Tille
On Tue, 11 Apr 2006, Tom Lane wrote: We could maybe change things so that the finalfunc isn't run unless the result value is actually demanded in the SELECT list or HAVING clause, but for 99.99% of applications checking that would be a waste of cycles, so I'm disinclined to do it. I'm lacking

Re: [HACKERS] Suboptimal evaluation of CASE expressions

2006-04-11 Thread Andreas Tille
On Tue, 11 Apr 2006, Martijn van Oosterhout wrote: Because there were no non-null rows, the system passed a NULL to the final func. Seems you have two ways of dealing with this. Mark the finalfunc as STRICT so the system won't call it with NULL. Or give the agrregate an INITCOND which is an empt

[HACKERS] Suboptimal evaluation of CASE expressions

2006-04-11 Thread Andreas Tille
Hi, when dealing with a bug in the postgresql-plr interface I think I found a suboptimal method to process CASE statements. First to the problem: I'm using the Debian packaged version of PLR version 0.6.2-2 (Debian testing) and found a problem calculating median from a set of values that contai