public inbox for [email protected]
help / color / mirror / Atom feedFrom: David Rowley <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Optimize SELECT * in EXISTS
Date: Mon, 23 Feb 2026 21:41:22 +1300
Message-ID: <CAApHDvprYAAA1szsC3+OYWss4ALJp0wG7Qbw8Zu+s7pq1gm3yA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On Mon, 23 Feb 2026 at 21:21, Peter Eisentraut <[email protected]> wrote:
> I read in the SQL standard that SELECT * in EXISTS is not supposed to be
> expanded to all columns, but only to an arbitrary literal. This
> corresponds to the recommendation in the PostgreSQL documentation to
> write EXISTS (SELECT 1 ...) instead. But not even our own tests and
> example code use that latter convention consistently, so I think many
> users don't know it or observe it either. So implementing that little
> optimization for SELECT * seems reasonable.
> Thoughts?
Don't we already do this in simplify_EXISTS_query()?
David
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]
Subject: Re: Optimize SELECT * in EXISTS
In-Reply-To: <CAApHDvprYAAA1szsC3+OYWss4ALJp0wG7Qbw8Zu+s7pq1gm3yA@mail.gmail.com>
* 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