public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Nyasha Chigwamba <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: LATERAL subquery predicate pushdown: filter applied after JSON construction instead of inside join (PG 18)
Date: Wed, 11 Feb 2026 12:37:38 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CH0PR10MB4908BD90B3C5155DF98D88A2B463A@CH0PR10MB4908.namprd10.prod.outlook.com>
References: <CH0PR10MB4908BD90B3C5155DF98D88A2B463A@CH0PR10MB4908.namprd10.prod.outlook.com>
Nyasha Chigwamba <[email protected]> writes:
> Question: Can the planner push predicates on view columns into the underlying LATERAL subqueries?
It can, but it will not push them into a subquery with LIMIT,
because that would potentially change the subquery result.
I'd try to get rid of all those ORDER BY LIMIT bits in your
view definition. That's generally considered an antipattern
in SQL. It's definitely an optimization fence.
regards, tom lane
view thread (3+ messages) latest in thread
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]
Subject: Re: LATERAL subquery predicate pushdown: filter applied after JSON construction instead of inside join (PG 18)
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