From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Reduce "Var IS [NOT] NULL" quals during constant folding |
Date: | 2025-03-21 17:49:30 |
Message-ID: | CAKFQuwbC0EUcrOXL5P7JUrwd-oHQSOm5WELgstPE_2M10L2ghQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Mar 21, 2025 at 10:21 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > However, I'm a bit concerned about the overall premise of the patch
> > set. It feels like it is moving something that really ought to happen
> > at optimization time back to parse time. I have a feeling that's going
> > to break something, although I am not sure right now exactly what.
>
> Ugh, no, that is *completely* unworkable. Suppose that the user
> does CREATE VIEW, and the parse tree recorded for that claims that
> column X is not-nullable. Then the user drops the not-null
> constraint, and then asks to execute the view. We'll optimize on
> the basis of stale information.
>
> The way to make this work is what I said before: move the planner's
> collection of relation information to somewhere a bit earlier in
> the planner. But not to outside the planner.
>
Reading this reminded me of the existing issue in [1] where we've broken
session isolation of temporary relation data. There it feels like we are
making decisions in the parser that really belong in the planner since
catalog data is needed to determine relpersistence in many cases. If we
are looking for a spot "earlier in the planner" to attach relation
information, figuring out how to use that to improve matters related to
relpersistence seems warranted.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-03-21 17:53:27 | Re: Next commitfest app release is planned for March 18th |
Previous Message | Tom Lane | 2025-03-21 17:41:54 | Re: Parallel safety for extern params |