Re: Reduce "Var IS [NOT] NULL" quals during constant folding - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Reduce "Var IS [NOT] NULL" quals during constant folding
Date
Msg-id CAMbWs48QA+SU+8YFXNFg9nt45hvhi9ZHtDvwmz_oktt3Pa24tg@mail.gmail.com
Whole thread Raw
In response to Re: Reduce "Var IS [NOT] NULL" quals during constant folding  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
On Wed, Jul 30, 2025 at 3:17 PM Richard Guo <guofenglinux@gmail.com> wrote:
> create table t (a int, b int, c int);
>
> explain (costs off)
> select * from t t1
>  natural join t t2
>  natural join t t3
>  natural join t t4
>  natural join t t5
>  natural join t t6
>  natural join t t7
>  natural join t t8
>  natural join t t9
>  natural join t t10
> ;

FWIW, for this query, I've observed that table_open/table_close are
also called for each RTE_RELATION in build_physical_tlist().  Not sure
if we should also be concerned about those calls.

It's not clear to me how much performance impact an extra table_open
might have, especially when the lock is already held, and the relation
is likely present in the relcache.

Thanks
Richard



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: POC: enable logical decoding when wal_level = 'replica' without a server restart
Next
From: Peter Eisentraut
Date:
Subject: Improve prep_buildtree