Re: Making CASE error handling less surprising

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Making CASE error handling less surprising
Date: 2020-07-24 19:02:39
Message-ID: CAFj8pRDk-U6bHj8zFYkq+ZCbt4gQLPFKmZLXjrvAr9yBovQFQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 24. 7. 2020 v 19:46 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Andres Freund <andres(at)anarazel(dot)de> writes:
> > Wouldn't the rule that I proposed earlier, namely that sub-expressions
> > that involve only "proper" constants continue to get evaluated even
> > within CASE, largely address that?
>
> The more I think about that the less I like it. It'd make the behavior
> even harder to reason about than it is now, and it doesn't fix the issue
> for subquery pullup cases.
>
> Basically this seems like a whole lot of thrashing to try to preserve
> all the details of a behavior that is kind of accidental to begin with.
> The argument that it's a performance issue seems hypothetical too,
> rather than founded on any observed results.
>
> BTW, to the extent that there is a performance issue, we could perhaps
> fix it if we resurrected the "cache stable subexpressions" patch that
> was kicking around a year or two ago. That'd give us both
> at-most-one-evaluation and no-evaluation-until-necessary behaviors,
> if we made sure to apply it to stable CASE arms.
>

+1

regards

Pavel

> regards, tom lane
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Soumyadeep Chakraborty 2020-07-24 19:11:43 Re: [Patch] ALTER SYSTEM READ ONLY
Previous Message Peter Geoghegan 2020-07-24 18:31:23 Re: Default setting for enable_hashagg_disk