David,
thank you for your opinion, so it is a chance for future optimization.
Whether or not this „should not happen“ is a different discussion. 😉
-Markus
Von: David G. Johnston <david.g.johnston@gmail.com>
Gesendet: Donnerstag, 3. August 2023 16:48
An: [Quipsy] Markus Karg <karg@quipsy.de>
Cc: pgsql-bugs@lists.postgresql.org
Betreff: Re: WHERE column = X AND column = Y will always be zero matching rows
On Thursday, August 3, 2023, [Quipsy] Markus Karg <karg@quipsy.de> wrote:
EXPLAIN SELECT column FROM Table WHERE column = X AND column = Y
…says that PostgreSQL actually wants to perform a Scan!
I wonder why squandering any resources into a Scan here
Mostly because no one wants to volunteer to write code to deal with poorly written queries, nor, more technically, expend compute resources looking for situations that should not happen.