public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Justin Christensen <[email protected]>
Cc: David Rowley <[email protected]>
Cc: [email protected]
Subject: Re: Surprising behavior with pushing predicates down into a view
Date: Tue, 31 Mar 2026 13:54:16 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAH+MXdy3JJjtH1=AaWO2JcF1SHJk3v2AvnhSPyr4xfWB8cORFA@mail.gmail.com>
References: <CAH+MXdxJusXfQoyzF3x8U=nh+QxmfiqGxZ1kPYXTfd8Srx5ZHg@mail.gmail.com>
	<CAApHDvpCn2t07ag0Bh+P66pGMJj=u97ROBetTHyj71byMvcYAg@mail.gmail.com>
	<CAH+MXdy3JJjtH1=AaWO2JcF1SHJk3v2AvnhSPyr4xfWB8cORFA@mail.gmail.com>

Justin Christensen <[email protected]> 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






view thread (3+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Surprising behavior with pushing predicates down into a view
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox