Re: Surprising optimizer behavior with a subquery, a GROUP BY, and a range filter

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wotq <wotq(at)wotq(dot)dev>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Surprising optimizer behavior with a subquery, a GROUP BY, and a range filter
Date: 2026-01-02 20:46:29
Message-ID: 267807.1767386789@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

wotq <wotq(at)wotq(dot)dev> writes:
> The following query isn't optimized as I would expect:

I don't see this misbehavior on HEAD or v18 branch tip. I suspect
it was fixed last week by [1] and/or [2].

regards, tom lane

[1] https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=ad66f705f
[2] https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=559f9e90d

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Kirkwood 2026-01-08 01:35:50 Unexpected planner choice in simple JOIN
Previous Message wotq 2026-01-02 20:26:55 Surprising optimizer behavior with a subquery, a GROUP BY, and a range filter