Re: Some optimizations for COALESCE expressions during constant folding

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Some optimizations for COALESCE expressions during constant folding
Date: 2025-11-26 11:55:22
Message-ID: CAMbWs4_LE4B4baeF8GxYwxYYc+EhPrPFxV1ryBiSs0XxCOpwCA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 25, 2025 at 10:16 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> uhh, of course it is. That's what I did in [1] for Consts. Doing it
> this way means we'll not need to modify the constant folding code (or
> whichever other code wants to know when an Expr can't be NULL) every
> time we think of something new that we can prove can't be NULL.

OK. Here is an updated patch that does that. (There is some overlap
in changes to expr_is_nonnullable with the patch you mentioned.)

- Richard

Attachment Content-Type Size
v2-0001-Simplify-COALESCE-expressions-using-proven-non-nu.patch application/octet-stream 16.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2025-11-26 11:56:52 Re: transformJsonFuncExpr pathspec cache lookup failed
Previous Message jian he 2025-11-26 11:55:03 Re: transformJsonFuncExpr pathspec cache lookup failed