Re: Fix HAVING-to-WHERE pushdown with mismatched operator families - Mailing list pgsql-hackers

From Tender Wang
Subject Re: Fix HAVING-to-WHERE pushdown with mismatched operator families
Date
Msg-id CAHewXNkk=uc-6rgOd=Z4R-Q9OqM0jcZ2N1K+DaqvTZ3dxhLXOA@mail.gmail.com
Whole thread
In response to Re: Fix HAVING-to-WHERE pushdown with mismatched operator families  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Fix HAVING-to-WHERE pushdown with mismatched operator families
List pgsql-hackers
Richard Guo <guofenglinux@gmail.com> 于2026年6月30日周二 17:22写道:
>
> On Mon, Jun 29, 2026 at 5:32 PM Tender Wang <tndrwang@gmail.com> wrote:
> > If we find a function wrapped on the Var, we give up the qual pushed down.
> > We still have the optimization opportunity that if the OpExpr contains
> > a bare Var on one side.
> This would make us fail to push some clauses that are in fact safe but
> that we cannot prove safe.  But I think those cases are very narrow:
> they require a nondeterministic grouping key with a function-wrapped
> qual on it, and a plain direct comparison such as x = 'foo' COLLATE ci
> still pushes, so the optimization loss is small and limited to
> nondeterministic collations.
>
> Thoughts?

I look through the v3 patch.  I didn't find an obvious issue. +1

> IIUC, this has nothing to do with what we are trying to fix here.  For
> this query, the qual cannot be pushed down either even without this
> patch.  So I don't feel motivated to touch it in this patch.

Yeah, the previous query I reported has nothing to do with the topic
we're talking about here.
Ignore the noise.


--
Thanks,
Tender Wang



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: GetBufferDescriptor() being called for local buffers from MarkBufferDirtyHint()
Next
From: Japin Li
Date:
Subject: Re: Global temporary tables