Re: Some optimizations for COALESCE expressions during constant folding - Mailing list pgsql-hackers

From Matheus Alcantara
Subject Re: Some optimizations for COALESCE expressions during constant folding
Date
Msg-id DEVH211MP428.4FIKS7TFQAUD@gmail.com
Whole thread Raw
In response to Re: Some optimizations for COALESCE expressions during constant folding  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Some optimizations for COALESCE expressions during constant folding
List pgsql-hackers
On Wed Dec 3, 2025 at 3:39 AM -03, Richard Guo wrote:
> On Mon, Dec 1, 2025 at 5:11 PM Richard Guo <guofenglinux@gmail.com> wrote:
>> Attached is the patch set rebased on current master.  I have split the
>> patch into two parts: 0001 teaches eval_const_expressions to simplify
>> COALESCE arguments using NOT NULL constraints, and 0002 teaches
>> expr_is_nonnullable to handle COALESCE expressions.
>>
>> In addition, 0003 is a WIP patch that extends expr_is_nonnullable to
>> handle more expression types.  I suspect there are additional cases
>> beyond those covered in this patch that can be proven non-nullable.
>
> Here is an updated patchset.  I have reorganized the code changes as:
> 0001 simplifies COALESCE expressions based on non-nullable arguments.
> 0002 simplifies NullTest expressions for RowExprs based on
> non-nullable component fields.  It also replaces the existing use of
> var_is_nonnullable() with expr_is_nonnullable() for NullTests.  0003
> teaches expr_is_nonnullable() to handle more expression types.
>
Hi,

I think that this patch needs a rebase due to the changes on
predicate.sql introduced by c925ad30b04.

--
Matheus Alcantara
EDB: http://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Solaris versus our NLS files
Next
From: Melanie Plageman
Date:
Subject: Re: Fix uninitialized PruneFreezeResult in pruneheap and vacuumlazy