From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jian he <jian.universality@gmail.com>
Cc: Tender Wang <tndrwang@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: not null constraints, again
Date: Fri, 20 Sep 2024 14:08:28 +0200
Message-ID: <202409201208.oktu73fuvffw@alvherre.pgsql> (raw)
In-Reply-To: <CACJufxErXw2XVf9M-vb+Z1nzYOXD7UeNcQyzMqo3Qo7D-Wvppw@mail.gmail.com>
On 2024-Sep-20, jian he wrote:
> about set_attnotnull.
>
> we can make set_attnotnull look less recursive.
> instead of calling find_inheritance_children,
> let's just one pass, directly call find_all_inheritors
> overall, I think it would be more intuitive.
>
> please check the attached refactored set_attnotnull.
> regress test passed, i only test regress.
Hmm, what do we gain from doing this change? It's longer in number of
lines of code, and it's not clear to me that it is simpler.
> I am also beginning to wonder if ATExecSetNotNull inside can also call
> find_all_inheritors.
The point of descending levels one by one in ATExecSetNotNull is that we
can stop for any child on which a constraint already exists. We don't
need to scan any children thereof, which saves work.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Use it up, wear it out, make it do, or do without"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, jian.universality@gmail.com, tndrwang@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: not null constraints, again
In-Reply-To: <202409201208.oktu73fuvffw@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox