| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Justin Christensen <justin(dot)christensen89(at)gmail(dot)com> |
| Cc: | David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Surprising behavior with pushing predicates down into a view |
| Date: | 2026-03-31 17:54:16 |
| Message-ID: | 2734942.1774979656@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Justin Christensen <justin(dot)christensen89(at)gmail(dot)com> writes:
> Ah. I did happen to skim the postgres source and I did see that subplans
> were being rejected in qual_is_pushdown_safe before I sent this over, and I
> noticed a few comments that made it seem like that was a design choice at
> the time that could stand to be revisited later: "XXX that could stand to
> be reconsidered, now that we use Paths."
Actually the relevant comment is this one:
* 1. rinfo's clause must not contain any SubPlans (mainly because it's
* unclear that it will work correctly: SubLinks will already have been
* transformed into SubPlans in the qual, but not in the subquery).
Somebody who was sufficiently determined could probably make that
happen, but it's very unclear how much code and messiness would be
required. Another potential path is to make SubLink->SubPlan
transformations happen later, after this step --- but I think that
would metastasize into a lot of places, and possibly have some
downsides in plan quality.
Short answer is that we might well end up rejecting such a patch even
if it got written. This limitation is decades old, and there have not
been that many complaints, so I doubt we'd accept any large increase
in complexity to remove it.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrey Borodin | 2026-04-02 11:18:29 | Re: BUG #19382: Server crash at __nss_database_lookup |
| Previous Message | Justin Christensen | 2026-03-31 16:00:09 | Re: Surprising behavior with pushing predicates down into a view |