agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Matheus Alcantara <matheusssilv97@gmail.com>
To: 陈列行 <2320415112@qq.com>
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #19572: Redundant predicate changes JIT decision and causes an 18x performance difference
Date: Fri, 31 Jul 2026 08:48:29 -0300
Message-ID: <DKCQEBNRSEHK.1BWKETIC2RW84@gmail.com> (raw)
In-Reply-To: <tencent_10669405A4B4ACADC37A29811DDD81AC260A@qq.com>
References: <19572-f770e89412629023@postgresql.org>
	<DKB8Q0DL1Y1C.177HDXZVZ0G6U@gmail.com>
	<tencent_10669405A4B4ACADC37A29811DDD81AC260A@qq.com>

On Thu Jul 30, 2026 at 3:44 AM -03, =?utf-8?B?6ZmI5YiX6KGM?= wrote:
> Thanks for the detailed analysis.
>
>
> You are completely right—the query produces correct results, so it's
> an estimation/costing issue rather than a correctness bug.
>
>
> Regarding whether it's worth addressing: In real-world applications,
> especially those using ORMs or complex auto-generated SQL, redundant
> predicates (or transitive quals across joins) are actually quite
> common. When a redundant qual causes the estimated row count to drop
> significantly, it can severely distort the plan choice or prematurely
> cross cost thresholds (like JIT enablement, as seen here).
>

Yeah, I'm not surprised that ORMs may generate such queries. I've posted
about this on -hackers [1].

[1] https://www.postgresql.org/message-id/DKBX1KUW8KUW.2DU5RD192DHIQ%40gmail.com

--
Matheus Alcantara
EDB: https://www.enterprisedb.com






view thread (3+ messages)

Message-ID: <DKCQEBNRSEHK.1BWKETIC2RW84@gmail.com>
Permalink:  ../DKCQEBNRSEHK.1BWKETIC2RW84@gmail.com/
Also on:    postgresql.org/message-id/DKCQEBNRSEHK.1BWKETIC2RW84@gmail.com

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: pgsql-bugs@postgresql.org
  Cc: matheusssilv97@gmail.com, 2320415112@qq.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19572: Redundant predicate changes JIT decision and causes an 18x performance difference
  In-Reply-To: <DKCQEBNRSEHK.1BWKETIC2RW84@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